summaryrefslogtreecommitdiffstats
path: root/src/htm.c
Commit message (Collapse)AuthorAgeFilesLines
* main: Convert htm commands to path based targetingAmitay Isaacs2018-12-031-44/+62
| | | | | | | | | If none of the expected targets are selected, log an error. core htm - core target nest htm - pib target Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Remove device.hAlistair Popple2018-11-091-1/+0
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* htm: Setup targetting for nest htmMichael Neuling2018-09-071-1/+11
| | | | | | Without this, nest HTM commands target nothing. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove size from dumpMichael Neuling2018-07-121-1/+1
| | | | | | This isn't used and just complicates things. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Change buffer wrappings semanticsMichael Neuling2018-06-251-2/+2
| | | | | | | | "htm record" is set to non-wrapping mode "htm start" is in wrapping mode since it's assumed "htm stop" will stop it. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Add record commandMichael Neuling2018-06-251-0/+32
| | | | | | | This starts the trace, waits for it to complete (ie fill the buffer), then stops the trace and dumps out the file. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Print dump file from libraryMichael Neuling2018-06-251-1/+0
| | | | | Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* htm: Remove reset by adding it to startMichael Neuling2018-06-251-25/+0
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove base/size from resetMichael Neuling2018-06-251-10/+1
| | | | | | Base/size aren't needed so remove them. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove trace and analyseMichael Neuling2018-06-251-36/+0
| | | | | | | | These don't really make and sense. We are going to make things simpler with start, stop, dump and also add a record commands that does it all. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove old comments and printsMichael Neuling2018-06-251-12/+1
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Fix dump filenameMichael Neuling2018-06-151-21/+14
| | | | | | | | | | Currently we always generate 0.0-htm.dump irrespective of the chip, core and thread it's generated from. This changes it to htm-p??-c??-t??.dump using the correct CPU being run on. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Few code cleanupsMichael Neuling2018-06-151-13/+13
| | | | | | | | | | Remove unused arguments. Remove unused pause command. Make < 80 cols Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Cleanup status outputMichael Neuling2018-06-151-2/+1
| | | | | | | Actually print something in status output. Drop some of the more esoteric details to PR_INFO() Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Print chip being targeted properlyMichael Neuling2018-06-151-3/+6
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Only check that the primary thread is runningMichael Neuling2018-06-151-7/+23
| | | | | | htm only works in SMT1 mode, check for that. Signed-off-by: Michael Neuling <mikey@neuling.org>
* Remove htm_* optionsMichael Neuling2018-06-151-95/+0
| | | | | | | | | These have been marked deprecated for a while and are just taking up room in the help, so let's remove them. The are replaced with "htm core|nest [options]" Signed-off-by: Michael Neuling <mikey@neuling.org>
* main: Do not include libpdbg internal headersAmitay Isaacs2018-05-241-2/+3
| | | | | | | | | | | | | There are few execptions: - src/thread.c, src/htm.c These require bitutils.h. The correct fix might be to include thread abstraction in libpdbg. - src/main.c This requires target.h. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Use pdbg logging api in pdbgAmitay Isaacs2018-05-241-0/+3
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Abstract thread statusAlistair Popple2018-05-241-3/+4
| | | | | | | | | | | | | | | | There is currently no abstraction of thread status between library and application. It just passes the hardware specific values down. There is also no interface exported in the library headers to read status. This makes it difficult to implement more advanced functionality in the application as there is no way hardware agnostic way to determine if a thread is in powersave mode or not for example. Instead introduce a hardware agnostic thread state so that we can implement more advanced functionality such as automatically stopping threads if required. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* htm: Avoid segfault when an option is omittedRashmica Gupta2018-05-081-1/+8
| | | | | | | | Currently if the user omits an htm command such as 'start' or 'stop' we segfault. This happens because we check for the wrong number of arguments. Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg/p9chip.c: query thread active and stop statesNicholas Piggin2018-05-081-1/+4
| | | | Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* src/htm.c: Only run on selected targetsAlistair Popple2018-04-301-0/+18
| | | | | | | | | | | The HTM does not call the same target iterators as the rest of the pdbg application. Therefore the changes to device selection were not carried over. Longer term we should change the HTM code to call the same iterators as the rest of the pdbg application, but for the moment just copy the device selection code across as the longer term fix really requires rewritting the iterators to not use callbacks. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* pdbg/htm: Enforce powersave=offCyril Bur2018-04-261-1/+43
| | | | | | | | | | | | | Core HTM has a nasty habit of not working if the stars haven't aligned with the exact polar axis of Mars. To complicate matters if Zeus got up on the incorrect side of the bed Core HTM will likely reflect his mood. Core HTM requires that no threads be in powersave. It isn't clear if this restriction only applies to threads on the core being traced on or if this is a global thing. In order to be as safe as possible, pdbg will enforce that powersave be disabled globally. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* pdbg/htm: Fix error checking condition for htm dump commandCyril Bur2018-04-261-1/+1
| | | | | | | | We only call into libpdbg with one HTM unit, libpdbg returns how many HTM units it operated on. A successful calling of HTM dump would expect a return value of 1, so not 1 is an error. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg: Lazy probingCyril Bur2018-04-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When libpdbg runs though the device tree and calls probe() on all the targets it marks any node (and all its children) which fails to probe as "disabled". When pdbg recieves arguments to specifiy a pib, core or thread (-p -c -t) it runs though the device tree and marks nodes which do not match the specified -p -c or -t as "disabled". These two scenarios are related - that is we don't want to be operating on any disabled nodes. However, they are not the same. Consider HTM wanting to know if the machine has powersave disabled. A simple way would be to loop through all the threads and if any of them are not in "active" state then powersave must be enabled. In this scenario HTM want to be able to get the status of every thread on the machine regardless of -p -c -t flags but if the machine isn't fully speced out and has cores which didn't probe, HTM wants to know to ignore those threads. This patch introduces a "nonexistant" pdbg target status which is set during libpdbg probe() time. Later pdbg can mark nodes to targets that do 'exist' but it would like to avoid as "disabled". Attempting to solve the above problem with only a "nonexistant" flag would also require everything to be probed before selecting out chips and threads that the user is not interested in. This would be highly inefficient. This patch probes the system lazily. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* htm: Fix HTM namingCyril Bur2018-04-241-40/+38
| | | | | | | Somehow HTM started not putting the correct indexes and it started becoming impossible to know which htm was being used. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* pdbg/htm: Force the user to learn the new HTM commandsCyril Bur2018-02-161-10/+65
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Add HTM functions to deal with Core HTMCyril Bur2018-02-161-74/+148
| | | | | | This commit also updates the README to only reference the new commands Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* htm: Check that nodes aren't disabledCyril Bur2018-02-161-10/+49
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg/htm: Convert current HTM function names to Nest HTMCyril Bur2018-02-161-9/+9
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for HTMCyril Bur2018-02-161-7/+7
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull HTM functions out of main.cCyril Bur2018-02-161-0/+231
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
OpenPOWER on IntegriCloud