An error occurred fetching the project authors.
  1. 01 Jun, 2021 1 commit
  2. 25 May, 2021 2 commits
    • Adrian Hunter's avatar
      perf scripting python: Add 'addr_location' for 'addr' · 3f8e009e
      Adrian Hunter authored
      If sample addr correlates to a symbol, add  "addr_dso", "addr_symbol", and
      "addr_symoff" to python scripting.
      Signed-off-by: default avatarAdrian 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-4-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3f8e009e
    • Adrian Hunter's avatar
      perf script: Find script file relative to exec path · 6ea4b5db
      Adrian Hunter authored
      Allow perf script to find a script in the exec path.
      
      Example:
      
      Before:
      
       $ perf record -a -e intel_pt/branch=0/ sleep 0.1
       [ perf record: Woken up 1 times to write data ]
       [ perf record: Captured and wrote 0.954 MB perf.data ]
       $ perf script intel-pt-events.py 2>&1 | head -3
         Error: Couldn't find script `intel-pt-events.py'
         See perf script -l for available scripts.
       $ perf script -s intel-pt-events.py 2>&1 | head -3
       Can't open python script "intel-pt-events.py": No such file or directory
       $ perf script ~/libexec/perf-core/scripts/python/intel-pt-events.py 2>&1 | head -3
         Error: Couldn't find script `/home/ahunter/libexec/perf-core/scripts/python/intel-pt-events.py'
         See perf script -l for available scripts.
       $
      
      After:
      
       $ perf script intel-pt-events.py 2>&1 | head -3
       Intel PT Power Events and PTWRITE
                  perf  8123/8123  [000]       551.230753986     cbr:  42  freq: 4219 MHz  (156%)                0 [unknown] ([unknown])
                  perf  8123/8123  [001]       551.230808216     cbr:  42  freq: 4219 MHz  (156%)                0 [unknown] ([unknown])
       $ perf script -s intel-pt-events.py 2>&1 | head -3
       Intel PT Power Events and PTWRITE
                  perf  8123/8123  [000]       551.230753986     cbr:  42  freq: 4219 MHz  (156%)                0 [unknown] ([unknown])
                  perf  8123/8123  [001]       551.230808216     cbr:  42  freq: 4219 MHz  (156%)                0 [unknown] ([unknown])
       $ perf script ~/libexec/perf-core/scripts/python/intel-pt-events.py 2>&1 | head -3
       Intel PT Power Events and PTWRITE
                  perf  8123/8123  [000]       551.230753986     cbr:  42  freq: 4219 MHz  (156%)                0 [unknown] ([unknown])
                  perf  8123/8123  [001]       551.230808216     cbr:  42  freq: 4219 MHz  (156%)                0 [unknown] ([unknown])
       $
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20210524065718.11421-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6ea4b5db
  3. 12 Nov, 2019 1 commit
  4. 05 Nov, 2019 1 commit
  5. 18 Oct, 2019 1 commit
  6. 01 Sep, 2019 1 commit
  7. 29 Aug, 2019 1 commit
  8. 29 Jul, 2019 2 commits
    • Jiri Olsa's avatar
      libperf: Move perf_event_attr field from perf's evsel to libperf's perf_evsel · 1fc632ce
      Jiri Olsa authored
      Move the perf_event_attr struct fron 'struct evsel' to 'struct perf_evsel'.
      
      Committer notes:
      
      Fixed up these:
      
       tools/perf/arch/arm/util/auxtrace.c
       tools/perf/arch/arm/util/cs-etm.c
       tools/perf/arch/arm64/util/arm-spe.c
       tools/perf/arch/s390/util/auxtrace.c
       tools/perf/util/cs-etm.c
      
      Also
      
        cc1: warnings being treated as errors
        tests/sample-parsing.c: In function 'do_test':
        tests/sample-parsing.c:162: error: missing initializer
        tests/sample-parsing.c:162: error: (near initialization for 'evsel.core.cpus')
      
         	struct evsel evsel = {
         		.needs_swap = false,
        -		.core.attr = {
        -			.sample_type = sample_type,
        -			.read_format = read_format,
        +		.core = {
        +			. attr = {
        +				.sample_type = sample_type,
        +				.read_format = read_format,
        +			},
      
        [perfbuilder@a70e4eeb5549 /]$ gcc --version |& head -1
        gcc (GCC) 4.4.7
      
      Also we don't need to include perf_event.h in
      tools/perf/lib/include/perf/evsel.h, forward declaring 'struct
      perf_event_attr' is enough. And this even fixes the build in some
      systems where things are used somewhere down the include path from
      perf_event.h without defining __always_inline.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190721112506.12306-43-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1fc632ce
    • Jiri Olsa's avatar
      perf evsel: Rename struct perf_evsel to struct evsel · 32dcd021
      Jiri Olsa authored
      Rename struct perf_evsel to struct evsel, so we don't have a name clash
      when we add struct perf_evsel in libperf.
      
      Committer notes:
      
      Added fixes for arm64, provided by Jiri.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190721112506.12306-5-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      32dcd021
  9. 01 Apr, 2019 1 commit
  10. 06 Feb, 2019 2 commits
  11. 17 Dec, 2018 1 commit
  12. 19 Sep, 2018 5 commits
  13. 10 Aug, 2018 1 commit
  14. 26 Apr, 2017 1 commit
  15. 19 Apr, 2017 1 commit
  16. 13 Feb, 2017 1 commit
  17. 26 Jan, 2017 1 commit
  18. 25 Jan, 2017 1 commit
  19. 23 Aug, 2016 1 commit
  20. 20 May, 2016 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Fix usage of max_stack sysctl · fe176085
      Arnaldo Carvalho de Melo authored
      We cannot limit processing stacks from the current value of the sysctl,
      as we may be processing perf.data files, possibly from other machines.
      
      Instead use the old PERF_MAX_STACK_DEPTH, the sysctl default, that can
      be overriden using --max-stack or equivalent.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Fixes: 4cb93446 ("perf tools: Set the maximum allowed stack from /proc/sys/kernel/perf_event_max_stack")
      Link: http://lkml.kernel.org/n/tip-eqeutsr7n7wy0c36z24ytvii@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fe176085
  21. 27 Apr, 2016 1 commit
  22. 14 Apr, 2016 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf callchain: Start moving away from global per thread cursors · 91d7b2de
      Arnaldo Carvalho de Melo authored
      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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      91d7b2de
  23. 06 Apr, 2016 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf script perl: Do error checking on new backtrace routine · 76e20522
      Arnaldo Carvalho de Melo authored
      This ended up triggering these warnings when building on Ubuntu 12.04.5:
      
        util/scripting-engines/trace-event-perl.c: In function 'perl_process_callchain':
        util/scripting-engines/trace-event-perl.c:293:4: error: value computed is not used [-Werror=unused-value]
        util/scripting-engines/trace-event-perl.c:294:4: error: value computed is not used [-Werror=unused-value]
        util/scripting-engines/trace-event-perl.c:295:4: error: value computed is not used [-Werror=unused-value]
        util/scripting-engines/trace-event-perl.c:297:4: error: value computed is not used [-Werror=unused-value]
        util/scripting-engines/trace-event-perl.c:309:4: error: value computed is not used [-Werror=unused-value]
        cc1: all warnings being treated as errors
        mv: cannot stat `/tmp/build/perf/util/scripting-engines/.trace-event-perl.o.tmp': No such file or directory
        make[4]: *** [/tmp/build/perf/util/scripting-engines/trace-event-perl.o] Error 1
      
      Fix it by doing error checking when building the perl data structures
      related to callchains.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Dima Kogan <dima@secretsauce.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Fixes: f7380c12 ("perf script perl: Perl scripts now get a backtrace, like the python ones")
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      76e20522
  24. 30 Mar, 2016 1 commit
    • Dima Kogan's avatar
      perf script perl: Perl scripts now get a backtrace, like the python ones · f7380c12
      Dima Kogan authored
      We have some infrastructure to use perl or python to analyze logs
      generated by perf.  Prior to this patch, only the python tools had
      access to backtrace information.  This patch makes this information
      available to perl scripts as well.  Example:
      
        Let's look at malloc() calls made by the seq utility.  First we
        create a probe point:
      
            $ perf probe -x /lib/x86_64-linux-gnu/libc.so.6 malloc
            Added new events:
            ...
      
        Now we run seq, while monitoring malloc() calls with perf
      
            $ perf record --call-graph=dwarf -e probe_libc:malloc seq 5
            1
            2
            3
            4
            5
            [ perf record: Woken up 1 times to write data ]
            [ perf record: Captured and wrote 0.064 MB perf.data (6 samples) ]
      
        We can use perf to look at its log to see the malloc calls and the backtrace
      
            $ perf script
            seq 14195 [000] 1927993.748254: probe_libc:malloc: (7f9ff8edd320) bytes=0x22
                        7f9ff8edd320 malloc (/lib/x86_64-linux-gnu/libc-2.22.so)
                        7f9ff8e8eab0 set_binding_values.part.0 (/lib/x86_64-linux-gnu/libc-2.22.so)
                        7f9ff8e8eda1 __bindtextdomain (/lib/x86_64-linux-gnu/libc-2.22.so)
                              401b22 main (/usr/bin/seq)
                        7f9ff8e82610 __libc_start_main (/lib/x86_64-linux-gnu/libc-2.22.so)
                              402799 _start (/usr/bin/seq)
            ...
      
        We can also use the scripting facilities.  We create a skeleton perl
        script that simply prints out the events
      
            $ perf script -g perl
            generated Perl script: perf-script.pl
      
        We can then use this script to see the malloc() calls with a
        backtrace.  Prior to this patch, the backtrace was not available to
        the perl scripts.
      
            $ perf script -s perf-script.pl
            probe_libc::malloc  0 1927993.748254260  14195 seq   __probe_ip=140325052863264, bytes=34
                    [7f9ff8edd320] malloc
                    [7f9ff8e8eab0] set_binding_values.part.0
                    [7f9ff8e8eda1] __bindtextdomain
                    [401b22] main
                    [7f9ff8e82610] __libc_start_main
                    [402799] _start
            ...
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lkml.kernel.org/r/87mvphzld0.fsf@secretsauce.netSigned-off-by: default avatarDima Kogan <dima@secretsauce.net>
      f7380c12
  25. 25 Feb, 2016 1 commit
    • Taeung Song's avatar
      perf script: Exception handling when the print fmt is empty · 8579aca3
      Taeung Song authored
      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: default avatarTaeung Song <treeze.taeung@gmail.com>
      Tested-by: default avatarArnaldo 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8579aca3
  26. 02 Sep, 2015 1 commit
  27. 13 May, 2015 1 commit
  28. 02 Apr, 2015 1 commit
  29. 24 Mar, 2015 1 commit
  30. 06 Nov, 2014 1 commit
  31. 22 Aug, 2014 1 commit
  32. 17 Jul, 2014 1 commit
  33. 07 Jun, 2014 1 commit