Commit 142b0518 authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

perf scripting python: Add IPC

Add IPC to python scripting.
Signed-off-by: default avatarAdrian 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent bee272af
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment