summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorJames Clark <james.clark@arm.com>2022-03-07 17:19:17 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-03-07 14:51:56 -0300
commit1f48989cdc7d57d32a56b7cc5eb968c04d30529c (patch)
treef436ebe6400e993342263b99bd985b0853d71733 /tools/perf/builtin-script.c
parentb2dac688a5265379e0f13856b78cb627af07cf42 (diff)
downloadlinux-1f48989cdc7d57d32a56b7cc5eb968c04d30529c.tar.gz
linux-1f48989cdc7d57d32a56b7cc5eb968c04d30529c.tar.bz2
linux-1f48989cdc7d57d32a56b7cc5eb968c04d30529c.zip
perf script: Output branch sample type
The type info is saved when using '-j save_type'. Output this in 'perf script' so it can be accessed by other tools or for debugging. It's appended to the end of the list of fields so any existing tools that split on / and access fields via an index are not affected. Also output '-' instead of 'N/A' when the branch type isn't saved because / is used as a field separator. Entries before this change look like this: 0xaaaadb350838/0xaaaadb3507a4/P/-/-/0 And afterwards like this: 0xaaaadb350838/0xaaaadb3507a4/P/-/-/0/CALL or this if no type info is saved: 0x7fb57586df6b/0x7fb5758731f0/P/-/-/143/- Signed-off-by: James Clark <james.clark@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: German Gomez <german.gomez@arm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20220307171917.2555829-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index fac2e9470926..5e4a262a6825 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -859,11 +859,12 @@ mispred_str(struct branch_entry *br)
static int print_bstack_flags(FILE *fp, struct branch_entry *br)
{
- return fprintf(fp, "/%c/%c/%c/%d ",
+ return fprintf(fp, "/%c/%c/%c/%d/%s ",
mispred_str(br),
br->flags.in_tx ? 'X' : '-',
br->flags.abort ? 'A' : '-',
- br->flags.cycles);
+ br->flags.cycles,
+ br->flags.type ? branch_type_name(br->flags.type) : "-");
}
static int perf_sample__fprintf_brstack(struct perf_sample *sample,