Skip to content

Commit ac56aa4

Browse files
Jin Yaoacmel
authored andcommitted
perf script python: Add dict fields introduction to Documentation
Add a brief introduction about fields to perf-script-python.txt. It should help python script developers in easily finding what fields are supported. Signed-off-by: Jin Yao <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jin Yao <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 48a1f56 commit ac56aa4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tools/perf/Documentation/perf-script-python.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,32 @@ Various utility functions for use with perf script:
610610
nsecs_str(nsecs) - returns printable string in the form secs.nsecs
611611
avg(total, n) - returns average given a sum and a total number of values
612612

613+
SUPPORTED FIELDS
614+
----------------
615+
616+
Currently supported fields:
617+
618+
ev_name, comm, pid, tid, cpu, ip, time, period, phys_addr, addr,
619+
symbol, dso, time_enabled, time_running, values, callchain,
620+
brstack, brstacksym, datasrc, datasrc_decode, iregs, uregs,
621+
weight, transaction, raw_buf, attr.
622+
623+
Some fields have sub items:
624+
625+
brstack:
626+
from, to, from_dsoname, to_dsoname, mispred,
627+
predicted, in_tx, abort, cycles.
628+
629+
brstacksym:
630+
items: from, to, pred, in_tx, abort (converted string)
631+
632+
For example,
633+
We can use this code to print brstack "from", "to", "cycles".
634+
635+
if 'brstack' in dict:
636+
for entry in dict['brstack']:
637+
print "from %s, to %s, cycles %s" % (entry["from"], entry["to"], entry["cycles"])
638+
613639
SEE ALSO
614640
--------
615641
linkperf:perf-script[1]

0 commit comments

Comments
 (0)