Skip to content

Commit

Permalink
perf script python: Add dict fields introduction to Documentation
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Jin Yao authored and acmel committed Jun 6, 2018
1 parent 48a1f56 commit ac56aa4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/perf/Documentation/perf-script-python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,32 @@ Various utility functions for use with perf script:
nsecs_str(nsecs) - returns printable string in the form secs.nsecs
avg(total, n) - returns average given a sum and a total number of values

SUPPORTED FIELDS
----------------

Currently supported fields:

ev_name, comm, pid, tid, cpu, ip, time, period, phys_addr, addr,
symbol, dso, time_enabled, time_running, values, callchain,
brstack, brstacksym, datasrc, datasrc_decode, iregs, uregs,
weight, transaction, raw_buf, attr.

Some fields have sub items:

brstack:
from, to, from_dsoname, to_dsoname, mispred,
predicted, in_tx, abort, cycles.

brstacksym:
items: from, to, pred, in_tx, abort (converted string)

For example,
We can use this code to print brstack "from", "to", "cycles".

if 'brstack' in dict:
for entry in dict['brstack']:
print "from %s, to %s, cycles %s" % (entry["from"], entry["to"], entry["cycles"])

SEE ALSO
--------
linkperf:perf-script[1]

0 comments on commit ac56aa4

Please sign in to comment.