1. 09 6月, 2018 2 次提交
    • S
      perf script: Show hw-cache events · fad76d43
      Seeteena Thoufeek 提交于
      'perf script' fails to report hardware cache events (PERF_TYPE_HW_CACHE)
      where as 'perf report' shows the samples. Fix it. Ex,
      
        # perf record -e L1-dcache-loads ./a.out
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.008 MB perf.data (11 samples)]
      
      Before patch:
      
        # perf script | wc -l
        0
      
      After patch:
      
        # perf script | wc -l
        11
      
      Committer testing:
      
        [root@jouet ~]# perf script | head -30 | tail
              Timer 9803 [2] 8.963330:  1554 L1-dcache-loads: 7ffef89baae4 __vdso_clock_gettime+0xf4 ([vdso])
            swapper    0 [2] 8.963343:  5626 L1-dcache-loads: ffffffffa66f4f6b cpuidle_not_av+0xb (/lib/modules/4.17.0-rc5/build/vmlinux)
            firefox 4853 [2] 8.964070: 18935 L1-dcache-loads: 7f0b9a00dc30 xcb_poll_for_event+0x0 (/usr/lib64/libxcb.so.1.1.0)
        Softwar~cTh 4928 [2] 8.964548: 15928 L1-dcache-loads: ffffffffa60d795c update_curr+0x10c (/lib/modules/4.17.0-rc5/build/vmlinux)
            firefox 4853 [2] 8.964675: 14978 L1-dcache-loads: ffffffffa6897018 mutex_unlock+0x18 (/lib/modules/4.17.0-rc5/build/vmlinux)
        gnome-shell 2026 [3] 8.964693: 50670 L1-dcache-loads: 7fa08854de6d g_source_iter_next+0x6d (/usr/lib64/libglib-2.0.so.0.5400.3)
         Compositor 4929 [1] 8.964784: 71772 L1-dcache-loads: 7f0b936bf078 [unknown] (/usr/lib64/firefox/libxul.so)
           Xwayland 2096 [2] 8.964919: 16799 L1-dcache-loads: 7f68ce2fcb8a glXGetCurrentContext+0x1a (/usr/lib64/libGLX.so.0.0.0)
        gnome-shell 2026 [3] 8.964997: 50670 L1-dcache-loads: 7fa08854de6d g_source_iter_next+0x6d (/usr/lib64/libglib-2.0.so.0.5400.3)
        [root@jouet ~]#
      Signed-off-by: NSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1528455748-20087-1-git-send-email-s1seetee@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fad76d43
    • J
      perf c2c: Keep struct hist_entry at the end of struct c2c_hist_entry · 4c820527
      Jiri Olsa 提交于
      Exactly as the comment just before 'struct c2c_hist_entry" says, i.e.
      the last entry in struct hist_entry is a zero length array, that when
      allocating space for hist_entry gets extra space if callchains are in
      use, which, if hist_entry is not at the end of c2c_hist_entry, the
      members after it gets corrupted when callchains get added to the rb
      trees collecting them, etc.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Reported-by: NArnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Fixes: 7f834c2e ("perf c2c report: Display node for cacheline address")
      Link: http://lkml.kernel.org/n/tip-bh0ke4fh2ygpj3yowna7o1di@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4c820527
  2. 08 6月, 2018 12 次提交
  3. 07 6月, 2018 2 次提交
    • J
      perf script python: Add dict fields introduction to Documentation · ac56aa45
      Jin Yao 提交于
      Add a brief introduction about fields to perf-script-python.txt.
      
      It should help python script developers in easily finding what fields
      are supported.
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1527843663-32288-4-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ac56aa45
    • J
      perf script python: Add more PMU fields to event handler dict · 48a1f565
      Jin Yao 提交于
      When doing pmu sampling and then running a script with perf script -s
      script.py, the process_event function gets dictionary with some fields
      from the perf ring buffer (like ip, sym, callchain etc).
      
      But we miss quite a few fields we report now, for example, LBRs, data
      source, weight, transaction, iregs, uregs, etc.
      
      This patch reports these fields for perf script python processing.
      
        New keys/items:
        ---------------
        key  : brstack
        items: from, to, from_dsoname, to_dsoname, mispred,
               predicted, in_tx, abort, cycles.
      
        key  : brstacksym
        items: from, to, pred, in_tx, abort (converted string)
      
        key  : datasrc
        key  : datasrc_decode (decoded string)
        key  : iregs
        key  : uregs
        key  : weight
        key  : transaction
      
        v2:
        ---
        Add new fields for dso.
        Use PyBool_FromLong() for mispred/predicted/in_tx/abort
      
      Committer notes:
      
      !sym->name isn't valid, as its not a pointer, its a [0] array, use
      !sym->name[0] instead, guaranteed to be the case by symbol__new.
      
      This was caught by just one of the containers:
      
        52    54.22 ubuntu:17.04                  : FAIL gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
      
          CC       /tmp/build/perf/util/scripting-engines/trace-event-python.o
        util/scripting-engines/trace-event-python.c:534:20: error: address of array 'sym->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                if (!sym || !sym->name)
                          ~~~~~~^~~~
        1 error generated.
        mv: cannot stat '/tmp/build/perf/util/scripting-engines/.trace-event-python.o.tmp': No such file or directory
        /git/linux/tools/build/Makefile.build:96: recipe for target '/tmp/build/perf/util/scripting-engines/trace-event-python.o' failed
        make[5]: *** [/tmp/build/perf/util/scripting-engines/trace-event-python.o] Error 1
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1527843663-32288-3-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48a1f565
  4. 06 6月, 2018 24 次提交