lkml.org 
[lkml]   [2021]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/10] perf scripting python: Add IPC
    Date
    Add IPC to python scripting.

    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    ---
    tools/perf/util/scripting-engines/trace-event-python.c | 8 ++++++++
    1 file changed, 8 insertions(+)

    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;
    --
    2.17.1
    \
     
     \ /
      Last update: 2021-05-25 11:51    [W:4.173 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site