1. 20 9月, 2018 4 次提交
  2. 14 8月, 2018 1 次提交
  3. 11 8月, 2018 1 次提交
  4. 11 7月, 2018 2 次提交
    • J
      perf script python: Fix dict reference counting · db0ba84c
      Janne Huttunen 提交于
      The dictionaries are attached to the parameter tuple that steals the
      references and takes care of releasing them when appropriate.  The code
      should not decrement the reference counts explicitly.  E.g. if libpython
      has been built with reference debugging enabled, the superfluous DECREFs
      will trigger this error when running perf script:
      
        Fatal Python error: Objects/tupleobject.c:238 object at
        0x7f10f2041b40 has negative ref count -1
        Aborted (core dumped)
      
      If the reference debugging is not enabled, the superfluous DECREFs might
      cause the dict objects to be silently released while they are still in
      use. This may trigger various other assertions or just cause perf
      crashes and/or weird and unexpected data changes in the stored Python
      objects.
      Signed-off-by: NJanne Huttunen <janne.huttunen@nokia.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jaroslav Skarvada <jskarvad@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1531133990-17485-1-git-send-email-janne.huttunen@nokia.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      db0ba84c
    • J
      perf tools: Generate a Python script compatible with Python 2 and 3 · 877cc639
      Jeremy Cline 提交于
      When generating a Python script with "perf script -g python", produce
      one that is compatible with Python 2 and 3. The difference between the
      two generated scripts is:
      
        --- python2-perf-script.py	2018-05-08 15:35:00.865889705 -0400
        +++ python3-perf-script.py	2018-05-08 15:34:49.019789564 -0400
        @@ -7,6 +7,8 @@
         # be retrieved using Python functions of the form common_*(context).
         # See the perf-script-python Documentation for the list of available functions.
      
        +from __future__ import print_function
        +
         import os
         import sys
      
        @@ -18,10 +20,10 @@
      
         def trace_begin():
        -	print "in trace_begin"
        +	print("in trace_begin")
      
         def trace_end():
        -	print "in trace_end"
        +	print("in trace_end")
      
         def raw_syscalls__sys_enter(event_name, context, common_cpu,
         	common_secs, common_nsecs, common_pid, common_comm,
        @@ -29,26 +31,26 @@
         		print_header(event_name, common_cpu, common_secs, common_nsecs,
         			common_pid, common_comm)
      
        -		print "id=%d, args=%s" % \
        -		(id, args)
        +		print("id=%d, args=%s" % \
        +		(id, args))
      
        -		print 'Sample: {'+get_dict_as_string(perf_sample_dict['sample'], ', ')+'}'
        +		print('Sample: {'+get_dict_as_string(perf_sample_dict['sample'], ', ')+'}')
      
         		for node in common_callchain:
         			if 'sym' in node:
        -				print "\t[%x] %s" % (node['ip'], node['sym']['name'])
        +				print("\t[%x] %s" % (node['ip'], node['sym']['name']))
         			else:
        -				print "	[%x]" % (node['ip'])
        +				print("	[%x]" % (node['ip']))
      
        -		print "\n"
        +		print()
      
         def trace_unhandled(event_name, context, event_fields_dict, perf_sample_dict):
        -		print get_dict_as_string(event_fields_dict)
        -		print 'Sample: {'+get_dict_as_string(perf_sample_dict['sample'], ', ')+'}'
        +		print(get_dict_as_string(event_fields_dict))
        +		print('Sample: {'+get_dict_as_string(perf_sample_dict['sample'], ', ')+'}')
      
         def print_header(event_name, cpu, secs, nsecs, pid, comm):
        -	print "%-20s %5u %05u.%09u %8u %-20s " % \
        -	(event_name, cpu, secs, nsecs, pid, comm),
        +	print("%-20s %5u %05u.%09u %8u %-20s " % \
        +	(event_name, cpu, secs, nsecs, pid, comm), end="")
      
         def get_dict_as_string(a_dict, delimiter=' '):
         	return delimiter.join(['%s=%s'%(k,str(v))for k,v in sorted(a_dict.items())])
      Signed-off-by: NJeremy Cline <jeremy@jcline.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Herton Krzesinski <herton@redhat.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/0100016341a7278a-d178c724-2b0f-49ca-be93-80a7d51aaa0d-000000@email.amazonses.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      877cc639
  5. 07 6月, 2018 1 次提交
    • 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
  6. 06 6月, 2018 1 次提交
  7. 31 5月, 2018 1 次提交
    • L
      perf script python: Add addr into perf sample dict · 943f32a0
      Leo Yan 提交于
      ARM CoreSight auxtrace uses 'sample->addr' to record the target address
      for branch instructions, so the data of 'sample->addr' is required for
      tracing data analysis.
      
      This commit collects data of 'sample->addr' into perf sample dict,
      finally can be used for python script for parsing event.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Walker <robert.walker@arm.com>
      Cc: Tor Jeremiassen <tor@ti.com>
      Cc: coresight@lists.linaro.org
      Cc: kim.phillips@arm.co
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-doc@vger.kernel.org
      Link: http://lkml.kernel.org/r/1527497103-3593-3-git-send-email-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      943f32a0
  8. 19 2月, 2018 1 次提交
    • J
      perf tools: Add Python 3 support · 66dfdff0
      Jaroslav Škarvada 提交于
      Added Python 3 support while keeping Python 2.7 compatibility.
      
      Committer notes:
      
      This doesn't make it to auto detect python 3, one has to explicitely ask
      it to build with python 3 devel files, here are the instructions
      provided by Jaroslav:
      
       ---
        $ cp -a tools/perf tools/python3-perf
        $ make V=1 prefix=/usr -C tools/perf PYTHON=/usr/bin/python2 all
        $ make V=1 prefix=/usr -C tools/python3-perf PYTHON=/usr/bin/python3 all
        $ make V=1 prefix=/usr -C tools/python3-perf PYTHON=/usr/bin/python3 DESTDIR=%{buildroot} install-python_ext
        $ make V=1 prefix=/usr -C tools/perf PYTHON=/usr/bin/python2 DESTDIR=%{buildroot} install-python_ext
       ---
      
      We need to make this automatic, just like the existing tests for checking if
      the python2 devel files are in place, allowing the build with python3 if
      available, fallbacking to python2 and then just disabling it if none are
      available.
      
      So, using the PYTHON variable to build it using O= we get:
      
      Before this patch:
      
        $ rpm -q python3 python3-devel
        python3-3.6.4-7.fc27.x86_64
        python3-devel-3.6.4-7.fc27.x86_64
        $ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make O=/tmp/build/perf PYTHON=/usr/bin/python3 -C tools/perf install-bin
        make: Entering directory '/home/acme/git/linux/tools/perf'
        <SNIP>
        Makefile.config:670: Python 3 is not yet supported; please set
        Makefile.config:671: PYTHON and/or PYTHON_CONFIG appropriately.
        Makefile.config:672: If you also have Python 2 installed, then
        Makefile.config:673: try something like:
        Makefile.config:674:
        Makefile.config:675:   make PYTHON=python2
        Makefile.config:676:
        Makefile.config:677: Otherwise, disable Python support entirely:
        Makefile.config:678:
        Makefile.config:679:   make NO_LIBPYTHON=1
        Makefile.config:680:
        Makefile.config:681: *** .  Stop.
        make[1]: *** [Makefile.perf:212: sub-make] Error 2
        make: *** [Makefile:110: install-bin] Error 2
        make: Leaving directory '/home/acme/git/linux/tools/perf'
        $
      
      After:
      
        $ make O=/tmp/build/perf PYTHON=python3 -C tools/perf install-bin
        $ ldd ~/bin/perf | grep python
      	libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x00007f58a31e8000)
        $ rpm -qf /lib64/libpython3.6m.so.1.0
        python3-libs-3.6.4-7.fc27.x86_64
        $
      
      Now verify that when using the binding the right ELF file is loaded,
      using perf trace:
      
        $ perf trace -e open* perf test python
           0.051 ( 0.016 ms): perf/3927 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC           ) = 3
      <SNIP>
        18: 'import perf' in python                               :
           8.849 ( 0.013 ms): sh/3929 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC           ) = 3
      <SNIP>
          25.572 ( 0.008 ms): python3/3931 openat(dfd: CWD, filename: /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so, flags: CLOEXEC) = 3
      <SNIP>
       Ok
      <SNIP>
        $
      
      And using tools/perf/python/twatch.py, to show PERF_RECORD_ metaevents:
      
        $ python3 tools/perf/python/twatch.py
        cpu: 3, pid: 16060, tid: 16060 { type: fork, pid: 5207, ppid: 16060, tid: 5207, ptid: 16060, time: 10798513015459}
        cpu: 3, pid: 16060, tid: 16060 { type: fork, pid: 5208, ppid: 16060, tid: 5208, ptid: 16060, time: 10798513562503}
        cpu: 0, pid: 5208, tid: 5208 { type: comm, pid: 5208, tid: 5208, comm: grep }
        cpu: 2, pid: 5207, tid: 5207 { type: comm, pid: 5207, tid: 5207, comm: ps }
        cpu: 2, pid: 5207, tid: 5207 { type: exit, pid: 5207, ppid: 5207, tid: 5207, ptid: 5207, time: 10798551337484}
        cpu: 3, pid: 5208, tid: 5208 { type: exit, pid: 5208, ppid: 5208, tid: 5208, ptid: 5208, time: 10798551292153}
        cpu: 3, pid: 601, tid: 601 { type: fork, pid: 5209, ppid: 601, tid: 5209, ptid: 601, time: 10801779977324}
        ^CTraceback (most recent call last):
          File "tools/perf/python/twatch.py", line 68, in <module>
            main()
          File "tools/perf/python/twatch.py", line 40, in main
            evlist.poll(timeout = -1)
        KeyboardInterrupt
        $
      
        # ps ax|grep twatch
       5197 pts/8    S+     0:00 python3 tools/perf/python/twatch.py
        # ls -la /proc/5197/smaps
        -r--r--r--. 1 acme acme 0 Feb 19 13:14 /proc/5197/smaps
        # grep python /proc/5197/smaps
        558111307000-558111309000 r-xp 00000000 fd:00 3151710  /usr/bin/python3.6
        558111508000-558111509000 r--p 00001000 fd:00 3151710  /usr/bin/python3.6
        558111509000-55811150a000 rw-p 00002000 fd:00 3151710  /usr/bin/python3.6
        7ffad6fc1000-7ffad7008000 r-xp 00000000 00:2d 220196   /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so
        7ffad7008000-7ffad7207000 ---p 00047000 00:2d 220196   /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so
        7ffad7207000-7ffad7208000 r--p 00046000 00:2d 220196   /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so
        7ffad7208000-7ffad7215000 rw-p 00047000 00:2d 220196   /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so
        7ffadea77000-7ffaded3d000 r-xp 00000000 fd:00 3151795  /usr/lib64/libpython3.6m.so.1.0
        7ffaded3d000-7ffadef3c000 ---p 002c6000 fd:00 3151795  /usr/lib64/libpython3.6m.so.1.0
        7ffadef3c000-7ffadef42000 r--p 002c5000 fd:00 3151795  /usr/lib64/libpython3.6m.so.1.0
        7ffadef42000-7ffadefa5000 rw-p 002cb000 fd:00 3151795  /usr/lib64/libpython3.6m.so.1.0
        #
      
      And with this patch, but building normally, without specifying the
      PYTHON=python3 part, which will make it use python2 if its devel files are
      available, like in this test:
      
        $ make O=/tmp/build/perf -C tools/perf install-bin
        $ ldd ~/bin/perf | grep python
      	libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007f6a44410000)
        $ ldd /tmp/build/perf/python_ext_build/lib/perf.so  | grep python
      	libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007fed28a2c000)
        $
      
        [acme@jouet perf]$ tools/perf/python/twatch.py
        cpu: 0, pid: 2817, tid: 2817 { type: fork, pid: 2817, ppid: 2817, tid: 8910, ptid: 2817, time: 11126454335306}
        cpu: 0, pid: 2817, tid: 2817 { type: comm, pid: 2817, tid: 8910, comm: worker }
        $ ps ax | grep twatch.py
         8909 pts/8    S+     0:00 /usr/bin/python tools/perf/python/twatch.py
        $ grep python /proc/8909/smaps
        5579de658000-5579de659000 r-xp 00000000 fd:00 3156044  /usr/bin/python2.7
        5579de858000-5579de859000 r--p 00000000 fd:00 3156044  /usr/bin/python2.7
        5579de859000-5579de85a000 rw-p 00001000 fd:00 3156044  /usr/bin/python2.7
        7f0de01f7000-7f0de023e000 r-xp 00000000 00:2d 230695   /tmp/build/perf/python/perf.so
        7f0de023e000-7f0de043d000 ---p 00047000 00:2d 230695   /tmp/build/perf/python/perf.so
        7f0de043d000-7f0de043e000 r--p 00046000 00:2d 230695   /tmp/build/perf/python/perf.so
        7f0de043e000-7f0de044b000 rw-p 00047000 00:2d 230695   /tmp/build/perf/python/perf.so
        7f0de6f0f000-7f0de6f13000 r-xp 00000000 fd:00 134975   /usr/lib64/python2.7/lib-dynload/_localemodule.so
        7f0de6f13000-7f0de7113000 ---p 00004000 fd:00 134975   /usr/lib64/python2.7/lib-dynload/_localemodule.so
        7f0de7113000-7f0de7114000 r--p 00004000 fd:00 134975   /usr/lib64/python2.7/lib-dynload/_localemodule.so
        7f0de7114000-7f0de7115000 rw-p 00005000 fd:00 134975   /usr/lib64/python2.7/lib-dynload/_localemodule.so
        7f0de7e73000-7f0de8052000 r-xp 00000000 fd:00 3173292  /usr/lib64/libpython2.7.so.1.0
        7f0de8052000-7f0de8251000 ---p 001df000 fd:00 3173292  /usr/lib64/libpython2.7.so.1.0
        7f0de8251000-7f0de8255000 r--p 001de000 fd:00 3173292  /usr/lib64/libpython2.7.so.1.0
        7f0de8255000-7f0de8291000 rw-p 001e2000 fd:00 3173292  /usr/lib64/libpython2.7.so.1.0
        $
      Signed-off-by: NJaroslav Škarvada <jskarvad@redhat.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      LPU-Reference: 20180119205641.24242-1-jskarvad@redhat.com
      Link: https://lkml.kernel.org/n/tip-8d7dt9kqp83vsz25hagug8fu@git.kernel.org
      [ Removed explicit check for python version, allowing it to really build with python3 ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      66dfdff0
  9. 12 1月, 2018 1 次提交
    • K
      perf script python: Add script to profile and resolve physical mem type · 41013f0c
      Kan Liang 提交于
      There could be different types of memory in the system. E.g normal
      System Memory, Persistent Memory. To understand how the workload maps to
      those memories, it's important to know the I/O statistics of them.  Perf
      can collect physical addresses, but those are raw data.  It still needs
      extra work to resolve the physical addresses.  Provide a script to
      facilitate the physical addresses resolving and I/O statistics.
      
      Profile with MEM_INST_RETIRED.ALL_LOADS or MEM_UOPS_RETIRED.ALL_LOADS
      event if any of them is available.
      
      Look up the /proc/iomem and resolve the physical address.  Provide
      memory type summary.
      
      Here is an example output:
      
        # perf script report mem-phys-addr
        Event: mem_inst_retired.all_loads:P
        Memory type                                    count   percentage
        ----------------------------------------  -----------  -----------
        System RAM                                        74        53.2%
        Persistent Memory                                 55        39.6%
        N/A
      
        ---
      
      Changes since V2:
       - Apply the new license rules.
       - Add comments for globals
      
      Changes since V1:
       - Do not mix DLA and Load Latency. Do not compare the loads and stores.
         Only profile the loads.
       - Use event name to replace the RAW event
      Signed-off-by: NKan Liang <Kan.liang@intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lkml.kernel.org/r/1515099595-34770-1-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41013f0c
  10. 27 12月, 2017 1 次提交
  11. 26 7月, 2017 5 次提交
  12. 20 6月, 2017 1 次提交
  13. 08 6月, 2017 1 次提交
  14. 20 4月, 2017 2 次提交
  15. 17 2月, 2017 1 次提交
    • A
      tools perf scripting python: clang doesn't have -spec, remove it · 8bd8c653
      Arnaldo Carvalho de Melo 提交于
      Gcc has a -spec option to override what options to pass to cc, etc, and
      in some distros this is used, like in fedora, where we end up getting
      this passed to gcc that makes clang, that doesn't have this option to
      stop the build:
      
        CC       /tmp/build/perf/util/scripting-engines/trace-event-python.o
      clang-4.0: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Werror,-Wunused-command-line-argument]
      
      So filter this out when the compiler used is clang, this way we
      can build the python scripting support in tools/perf/.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-2gosxoiouf24pnlknp7w7q4z@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8bd8c653
  16. 26 1月, 2017 1 次提交
  17. 24 8月, 2016 1 次提交
  18. 19 7月, 2016 2 次提交
  19. 13 7月, 2016 1 次提交
    • A
      perf script python: Silence -Werror=maybe-uninitialized on gcc 5.3.0 · 39f54862
      Arnaldo Carvalho de Melo 提交于
      Sounds like a compiler bug, but to silence it, initialize those
      variables to NULL.
      
      Noticed on:
      
      Target: x86_64-alpine-linux-musl
      Configured with: /home/buildozer/aports/main/gcc/src/gcc-5.3.0/configure
      --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
      --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl
      --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 5.3.0'
      --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
      --disable-multilib --disable-nls --disable-werror --disable-symvers
      --enable-__cxa_atexit --enable-esp --enable-cloog-backend
      --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp
      --disable-libmudflap --disable-libsanitizer --enable-shared
      --enable-threads --enable-tls --with-system-zlib
      Thread model: posix
      gcc version 5.3.0 (Alpine 5.3.0)
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-zyvsjvbl45o7hzcuz78wu2xi@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      39f54862
  20. 12 5月, 2016 1 次提交
  21. 11 5月, 2016 1 次提交
  22. 10 5月, 2016 1 次提交
  23. 07 5月, 2016 2 次提交
    • C
      perf script: Expose usage of the callchain db export via the python api · 2c15f5eb
      Chris Phlipot 提交于
      This change allows python scripts to be able to utilize the recent
      changes to the db export api allowing the export of call_paths derived
      from sampled callchains. These call paths are also now associated with
      the samples from which they were derived.
      
      - This feature is enabled by setting "perf_db_export_callchains" to true
      
      - When enabled, samples that have callchain information will have the
        callchains exported via call_path_table
      
      - The call_path_id field is added to sample_table to enable association of
        samples with the corresponding callchain stored in the call paths
        table. A call_path_id of 0 will be exported if there is no
        corresponding callchain.
      
      - When "perf_db_export_callchains" and "perf_db_export_calls" are both
        set to True, the call path root data structure will be shared. This
        prevents duplicating of data and call path ids that would result from
        building two separate call path trees in memory.
      
      - The call_return_processor structure definition was relocated to the header
        file to make its contents visible to db-export.c. This enables the
        sharing of call path trees between the two features, as mentioned
        above.
      
      This change is visible to python scripts using the python db export api.
      
      The change is backwards compatible with scripts written against the
      previous API, assuming that the scripts model the sample_table function
      after the one in export-to-postgresql.py script by allowing for
      additional arguments to be added in the future. ie. using *x as the
      final argument of the sample_table function.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-6-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c15f5eb
    • C
      perf tools: Refactor code to move call path handling out of thread-stack · 451db126
      Chris Phlipot 提交于
      Move the call path handling code out of thread-stack.c and
      thread-stack.h to allow other components that are not part of
      thread-stack to create call paths.
      
      Summary:
      
      - Create call-path.c and call-path.h and add them to the build.
      
      - Move all call path related code out of thread-stack.c and thread-stack.h
        and into call-path.c and call-path.h.
      
      - A small subset of structures and functions are now visible through
        call-path.h, which is required for thread-stack.c to continue to
        compile.
      
      This change is a prerequisite for subsequent patches in this change set
      and by itself contains no user-visible changes.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-3-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      451db126
  24. 15 4月, 2016 1 次提交
    • A
      perf callchain: Start moving away from global per thread cursors · 91d7b2de
      Arnaldo Carvalho de Melo 提交于
      The recent perf_evsel__fprintf_callchain() move to evsel.c added several
      new symbol requirements to the python binding, for instance:
      
        # perf test -v python
        16: Try 'import perf' in python, checking link problems      :
        --- start ---
        test child forked, pid 18030
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ImportError: /tmp/build/perf/python/perf.so: undefined symbol:
        callchain_cursor
        test child finished with -1
        ---- end ----
        Try 'import perf' in python, checking link problems: FAILED!
        #
      
      This would require linking against callchain.c to access to the global
      callchain_cursor variables.
      
      Since lots of functions already receive as a parameter a
      callchain_cursor struct pointer, make that be the case for some more
      function so that we can start phasing out usage of yet another global
      variable.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-djko3097eyg2rn66v2qcqfvn@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      91d7b2de
  25. 03 3月, 2016 1 次提交
  26. 25 2月, 2016 1 次提交
    • T
      perf script: Exception handling when the print fmt is empty · 8579aca3
      Taeung Song 提交于
      After collecting samples for events 'syscalls:', perf-script with python
      script doesn't occasionally work generating a segmentation fault.
      
      The reason is that the print fmt is empty and a value of
      event->print_fmt.args is NULL, so dereferencing the null pointer results
      in a segmentation fault i.e.:
      
          # perf record -e syscalls:*
          # perf script -g python
          # perf script -s perf-script.py
      
          in trace_begin
          syscalls__sys_enter_brk  3 79841.832099154  3777 test.sh  syscall_nr=12, brk=0
      
          ... (omitted) ...
      
          Segmentation fault (core dumped)
      
      For example, a format of sys_enter_getuid() hasn't
      print fmt as below.
      
          # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_getuid/format
          name: sys_enter_getuid
          ID: 188
          format:
                  field:unsigned short common_type;         offset:0; size:2; signed:0;
                  field:unsigned char common_flags;         offset:2; size:1; signed:0;
                  field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
                  field:int common_pid;                     offset:4; size:4; signed:1;
                  field:int syscall_nr;                     offset:8; size:4; signed:1;
      
          print fmt: ""
      
      So add exception handling to avoid this problem.
      Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1456413179-12331-1-git-send-email-treeze.taeung@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8579aca3
  27. 07 1月, 2016 1 次提交
    • J
      perf script: Add python support for stat events · aef90263
      Jiri Olsa 提交于
      Add support to get stat events data in perf python scripts.
      
      The python script shall implement the following new interface to process
      stat data:
      
        def stat__<event_name>_[<modifier>](cpu, thread, time, val, ena, run):
      
          - is called for every stat event for given counter,
            if user monitors 'cycles,instructions:u" following
            callbacks should be defined:
      
            def stat__cycles(cpu, thread, time, val, ena, run):
            def stat__instructions_u(cpu, thread, time, val, ena, run):
      
        def stat__interval(time):
      
          - is called for every interval with its time,
            in non interval mode it's called after last
            stat event with total measured time in ns
      
      The rest of the current interface stays untouched..
      
      Please check example CPI metrics script in following patch
      with command line examples in changelogs.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NKan Liang <kan.liang@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1452028152-26762-8-git-send-email-jolsa@kernel.org
      [ Rename 'time' parameters to 'tstamp', to fix the build in older distros ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      aef90263
  28. 29 9月, 2015 1 次提交
  29. 03 9月, 2015 1 次提交