summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* tests: Add tests for libpdbg probe functionsAmitay Isaacs2018-09-071-0/+253
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* tests: Add tests for libpdbg target functionsAmitay Isaacs2018-09-071-0/+256
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* progress: No more progressJoel Stanley2018-09-073-1/+26
| | | | | | | | | This adds an option to suppress progress: -S, --shutup Shut up those annoying progress bars Signed-off-by: Joel Stanley <joel@jms.id.au>
* main: Add P8 kernel devicetreeBenjamin Herrenschmidt2018-09-071-1/+9
| | | | | | | This makes palmettos use kernel backend on bmc using coldfire driver. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* src/thread.c: Don't print uninitialised thread statusAlistair Popple2018-08-141-2/+8
| | | | | | | | | | Depending on the selection flags passed to pdbg not all threads will be selected. This was leading to random uninitialised values being used to print thread status for unselected threads. Instead nothing should be printed for those threads. Signed-off-by: Alistair Popple <alistair@popple.id.au> Acked-by: Nicholas Piggin <npiggin@gmail.com>
* Make pdbg_target_release() recursively release a targets childrenAlistair Popple2018-08-131-34/+1
| | | | | | | Also removes the "release" command from pdbg which should no longer be necessary as pdbg will automatically call release to clean-up. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Remove PDBG_TARGET_PENDING_RELEASE statusAlistair Popple2018-08-131-2/+1
| | | | | | | | This doesn't seem to be used for anything and simply creates another target state which adds complexity. Either a target was released or it wasn't (because it's children have not been released). Signed-off-by: Alistair Popple <alistair@popple.id.au>
* main: Fix print_target to only print selected targetsAmitay Isaacs2018-08-131-1/+8
| | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* main: Do not reset the previous selections in the listAmitay Isaacs2018-08-131-4/+0
| | | | | | | | This allows calling parse_list() multiple times to incrementally keep selecting entries for options -p/-c/-t/-l. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* main: Fix target selection of linux cpusAmitay Isaacs2018-08-131-9/+7
| | | | | | | | The selection should be applied to all the linux cpus in the list and not just the first one. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* main: Use the correct length of linux cpu listAmitay Isaacs2018-08-131-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* main: Define MAX_LINUX_CPUS for convenienceAmitay Isaacs2018-08-131-1/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* mem: Avoid floating point exception if size == 0Amitay Isaacs2018-08-021-0/+5
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* progress: Add assert to avoid programming errorsAmitay Isaacs2018-08-021-0/+3
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* progress: Refactor progress_bar to print progress barsAmitay Isaacs2018-08-021-17/+20
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* progress: End function on a new lineAmitay Isaacs2018-08-021-1/+2
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Address by linux CPU number with PPC host backendMichael Neuling2018-08-021-2/+105
| | | | | | | | | | | | With the PPC host backend used for HTM it's difficult to match up the hardware numbers used pdbg with linux CPU numbers that people want to affinitise a workload against (ie. taskset -c <cpu number>). This adds a new "-l <cpu>" options so users can address the CPU to target using linux CPU numbers. This is only available when using the host backend on POWER machines. Signed-off-by: Michael Neuling <mikey@neuling.org>
* Revert "main: Select only the targets specified on cmdline"Michael Neuling2018-08-021-9/+0
| | | | | | | | | | | | | This reverts commit 60d0ab1a23ae02bc4ea361899731d8b710920c99. This is fixed by: ca56cd36d6 main: Init list of procs/cores/threads Also causes problem when implementing -l option (future patch which address Linux CPUs) as [plc]_count won't be set and will result in us returning early. Signed-off-by: Michael Neuling <mikey@neuling.org>
* putmem: Fix Floating point exception issueVasant Hegde2018-07-121-0/+3
| | | | | | | Validate read() before calling __adu_putmem(). Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* probe: Validate target classVasant Hegde2018-07-121-0/+4
| | | | | | Make sure target class is not NULL before comparision. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
* main: Init list of procs/cores/threadsMichael Neuling2018-07-121-0/+4
| | | | | | These are just on the stack so will contain anything. Signed-off-by: Michael Neuling <mikey@neuling.org>
* main: Update help output for HTMMichael Neuling2018-07-121-1/+1
| | | | | | Remove reset, dump and analyse. Add record. Signed-off-by: Michael Neuling <mikey@neuling.org>
* main: Select only the targets specified on cmdlineAmitay Isaacs2018-07-121-0/+9
| | | | | | | | | | | This fixes the problem of incorrectly selecting threads for following command-line without any thread specification. pdbg -p 0 -c 0 ... Before iterating through [pct]_list, confirm that [pct]_count > 0. Signed-off-by: Amitay Isaacs <amitay@ozlabs.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>
* pdbg: Fix htm return codesMichael Neuling2018-07-121-1/+1
| | | | | | | | | | | | | | The following commit change the way htm is run causing all htm commands to fail. commit 92006e53c927472d62ee1637e6ad6cad35b53d5e Author: Alistair Popple <alistair@popple.id.au> Date: Wed Jun 20 15:34:09 2018 +1000 pdbg: Use new command parsing This fixes it by correctly setting the return code. Signed-off-by: Michael Neuling <mikey@neuling.org>
* pdbg: Use new command parsingAlistair Popple2018-06-2513-521/+234
| | | | | | | | | This switches all commands except the htm command to use the new command/option parsing code. For the moment we leave the usage help and generic targeting flag processing alone, but future changes should allow this to also use the common parsing code. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* optcmd: Add testsAlistair Popple2018-06-251-0/+161
| | | | | | | | We don't really have infrastructure in place to easily add/build/run tests, but that shouldn't stop them being written. This adds some basic tests of the argument parsing logic. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* pdbg: Define common command/flag argument parsersAlistair Popple2018-06-252-0/+106
| | | | | | | | | | | | Parsers need to take a string argument and convert it into a specific type, returning the value as a pointer to memory allocated by the parser (or NULL in the case of an error). This just defines a couple of common parsers useful for various commands. It also defines a couple of convenience macros for easier usage of these parsers. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* pdbg: Add command/flag parsing definitionsAlistair Popple2018-06-252-0/+295
| | | | | | | | | | | | | | | | | | | | | | | | | Add code to support command argument and flag parsing. A future patch will update existing code to use these parsers. The idea behind this code is to allow easily calling C functions from the command line without requiring shim/boilerplate functions to marshal arguments and flags which can be repetitive and error prone. In general a command consists of positional arguments and non-positional flags which optionally take arguments as shown below: cmd_name <arg1> <arg2> ... <argN> --flag1=<arg?> --flag2 ... --flagM It supports default values for the last N postional arguments which allows trailing arguments to be made optional. The above definition allows a function with the following prototype to be called directly without any manual shim code: cmd_name(arg1, arg2, ... argN, flags) Where `flags` is a struct defined elsewhere containing fields which will match with the flag specification. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* 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>
* Make -a the default for probeMichael Neuling2018-06-251-4/+0
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* Make i2c backend possible on all ARM machinesJoel Stanley2018-06-151-1/+1
| | | | | | | | | | | It's not only devices that have the AMI i2c path that can use pdbg over i2c. I chose not to plumb in the access check, as this can be done when attempting to open the device (otherwise we're duplicating that check). Signed-off-by: Joel Stanley <joel@jms.id.au>
* 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-153-110/+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>
* Increase max processors for sparse chip id configsMichael Neuling2018-06-151-1/+1
| | | | | | | | | This bumps up the MAX_PROCESSORS to 64 so we support more machines. On a Tuletta with 2 DCMS, we end up with chip ids 0, 1, 16 and 17. We can't use the last two chips with the current setting. Signed-off-by: Michael Neuling <mikey@neuling.org>
* Cleanup exit codeMichael Neuling2018-06-151-11/+6
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* main: Print specific errors for invalid commandsAmitay Isaacs2018-06-151-1/+0
| | | | | | This avoids large usage message obscuring the actual error message. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Print specific errors for invalid argumentsAmitay Isaacs2018-06-151-16/+16
| | | | | | | This avoids the large usage message obscuring the actual errors from parsing options. Print usage only if an option is invalid. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* main: Overhaul target selectionAmitay Isaacs2018-06-151-40/+151
| | | | | | | | | | | | | | | | | | | | | | | | | Support explicit multiple target selection using ranges and lists. For options -p/-c/-t, support the following valid arguments: 3 0-7 1,2,3 0-5,7,9-11,17,19 For loss of sanity, make sense of the following valid arguments: 3,3,3,3,3,3 1-6,2-5 1,2,3,0-7 Conjunction of -p/-c/-t with -a also works and it's insensitive to order of options specified. -a -c 1,2 processors 0-max; chips 1-2; threads 0-max -p 0 -c 0 -a processors 0; chips 0; threads 0-max -a -c 1 -t 1 processors 0-max; chips 1; threads 1 Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
OpenPOWER on IntegriCloud