summaryrefslogtreecommitdiffstats
path: root/src/htm.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2018-06-19 15:25:33 +1000
committerAlistair Popple <alistair@popple.id.au>2018-06-25 15:11:03 +1000
commit6ac2a7b441a0aa5ac4d6123c16a18338631a8a01 (patch)
treedbdffe8fac1872d247644508288bfe957ce709b3 /src/htm.c
parent2b861e33872327a313eda28c9bb3ebb809e36408 (diff)
downloadpdbg-6ac2a7b441a0aa5ac4d6123c16a18338631a8a01.tar.gz
pdbg-6ac2a7b441a0aa5ac4d6123c16a18338631a8a01.zip
htm: Add record command
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>
Diffstat (limited to 'src/htm.c')
-rw-r--r--src/htm.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/htm.c b/src/htm.c
index ae7e1ea..eff46a6 100644
--- a/src/htm.c
+++ b/src/htm.c
@@ -177,6 +177,37 @@ static int run_dump(enum htm_type type)
return rc;
}
+static int run_record(enum htm_type type)
+{
+ struct pdbg_target *target;
+ char *filename;
+ int rc = 0;
+
+ pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) {
+ if (!target_selected(target))
+ continue;
+ pdbg_target_probe(target);
+ if (target_is_disabled(target))
+ continue;
+
+ filename = get_htm_dump_filename(target);
+ if (!filename)
+ return 0;
+
+ /* size = 0 will dump everything */
+ printf("Recording HTM@");
+ print_htm_address(type, target);
+ if (htm_record(target, filename) != 1) {
+ printf("Couldn't record HTM@");
+ print_htm_address(type, target);
+ }
+ rc++;
+ free(filename);
+ }
+
+ return rc;
+}
+
static struct {
const char *name;
const char *args;
@@ -187,6 +218,7 @@ static struct {
{ "stop", "", "Stop %s HTM", &run_stop },
{ "status", "", "Get %s HTM status", &run_status },
{ "dump", "", "Dump %s HTM buffer to file", &run_dump },
+ { "record", "", "Start, wait & dump %s HTM", &run_record },
};
static void print_usage(enum htm_type type)
OpenPOWER on IntegriCloud