perf scripting python: Add cpumode
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 25 May 2021 09:51:09 +0000 (12:51 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 25 May 2021 13:07:17 +0000 (10:07 -0300)
Add cpumode 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-8-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/scripting-engines/trace-event-python.c

index fccd1b4..cb70866 100644 (file)
@@ -822,6 +822,9 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample,
        brstacksym = python_process_brstacksym(sample, al->thread);
        pydict_set_item_string_decref(dict, "brstacksym", brstacksym);
 
+       pydict_set_item_string_decref(dict_sample, "cpumode",
+                       _PyLong_FromLong((unsigned long)sample->cpumode));
+
        if (addr_al) {
                pydict_set_item_string_decref(dict_sample, "addr_correlates_sym",
                        PyBool_FromLong(1));