]> Git Repo - linux.git/commitdiff
perf script: Output branch sample type
authorJames Clark <[email protected]>
Mon, 7 Mar 2022 17:19:17 +0000 (17:19 +0000)
committerArnaldo Carvalho de Melo <[email protected]>
Mon, 7 Mar 2022 17:51:56 +0000 (14:51 -0300)
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 <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Anshuman Khandual <[email protected]>
Cc: German Gomez <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-script.c

index fac2e9470926a2624d0056408a68d4ef70d22ed8..5e4a262a6825568406a3ed4f529cf8a27b99270a 100644 (file)
@@ -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,
This page took 0.062506 seconds and 4 git commands to generate.