diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2021-05-25 12:51:08 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-05-25 10:07:17 -0300 |
commit | 142b05182eaa449bacd419d31d0dbbf24e048dbf (patch) | |
tree | 39037f2eba3700a532ad4c7457dc356342887859 /tools | |
parent | bee272af78525b91c0276f9878d3273dba59948a (diff) |
perf scripting python: Add IPC
Add IPC to python scripting.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210525095112.1399-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-python.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 5d01e4fc50b8..fccd1b415ea0 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -831,6 +831,14 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, if (sample->flags) python_process_sample_flags(sample, dict_sample); + /* Instructions per cycle (IPC) */ + if (sample->insn_cnt && sample->cyc_cnt) { + pydict_set_item_string_decref(dict_sample, "insn_cnt", + PyLong_FromUnsignedLongLong(sample->insn_cnt)); + pydict_set_item_string_decref(dict_sample, "cyc_cnt", + PyLong_FromUnsignedLongLong(sample->cyc_cnt)); + } + set_regs_in_dict(dict, sample, evsel); return dict; |