diff options
author | Jin Yao <yao.jin@linux.intel.com> | 2018-06-01 05:01:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-06-06 14:40:10 -0400 |
commit | ac56aa4549cdfd9c56387b35e99e3c868cfc7bd0 (patch) | |
tree | 30213aabe32613fbae423bfe759e05d9474c023f /tools | |
parent | 48a1f565261d2ab1e17f9a3ad532cf6d9e07748d (diff) |
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 <yao.jin@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1527843663-32288-4-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/perf-script-python.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt index 51ec2d20068a..0fb9eda3cbca 100644 --- a/tools/perf/Documentation/perf-script-python.txt +++ b/tools/perf/Documentation/perf-script-python.txt | |||
@@ -610,6 +610,32 @@ Various utility functions for use with perf script: | |||
610 | nsecs_str(nsecs) - returns printable string in the form secs.nsecs | 610 | nsecs_str(nsecs) - returns printable string in the form secs.nsecs |
611 | avg(total, n) - returns average given a sum and a total number of values | 611 | avg(total, n) - returns average given a sum and a total number of values |
612 | 612 | ||
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 | |||
613 | SEE ALSO | 639 | SEE ALSO |
614 | -------- | 640 | -------- |
615 | linkperf:perf-script[1] | 641 | linkperf:perf-script[1] |