Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
142b0518 bee272af

+8
+8
tools/perf/util/scripting-engines/trace-event-python.c
··· 831 831 if (sample->flags) 832 832 python_process_sample_flags(sample, dict_sample); 833 833 834 + /* Instructions per cycle (IPC) */ 835 + if (sample->insn_cnt && sample->cyc_cnt) { 836 + pydict_set_item_string_decref(dict_sample, "insn_cnt", 837 + PyLong_FromUnsignedLongLong(sample->insn_cnt)); 838 + pydict_set_item_string_decref(dict_sample, "cyc_cnt", 839 + PyLong_FromUnsignedLongLong(sample->cyc_cnt)); 840 + } 841 + 834 842 set_regs_in_dict(dict, sample, evsel); 835 843 836 844 return dict;