summaryrefslogtreecommitdiffstats
path: root/libpdbg/htm.c
Commit message (Collapse)AuthorAgeFilesLines
* libpdbg: Use index instead of chip-id for idAmitay Isaacs2018-12-071-4/+7
| | | | | | | Instead of using two different ways to id various chiplets, consistently use "index" property. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Split nhtm hardware units for p8 and p9Amitay Isaacs2018-12-031-6/+21
| | | | | | | | | | Even though device tree compatible property can hold multiple strings, the struct pdbg_target definition can only take a single compatible string. Also, rename chtm hw unit to match nhtm. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Rework target compatibleAlistair Popple2018-11-091-4/+4
| | | | | | | | | Rework the target compatible code to reuse existing libpdbg code where possible. Renames and exports these functions for use by external libraries. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Rework chip-id functionsAlistair Popple2018-11-091-11/+1
| | | | | | | | | Rename the chip-id functions to be consistent with other libpdbg function names and move them in with the rest of the general libpdbg code. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* htm: Allow nest htm in htm_toggle_debug_bit()Michael Neuling2018-09-071-1/+7
| | | | | | | | | | | | Currently htm_toggle_debug_bit() assumes the target's parent is a core but this is only the case for core htm. For nest htm, the target's parent is a chip. Also for nest, we don't need to toggle this bit. This detects the nest htm case and just returns. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Always run configure functionsMichael Neuling2018-09-071-35/+4
| | | | | | | | Always run configure functions rather than gating based on current settings. This helps fix nest HTM which was gated by the current hardware setting. Signed-off-by: Michael Neuling <mikey@neuling.org>
* libpdbg: When searching for a parent ensure the correct class is enforcedAlistair Popple2018-08-131-11/+16
| | | | | | | | Functions were added to allow a targets parents to be traversed until a parent of the correct class is found. Switch to using those instead of blindly assuming a particular node is always a child of the desired class. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* htm: Add missing return valueMichael Neuling2018-07-131-1/+1
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Use splice() to copy dumpMichael Neuling2018-07-121-14/+12
| | | | | | Gives 10% speedup for no more complexity. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove dead codeMichael Neuling2018-07-121-18/+0
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Fix compiling on ARMMichael Neuling2018-07-121-3/+5
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Fix dumping trace when wrappedMichael Neuling2018-07-121-41/+94
| | | | | | | | | | | | Currently we only dump from the start of the buffer to the last location written which means we can miss a lot of the trace. This is fine for the record command (which never wraps), but is sub-optimal for start/stop commands. This fixes the dumping so it detects if the buffer has wrapped, and if so, dump the last part of the buffer first, then the rest after. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove size from dumpMichael Neuling2018-07-121-7/+6
| | | | | | This isn't used and just complicates things. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Fix ability to use arbitray buffer sizesMichael Neuling2018-07-121-11/+46
| | | | | | | | Add some buffer size checks, use the P8 bit definitions (we don't support P9 currently and simplify the algorithm to calculate HTM_MEM_SIZE. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Change buffer wrappings semanticsMichael Neuling2018-06-251-11/+22
| | | | | | | | "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/+50
| | | | | | | 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-0/+1
| | | | | Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* htm: Cleanup statusMichael Neuling2018-06-251-13/+24
| | | | | | Make total the actual trace size. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Toggle debug bit so trace actually startsMichael Neuling2018-06-251-0/+28
| | | | | | | | | Without this the trace doesn't actually run. In the past, it was only running once the user did another htm command which toggled this bit during the probe. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Cleanup resetMichael Neuling2018-06-251-15/+10
| | | | | | Simplify the code. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Add deconfigure_*htm() and add it to stop()Michael Neuling2018-06-251-0/+42
| | | | | | Cleanup the core from running in single issue mode when we stop the trace. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Cleanup configure_chtm()Michael Neuling2018-06-251-11/+6
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove reset by adding it to startMichael Neuling2018-06-251-9/+3
| | | | Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Remove base/size from resetMichael Neuling2018-06-251-10/+5
| | | | | | Base/size aren't needed so remove them. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Move start() and stop() lowerMichael Neuling2018-06-251-50/+50
| | | | | | So they can use some helper functions later. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Fix potential issue with HTM_ERR macroMichael Neuling2018-06-251-1/+1
| | | | | | Braces are fun. Signed-off-by: Michael Neuling <mikey@neuling.org>
* htm: Fix dump filenameMichael Neuling2018-06-151-14/+9
| | | | | | | | | | 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-29/+3
| | | | | | | | | | 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-21/+20
| | | | | | | Actually print something in status output. Drop some of the more esoteric details to PR_INFO() Signed-off-by: Michael Neuling <mikey@neuling.org>
* libpdbg: Replace PR_PERL with PR_INFOAmitay Isaacs2018-05-181-13/+9
| | | | | | ... and avoid duplicate definitions Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: staticify unit structsNicholas Piggin2018-05-161-2/+2
| | | | Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg/htm: Enable NCU and set single dispatch/instruction modeCyril Bur2018-04-261-2/+41
| | | | | | | | | | | It isn't clear if chtm needs to be enabled before or after setting single dispatch single instruction mode in the core. It also isn't clear if the NCU enable should be done before of after core enable. This fixes problems related with chtm being stuck in "INIT" state and failing to become "READY". Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg: Move struct dt_node into struct pdbg_targetCyril Bur2018-04-241-6/+6
| | | | | | | | | | | Currently we have this terrible mess of dt_nodes pointing to targets and targets pointing to dt_nodes. This has been the cause of bugs due to folling NULL pointers from a target expecting a node and vice versa. Consolidating these structs means that there must be a node for a target. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg/htm: Add POWER8 HTM (both Core and Nest)Cyril Bur2018-02-161-30/+135
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg/htm: Both `chtm` and `nhtm` classes are validCyril Bur2018-02-161-2/+4
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg/htm: Add nest to Nest HTM specific constantsCyril Bur2018-02-161-32/+32
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg/htm: Convert current HTM function names to Nest HTMCyril Bur2018-02-161-13/+18
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* Rename chiplet to coreAlistair Popple2017-12-111-1/+1
| | | | | | | | A core is a specific subset of chiplets so rename the existing usage of chiplet to core so that we may add other types of chiplets to the system. No functional change. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Rename struct target to struct pdbg_targetAlistair Popple2017-12-061-9/+9
| | | | | | | In preparation for a better defined libpdbg API rename "struct target" to something less generic so that we can export the name. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Hardware Trace Macro (HTM)Cyril Bur2017-09-221-0/+862
This is not Hardware Transactional Memory, rather it is the Hardware Trace Macro (HTM) which can be used to gather data about hardware activity. Currently only Nest HTM is implemented. Only runs on a PPC host on a kernel built with CONFIG_PPC_MEMTRACE and CONFIG_PPC_SCOM. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
OpenPOWER on IntegriCloud