summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* pdbg: Tidy up putnia/putmsrRashmica Gupta2018-06-011-4/+4
| | | | | | | The number of arguments required for these functions is wrong - it requires 2 arguments for putnia and putmsr, and the second one is written. The code has obviously been copy/pasted from getgpr/getspr functions where you need to supply which register and then the data.
* Remove "expert" modeAlistair Popple2018-05-251-28/+4
| | | | | | | | | | Based on feedback it seems "expert" mode was too vague and confusing for users, so remove it. This means the user will be forced to manually manage the state of the system which also seems to be too confusing for some users, but a future patch will add user-friendly commands to the application which will change the system state as required. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* main: Print just the command basenameMichael Neuling2018-05-241-4/+5
| | | | | | | | | Instead of outputting: Usage: /root/mikey/pdbg/.libs/pdbg output Usage: pdbg Signed-off-by: Michael Neuling <mikey@neuling.org>
* main: Exit 0 when printing versionMichael Neuling2018-05-241-1/+1
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* main: Fix -D optionMichael Neuling2018-05-241-1/+1
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* libpdbg: Wrappers for cache inhibited adu_getmem and adu_putmemJoel Stanley2018-05-241-3/+3
| | | | | | | | | | | | | | | | | | Tacking a boolean parameter onto the end of the a function makes it hard to read the code at call sites and know what is going on. See Rusty's API levels, point 6 and 7: 7. The obvious use is (probably) the correct one. 6. The name tells you how to use it. From http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html Cache inhibited is probably not what you're after, unless you know that you're after it. These wrappers remove the boolean from the user callable API. Signed-off-by: Joel Stanley <joel@jms.id.au>
* libpdbg: Make get/putmem ci argument a booleanJoel Stanley2018-05-241-4/+4
| | | | | | | In some places it's declared as one, others it's not. It's used as one, so lets do it. Signed-off-by: Joel Stanley <joel@jms.id.au>
* main: Return false on failureAmitay Isaacs2018-05-241-2/+2
| | | | | | | If a boolean function returns true on error, it's just recipe for all sorts of programming errors. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Fix usage for expert optionAmitay Isaacs2018-05-241-1/+1
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Do not include libpdbg internal headersAmitay Isaacs2018-05-2410-17/+11
| | | | | | | | | | | | | 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-243-4/+8
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Abstract thread statusAlistair Popple2018-05-242-30/+31
| | | | | | | | | | | | | | | | 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>
* pdbg: Fix target selection when using I2CAlistair Popple2018-05-241-3/+7
| | | | | | | | | | I2C based access is unique in that to access the PIB on secondary processors we need to traverse the PIB on the primary processor. This confuses our current selection logic as every core becomes a child of the primary PIB. Hopefully our selection logic will get rewritten soon, but in the meantime add a check to ensure a cores immediate parent PIB matches the currently selected processor. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* main: Conditionally build device trees based on archAmitay Isaacs2018-05-181-5/+14
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Use auto-generated device tree headersAmitay Isaacs2018-05-181-20/+12
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Improve debug output about backends/targetsAmitay Isaacs2018-05-183-20/+8
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Avoid dumping usage when useful information is printedAmitay Isaacs2018-05-181-2/+0
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Shorten usage description for htm subcommandAmitay Isaacs2018-05-181-1/+1
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Print command descriptions in usageAmitay Isaacs2018-05-181-2/+2
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Add -D option to specify debug levelAmitay Isaacs2018-05-181-1/+8
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* pdbg: add basic kernel stack trace to 'regs' commandNicholas Piggin2018-05-183-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NIA : 0xc000000000984604 CFAR : 0xc00000000098461c MSR : 0x9000000000009033 LR : 0xc0000000009846e4 CTR : 0xc000000000984560 TAR : 0x0000000000000000 CR : 0x24004424 XER : 0x00000000 GPRS : 0xc0000000009845a8 0xc000000006e07d90 0xc000000001306000 0x0000000000000000 0x0000000000000001 0x0000000000000000 0x0000000000000009 0x0000000000000808 0x0000000000000000 0x00000565ba95ebcd 0xc000000006e04000 0x822ca467ef411b43 0xc000000000984560 0xc000000ffffe0200 0xc000000006e07f90 0x0000000000000000 0x0000000000000000 0xc000000000029d8c 0xc000000000043630 0xc000000000fa5410 0x0000000000000800 0xc0000000013481f4 0x0000000000000026 0x0000000000000000 0x0000000000000001 0x0000000000000000 0x0000000000000000 0x0000000000000000 0xc000000001266ba0 0xc000000ff57a1d58 0x0000000000000000 0x00000565ba95f7b5 LPCR : 0x0040400001d2f012 PTCR : 0x0040400001d2f012 LPIDR : 0x0000000000000000 PIDR : 0x0000000000080081 HFSCR : 0x000000000000059f HDSISR: 0x00000000 HDAR : 0x0000000000000000 HSRR0 : 0xc000000000984618 HSRR1 : 0x9000000000009033 HDEC : 0xfffffaa5941c2f0a HSPRG0: 0xc000000ffffe0200 HSPRG1: 0xc000000ffffe0200 FSCR : 0x0000000000000184 DSISR : 0x00000000 DAR : 0x0000000000000000 SRR0 : 0xc000000000984608 SRR1 : 0x9000000000009033 DEC : 0xfffffffee1c2b8cf TB : 0x00000566dd7f0784 SPRG0 : 0x0000000000000000 SPRG1 : 0x0000000000000000 SPRG2 : 0x0000000000000000 SPRG3 : 0x0000000000000000 PPR : 0x0004000000000000 STACK: 0xc000000006e07dd0 0xc00000000098170c 0xc000000006e07e40 0xc00000000013e60c 0xc000000006e07e60 0xc00000000013e920 0xc000000006e07ed0 0xc00000000013eeb8 0xc000000006e07f00 0xc000000000045bc4 0xc000000006e07f90 0xc00000000000af70 Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* pdbg: add 'regs' commandNicholas Piggin2018-05-183-0/+20
| | | | | | | | | | | This uses ramming to pull out most registers. There are more SPRs to left to add. Ramming remains set over all register extraction, by keeping ram_is_setup target attribut. This helps to speed things up and minimise disturbance to the host. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg/p9chip.c: allow sreset in !expert modeNicholas Piggin2018-05-181-1/+1
| | | | | | | | | | | | Have sreset work in !expert mode, by stopping threads automatically. There is some indication in the workbook that the sreset control works on running threads, but testing has so far proven otherwise, so stop them if they were not stopped. Expert mode still require it only be used on threads already stopped. Signed-off-by: Nicholas Piggin <npiggin@mgail.com>
* pdbg: add an expert modeNicholas Piggin2018-05-181-18/+53
| | | | | | | | | | | Add an --expert mode which contains dangerous options or things which are "stateful" between pdbg invocations, where the release command and possibly others need to be run to return the system to a normal state. If you're not in expert mode, you just run a command and that's it. More commands can be added to expert mode as we go. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* pdbg: Add progress tick callbacks for get/putmemAlistair Popple2018-05-171-0/+7
| | | | | | People like progress bars. Give the people what they want. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add function to register progress tick callbackAlistair Popple2018-05-172-8/+6
| | | | | | | | | | For long running library operations such as getmem it is useful to give the application an ability to report progress back to the user. This adds a way to register a progress_tick callback which takes the current and maximum progress counts. Signed-off-by: Alistair Popple <alistair@popple.id.au> Suggested-by: Amitay Isaacs <amitay@ozlabs.org>
* pdbg: Add progress bars utilityJoel Stanley2018-05-172-0/+123
| | | | | | | | This comes from skiboot's pflash utility. Source is copyright IBM under Apache 2.0. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdg: Add option to write to / read from cache inhibited memoryRashmica Gupta2018-05-171-11/+18
| | | | | | | Using P9_TTYPE_CI_PARTIAL_WRITE instead of P9_TTYPE_CI_PARTIAL_OOO_WRITE because that is what cronus does. Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg: Add missing lazy probe in putmemRashmica Gupta2018-05-171-0/+3
| | | | | | Without this patch, attempting to write to memory causes a segfault. Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
* pdbg: provide a release functionNicholas Piggin2018-05-162-0/+52
| | | | | | | | | Special wakeup needs to remain asserted e.g., between stopping a thread and reading registers, so targets can't be released between invocations of pdbg automatically. So provide an explicit release function that must be called when we're done with our targets. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* 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>
* thread.c: threadstatus improve output and implement P9 stopNicholas Piggin2018-05-081-39/+63
| | | | | | | There's no point compressing status down to a single letter. Add letters for each mode we are intereted in. Add the P9 stop state. Signed-off-by: Nicholas Piggin <npiggin@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-303-2/+22
| | | | | | | | | | | 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>
* libpdbg: Add support for getring on POWER9Alistair Popple2018-04-273-0/+112
| | | | | | Add basic support for a getring operation on POWER9. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* pdbg/htm: Enforce powersave=offCyril Bur2018-04-263-2/+46
| | | | | | | | | | | | | 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>
* pdbg: Make target selection explicitAlistair Popple2018-04-261-7/+41
| | | | | | | | | | | | | | | | | | | | We have now moved entirely to lazy probing of targets. This means client applications now need to explicitly probe each child target they need rather than explicitly marking everything they need prior to initialising the library. This leads to problems with device selection in pdbg as previously it would run a command on every target which was found to exist after probing which would ignore disabled targets. However disabling a target now prevents it being probed even if child targets require it so pdbg can no longer set a target to disabled just because it doesn't want to run a command on that target. Instead it needs to explicitly record which targets a command should be run on. This is performed by marking each target as selected or not prior to running commands. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Lazy probingCyril Bur2018-04-264-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libpdbg/p8chip: Return thread SMT stateCyril Bur2018-04-241-3/+4
| | | | | | | | | | | | | | | | | Thread status can return the current hardware smt state of a thread pretty easily, the information is in POW_STATUS_REG which we already read. It should be noted that the value read by the scom has nothing to do with the ppc64_cpu --smt value. The value returned by the hardware is really how the hardware is operating, it will happy be in SMT1 and having a thread using the entire core. The other threads to not need to be asleep for SMT1 to be reported, something like the Linux idle loop (but without sleep states) will do it. This means that an SMT1 thread with three others active threads spinning could at any time jump report SMT4 depending on the load of the system. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* pdbg: Fix using FSI backend on palmettoCyril Bur2018-04-242-10/+18
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Attempt to automatically discover targetCyril Bur2018-02-166-4/+321
| | | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* 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-163-81/+158
| | | | | | 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-162-10/+54
| | | | 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 the actions array to print the commandsCyril Bur2018-02-161-25/+4
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Remove oldstyle command parsingCyril Bur2018-02-161-84/+1
| | | | | | | It should be noted here that 'GETVMEM' was declared but never actually used so it has disapeared from the source entirely. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for probeCyril Bur2018-02-161-9/+15
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
OpenPOWER on IntegriCloud