1. 16 Aug, 2017 2 commits
    • Kim Phillips's avatar
      perf test shell: Replace '|&' with '2>&1 |' to work with more shells · 35435cd0
      Kim Phillips authored
      Since we do not specify bash (and/or zsh) as a requirement, use the
      standard error redirection that is more widely supported.
      Signed-off-by: default avatarKim Phillips <kim.phillips@arm.com>
      Link: http://lkml.kernel.org/n/tip-ji5mhn3iilgch3eaay6csr6z@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      35435cd0
    • Wang Nan's avatar
      perf bpf: Fix endianness problem when loading parameters in prologue · db26984a
      Wang Nan authored
      Perf's BPF prologue generator unconditionally fetches 8 bytes for
      function parameters, which causes problems on big endian machines. Thomas
      gives a detailed analysis for this problem:
      
       http://lkml.kernel.org/r/968ebda5-abe4-8830-8d69-49f62529d151@linux.vnet.ibm.com
      
       ---- 8< ----
        I investigated perf test BPF for s390x and have a question regarding
        the 38.3 subtest (bpf-prologue test) which fails on s390x.
      
        When I turn on trace_printk in tests/bpf-script-test-prologue.c
        I see this output in /sys/kernel/debug/tracing/trace:
      
        [root@s8360047 perf]# cat /sys/kernel/debug/tracing/trace
        perf-30229 [000] d..2 170161.535791: : f_mode 2001d00000000 offset:0 orig:0
        perf-30229 [000] d..2 170161.535809: : f_mode 6001f00000000 offset:0 orig:0
        perf-30229 [000] d..2 170161.535815: : f_mode 6001f00000000 offset:1 orig:0
        perf-30229 [000] d..2 170161.535819: : f_mode 2001d00000000 offset:1 orig:0
        perf-30229 [000] d..2 170161.535822: : f_mode 2001d00000000 offset:2 orig:1
        perf-30229 [000] d..2 170161.535825: : f_mode 6001f00000000 offset:2 orig:1
        perf-30229 [000] d..2 170161.535828: : f_mode 6001f00000000 offset:3 orig:1
        perf-30229 [000] d..2 170161.535832: : f_mode 2001d00000000 offset:3 orig:1
        perf-30229 [000] d..2 170161.535835: : f_mode 2001d00000000 offset:4 orig:0
        perf-30229 [000] d..2 170161.535841: : f_mode 6001f00000000 offset:4 orig:0
      
        [...]
      
        There are 3 parameters the eBPF program tests/bpf-script-test-prologue.c
        accesses: f_mode (member of struct file at offset 140) offset and orig.  They
        are parameters of the lseek() system call triggered in this test case in
        function llseek_loop().
      
        What is really strange is the value of f_mode. It is an 8 byte value, whereas
        in the probe event it is defined as a 4 byte value.  The lower 4 bytes are all
        zero and do not belong to member f_mode.  The correct value should be 2001d for
        read-only and 6001f for read-write open mode.
      
        Here is the output of the 'perf test -vv bpf' trace:
        Try to find probe point from debuginfo.
        Matched function: null_lseek [2d9310d]
         Probe point found: null_lseek+0
        Searching 'file' variable in context.
        Converting variable file into trace event.
        converting f_mode in file
        f_mode type is unsigned int.
        Opening /sys/kernel/debug/tracing//README write=0
        Searching 'offset' variable in context.
        Converting variable offset into trace event.
        offset type is long long int.
        Searching 'orig' variable in context.
        Converting variable orig into trace event.
        orig type is int.
        Found 1 probe_trace_events.
        Opening /sys/kernel/debug/tracing//kprobe_events write=1
        Writing event: p:perf_bpf_probe/func _text+8794224 f_mode=+140(%r2):x32
       ---- 8< ----
      
      This patch parses the type of each argument and converts data from memory to
      expected type.
      
      Now the test runs successfully on 4.13.0-rc5:
      
        [root@s8360046 perf]# ./perf test  bpf
        38: BPF filter                                 :
        38.1: Basic BPF filtering                      : Ok
        38.2: BPF pinning                              : Ok
        38.3: BPF prologue generation                  : Ok
        38.4: BPF relocation checker                   : Ok
        [root@s8360046 perf]#
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20170815092159.31912-1-tmricht@linux.vnet.ibm.comSigned-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      db26984a
  2. 15 Aug, 2017 8 commits
  3. 14 Aug, 2017 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-4.14-20170814' of... · cf31b7dd
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-4.14-20170814' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      Infrastructure changes:
      
      - Do not consider empty files as valid srclines (Milian Wolff)
      
      - Fix wrong size in perf_record_mmap for last kernel module,
        which resulted in erroneous symbol resolution in at least s390x (Thomas Richter)
      
      - Add missing newline to expr parser error messages (Andi Kleen)
      
      - Fix saved values rbtree lookup in 'perf stat' (Andi Kleen)
      
      - Add support for shell based tests in 'perf test', add a few that
        run 'perf probe', 'perf trace', using kprobes, uprobes to check
        the output of those tools and the effects on the system, checking,
        for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo)
      
      Arch specific changes:
      
      - Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao)
      
      - Update POWER9 vendor events tables (Sukadev Bhattiprolu)
      
      - Fix module symbol adjustment for s390x (Thomas Richter)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      cf31b7dd
  4. 11 Aug, 2017 19 commits
    • Arnaldo Carvalho de Melo's avatar
      perf test shell: Add uprobes + backtrace ping test · 8fc375d7
      Arnaldo Carvalho de Melo authored
      Installs a probe on libc's inet_pton function, that will use uprobes,
      then use 'perf trace' on a ping to localhost asking for just one packet
      with the a backtrace 3 levels deep, check that it is what we expect.
      This needs no debuginfo package, all is done using the libc ELF symtab
      and the CFI info in the binaries.
      
      Testing it:
      
        # perf test ping
        61: probe libc's inet_pton & backtrace it with ping       : Ok
      
      In verbose mode:
      
        # perf test -v ping
        61: probe libc's inet_pton & backtrace it with ping       :
        --- start ---
        test child forked, pid 1007
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.058 ms
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.058/0.058/0.058/0.000 ms
        0.000 probe_libc:inet_pton:(7f75fce12a20))
        __GI___inet_pton (/usr/lib64/libc-2.24.so)
        getaddrinfo (/usr/lib64/libc-2.24.so)
        _init (/usr/bin/ping)
        test child finished with 0
        ---- end ----
        probe libc's inet_pton & backtrace it with ping: Ok
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-idrntt4nbg15aafu8hjmv7sk@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8fc375d7
    • Thomas Richter's avatar
      perf report: Fix module symbol adjustment for s390x · 4a084ecf
      Thomas Richter authored
      The 'perf report' tool does not display the addresses of kernel module
      symbols correctly.
      
      For example symbol qeth_send_ipa_cmd in kernel module qeth.ko has this
      relative address for function qeth_send_ipa_cmd():
      
        [root@s8360047 linux]# nm -g drivers/s390/net/qeth.ko | fgrep send_ipa_cmd
        0000000000013088 T qeth_send_ipa_cmd
      
      The module is loaded at address:
      
        [root@s8360047 linux]# cat /sys/module/qeth/sections/.text
        0x000003ff80296d20
        [root@s8360047 linux]#
      
      This should result in a start address of:
      
        0x13088 + 0x3ff80296d20 = 0x3ff802a9da8
      
      Using crash to verify the address on a live system:
      
        [root@s8360046 linux]# crash vmlinux
      
        crash 7.1.9++
        Copyright (C) 2002-2016  Red Hat, Inc.
        Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
      
        [...]
      
        crash> mod -s qeth drivers/s390/net/qeth.ko
             MODULE       NAME        SIZE  OBJECT FILE
             3ff8028d700  qeth      151552  drivers/s390/net/qeth.ko
        crash> sym qeth_send_ipa_cmd
        3ff802a9da8 (T) qeth_send_ipa_cmd [qeth] /root/linux/drivers/s390/net/qeth_core_main.c: 2944
        crash>
      
      Now perf report displays the address of symbol qeth_send_ipa_cmd:
      symbol__new:
      
        qeth_send_ipa_cmd 0x130f0-0x132ce
      
      There is a difference of 0x68 between the entry in the symbol table (see
      nm command above) and perf. The difference is from the offset the .text
      segment of qeth.ko:
      
        [root@s8360047 perf]# readelf -a drivers/s390/net/qeth.ko
        Section Headers:
        [Nr] Name              Type             Address           Offset
             Size              EntSize          Flags  Link  Info  Align
        [ 0]                   NULL             0000000000000000  00000000
             0000000000000000  0000000000000000           0     0     0
        [ 1] .note.gnu.build-i NOTE             0000000000000000  00000040
             0000000000000024  0000000000000000   A       0     0     4
        [ 2] .text             PROGBITS         0000000000000000  00000068
             000000000001c8a0  0000000000000000  AX       0     0     8
      
      As seen the .text segment has an offset of 0x68 with start address 0x0.
      Therefore 0x68 is added to the address of qeth_send_ipa_cmd and thus
      0x13088 + 0x68 = 0x130f0 is displayed.
      
      This is wrong, perf report needs to display the start address of symbol
      qeth_send_ipa_cmd at 0x13088 + qeth.ko.text section start address.
      
      The qeth.ko module .text start address is available in the qeth.ko DSO
      map. Just identify the kernel module symbols and correct the addresses.
      
      With the fix I see this correct address for symbol: symbol__new:
      qeth_send_ipa_cmd 0x3ff802a9da8-0x3ff802a9f86
      Signed-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Reviewed-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Cc: Zvonko Kosic <zvonko.kosic@de.ibm.com>
      LPU-Reference: 20170803134902.47207-1-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-q8lktlpoxb5e3dj52u1s1rw4@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4a084ecf
    • Thomas Richter's avatar
      perf record: Fix wrong size in perf_record_mmap for last kernel module · 9ad4652b
      Thomas Richter authored
      During work on perf report for s390 I ran into the following issue:
      
      0 0x318 [0x78]: PERF_RECORD_MMAP -1/0:
              [0x3ff804d6990(0xfffffc007fb2966f) @ 0]:
              x /lib/modules/4.12.0perf1+/kernel/drivers/s390/net/qeth_l2.ko
      
      This is a PERF_RECORD_MMAP entry of the perf.data file with an invalid
      module size for qeth_l2.ko (the s390 ethernet device driver).
      
      Even a mainframe does not have 0xfffffc007fb2966f bytes of main memory.
      
      It turned out that this wrong size is created by the perf record
      command.  What happens is this function call sequence from
      __cmd_record():
      
        perf_session__new():
          perf_session__create_kernel_maps():
            machine__create_kernel_maps():
              machine__create_modules():   Creates map for all loaded kernel modules.
                modules__parse():   Reads /proc/modules and extracts module name and
                                    load address (1st and last column)
                  machine__create_module():   Called for every module found in /proc/modules.
                                    Creates a new map for every module found and enters
                                    module name and start address into the map. Since the
                                    module end address is unknown it is set to zero.
      
      This ends up with a kernel module map list sorted by module start
      addresses.  All module end addresses are zero.
      
      Last machine__create_kernel_maps() calls function map_groups__fixup_end().
      This function iterates through the maps and assigns each map entry's
      end address the successor map entry start address. The last entry of the
      map group has no successor, so ~0 is used as end to consume the remaining
      memory.
      
      Later __cmd_record calls function record__synthesize() which in turn calls
      perf_event__synthesize_kernel_mmap() and perf_event__synthesize_modules()
      to create PERF_REPORT_MMAP entries into the perf.data file.
      
      On s390 this results in the last module qeth_l2.ko
      (which has highest start address, see module table:
              [root@s8360047 perf]# cat /proc/modules
              qeth_l2 86016 1 - Live 0x000003ff804d6000
              qeth 266240 1 qeth_l2, Live 0x000003ff80296000
              ccwgroup 24576 1 qeth, Live 0x000003ff80218000
              vmur 36864 0 - Live 0x000003ff80182000
              qdio 143360 2 qeth_l2,qeth, Live 0x000003ff80002000
              [root@s8360047 perf]# )
      to be the last entry and its map has an end address of ~0.
      
      When the PERF_RECORD_MMAP entry is created for kernel module qeth_l2.ko
      its start address and length is written. The length is calculated in line:
          event->mmap.len   = pos->end - pos->start;
      and results in 0xffffffffffffffff - 0x3ff804d6990(*) = 0xfffffc007fb2966f
      
      (*) On s390 the module start address is actually determined by a __weak function
      named arch__fix_module_text_start() in machine__create_module().
      
      I think this improvable. We can use the module size (2nd column of /proc/modules)
      to get each loaded kernel module size and calculate its end address.
      Only for map entries which do not have a valid end address (end is still zero)
      we can use the heuristic we have now, that is use successor start address or ~0.
      Signed-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Reviewed-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Cc: Zvonko Kosic <zvonko.kosic@de.ibm.com>
      LPU-Reference: 20170803134902.47207-2-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-nmoqij5b5vxx7rq2ckwu8iaj@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ad4652b
    • Milian Wolff's avatar
      perf srcline: Do not consider empty files as valid srclines · d964b1cd
      Milian Wolff authored
      Sometimes we get a non-null, but empty, string for the filename from
      bfd. This then results in srclines of the form ":0", which is different
      from the canonical SRCLINE_UNKNOWN in the form "??:0".  Set the file to
      NULL if it is empty to fix this.
      Signed-off-by: default avatarMilian Wolff <milian.wolff@kdab.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Yao Jin <yao.jin@linux.intel.com>
      Link: http://lkml.kernel.org/r/20170806212446.24925-14-milian.wolff@kdab.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d964b1cd
    • Milian Wolff's avatar
      perf util: Take elf_name as const string in dso__demangle_sym · 80c345b2
      Milian Wolff authored
      The input string is not modified and thus can be passed in as a pointer
      to const data.
      Signed-off-by: default avatarMilian Wolff <milian.wolff@kdab.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Yao Jin <yao.jin@linux.intel.com>
      Link: http://lkml.kernel.org/r/20170806212446.24925-3-milian.wolff@kdab.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      80c345b2
    • Arnaldo Carvalho de Melo's avatar
      perf test shell: Add test using vfs_getname + 'perf trace' · e498f336
      Arnaldo Carvalho de Melo authored
      Uses the 'perf test shell' library to add probe:vfs_getname to the
      system then use it with 'perf trace' using 'touch' to write to a temp
      file, then checks that that was captured by the vfs_getname was used by
      'perf trace', that already handles "probe:vfs_getname" if present, and
      used in the "open" syscall "filename" argument beautifier.
      
      Testing it:
      
        # perf test "trace + vfs_getname"
        61: Check open filename arg using perf trace + vfs_getname: Ok
        #
      
        # perf test -v "trace + vfs_getname"
        61: Check open filename arg using perf trace + vfs_getname:
        --- start ---
        test child forked, pid 30846
        Added new event:
          probe:vfs_getname    (on getname_flags:72 with pathname=result->name:string)
      
        You can now use it in all perf tools, such as:
      
        	perf record -e probe:vfs_getname -aR sleep 1
      
             2.237 ( 0.012 ms): touch/30855 open(filename: /tmp/temporary_file.kmoWQ, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
        test child finished with 0
        ---- end ----
        Check open filename arg using perf trace + vfs_getname: Ok
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-j02nobfvvn9c7yrphdsnbqx0@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e498f336
    • Arnaldo Carvalho de Melo's avatar
      perf test shell: Add test using probe:vfs_getname and verifying results · 6060c726
      Arnaldo Carvalho de Melo authored
      This test uses the 'perf test shell' library to add probe:vfs_getname to the
      system then use it with 'perf record' using 'touch' to write to a temp file,
      then checks that that was captured by the vfs_getname probe in the generated
      perf.data file, with the temp file name as the pathname argument.
      
      Using it:
      
        # perf test "Use vfs_getname"
        60: Use vfs_getname probe to get syscall args filenames: Ok
        # perf test -v "Use vfs_getname"
        60: Use vfs_getname probe to get syscall args filenames:
        --- start ---
        test child forked, pid 16414
        Added new event:
          probe:vfs_getname    (on getname_flags:72 with pathname=result->name:string)
      
        You can now use it in all perf tools, such as:
      
      	perf record -e probe:vfs_getname -aR sleep 1
      
        Recording open file:
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.022 MB /tmp/vaca.perf.data.QZsn7 (13 samples) ]
        Looking at perf.data file for vfs_getname records for the file we touched:
                   touch 16421 [002] 1255152.879561: probe:vfs_getname: (ffffffffa626e608) pathname="/tmp/vaca.l10SL"
        test child finished with 0
        ---- end ----
        Use vfs_getname probe to get syscall args filenames: Ok
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-t555fnhbcbxnukltk23dqxur@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6060c726
    • Arnaldo Carvalho de Melo's avatar
      perf test shell: Move vfs_getname probe function to lib · 5ce669a5
      Arnaldo Carvalho de Melo authored
      Multiple tests will be able to reuse these functions, to test things
      like perf report, 'trace', etc, using this probe.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-48xagvozhouhyi8fjota6o2d@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5ce669a5
    • Arnaldo Carvalho de Melo's avatar
      perf test shell: Install shell tests · 122e0b94
      Arnaldo Carvalho de Melo authored
      Now that we have shell tests, install them.
      
      Developers don't need this pass, as 'perf test' will look first at the
      in tree scripts at tools/perf/tests/shell/.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-j21u4v0jsehi0lpwqwjb4j45@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      122e0b94
    • Arnaldo Carvalho de Melo's avatar
      perf test shell: Add 'probe_vfs_getname' shell test · a3534842
      Arnaldo Carvalho de Melo authored
      First perf shell test:
      
        # perf test vfs_getname
        60: Add vfs_getname probe to get syscall args filenames: Ok
        #
      
      In verbose mode:
      
        # perf test -v vfs_getname
        60: Add vfs_getname probe to get syscall args filenames:
        --- start ---
        test child forked, pid 19146
        Added new event:
          probe:vfs_getname    (on getname_flags:72 with pathname=result->name:string)
      
        You can now use it in all perf tools, such as:
      
      	  perf record -e probe:vfs_getname -aR sleep 1
      
        test child finished with 0
        ---- end ----
        Add vfs_getname probe to get syscall args filenames: Ok
        #
      
      And if the vmlinux file is not found:
      
        # mv ../build/v4.12.0-rc6+/vmlinux ../build/v4.12.0-rc6+/vmlinux.hidden
        # perf test vfs_getname
        60: Add vfs_getname probe to get syscall args filenames: Skip
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-8f3n22c1yn516ev30s603ow2@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a3534842
    • Arnaldo Carvalho de Melo's avatar
      perf test: Make 'list' use same filtering code as main 'perf test' · 6d02acc1
      Arnaldo Carvalho de Melo authored
      Before:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        # perf test list Synth
        #
      
      After:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        # perf test list Synth
        39: Synthesize thread map
        41: Synthesize cpu map
        42: Synthesize stat config
        43: Synthesize stat
        44: Synthesize stat round
        45: Synthesize attr update
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-v95tqqzuwawsmds3zn2mosje@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6d02acc1
    • Arnaldo Carvalho de Melo's avatar
      perf test: Add infrastructure to run shell based tests · 1209b273
      Arnaldo Carvalho de Melo authored
      To allow testing by directly using perf tools in scripts, checking that
      the effects on the system are the ones expected and that the output
      produced is as well the desired one.
      
      For instance, adding a probe at a well known location with 'perf probe',
      then checking that the results from using that probe to record are the
      desired ones, etc.
      
      The next csets will introduce tests using this new testing
      infrastructure.
      
      The scripts should return 0 for Ok, 1 for FAIL and 2 for SKIP.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-swbpn7amrjqffh83lsr39s9p@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1209b273
    • Arnaldo Carvalho de Melo's avatar
      perf test: Add 'struct test *' to the test functions · 81f17c90
      Arnaldo Carvalho de Melo authored
      This way we'll be able to pass more test specific parameters without
      having to change this function signature.
      
      Will be used by the upcoming 'shell tests', shell scripts that will
      call perf tools and check if they work as expected, comparing its
      effects on the system (think 'perf probe foo') the output produced, etc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-wq250w7j1opbzyiynozuajbl@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      81f17c90
    • Arnaldo Carvalho de Melo's avatar
      perf test: Make 'list' subcommand match main 'perf test' numbering/matching · 28765bf2
      Arnaldo Carvalho de Melo authored
      Before:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        #
        # perf test list Synth
         1: Synthesize thread map
         2: Synthesize cpu map
         3: Synthesize stat config
         4: Synthesize stat
         5: Synthesize stat round
         6: Synthesize attr update
        #
      
      After:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        #
        # perf test list Synth
        39: Synthesize thread map
        41: Synthesize cpu map
        42: Synthesize stat config
        43: Synthesize stat
        44: Synthesize stat round
        45: Synthesize attr update
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-pjhuhkphs7o3tkbqrukfv6bz@git.kernel.org
      Fixes: e8210cef ("perf tests: Introduce iterator function for tests")
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      28765bf2
    • Andi Kleen's avatar
    • Andi Kleen's avatar
      perf stat: Fix saved values rbtree lookup · 5e97665f
      Andi Kleen authored
      The stat shadow saved values rbtree is indexed by a pointer.  Fix the
      comparison function:
      
      - We cannot return a pointer delta as an int because that loses bits on
        64bit.
      
      - Doing pointer arithmetic on the struct pointer only works if the
        objects are spaced by the multiple of the object size, which is not
        guaranteed for individual malloc'ed object
      
      Replace it with a proper comparison.
      
      This fixes various problems with values not being found.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20170724234015.5165-4-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5e97665f
    • Sukadev Bhattiprolu's avatar
      perf vendor events powerpc: Update POWER9 events · 3c22ba52
      Sukadev Bhattiprolu authored
      Update and cleanup POWER9 PMU events.
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Anton Blanchard <anton@au1.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Link: http://lkml.kernel.org/r/20170802174617.GA32545@us.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3c22ba52
    • Sukadev Bhattiprolu's avatar
      perf vendor events powerpc: remove suffix in mapfile · 2862a168
      Sukadev Bhattiprolu authored
      Drop the .json suffix for events directory in the mapfile.csv.
      
      Now that we have separate JSON files for each topic in a CPU (eg: see
      tools/perf/pmu-events/arch/powerpc/power8/*.json) the .json suffix in
      the mapfile is misleading and redundant.
      Reported-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Anton Blanchard <anton@au1.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20170802174617.GA32545@us.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2862a168
    • Naveen N. Rao's avatar
      perf scripting python: Add ppc64le to audit uname list · 6fae8663
      Naveen N. Rao authored
      Before patch:
      
        $ uname -m
        ppc64le
        $ ./perf script -s ./scripts/python/syscall-counts.py
        Install the audit-libs-python package to get syscall names.
        For example:
          # apt-get install python-audit (Ubuntu)
          # yum install audit-libs-python (Fedora)
          etc.
      
        Press control+C to stop and show the summary
        ^CWarning:
        4 out of order events recorded.
      
        syscall events:
      
        event                                          count
        ----------------------------------------  -----------
        4                                             504638
        54                                              1206
        221                                               42
        55                                                21
        3                                                 12
        167                                               10
        11                                                 8
        6                                                  7
        125                                                6
        5                                                  6
        108                                                5
        162                                                4
        90                                                 4
        45                                                 3
        33                                                 3
        311                                                1
        246                                                1
        238                                                1
        93                                                 1
        91                                                 1
      
      After patch:
        ./perf script -s ./scripts/python/syscall-counts.py
        Press control+C to stop and show the summary
        ^CWarning:
        5 out of order events recorded.
      
        syscall events:
      
        event                                          count
        ----------------------------------------  -----------
        write                                         643411
        ioctl                                           1206
        futex                                             54
        fcntl                                             27
        poll                                              14
        read                                              12
        execve                                             8
        close                                              7
        mprotect                                           6
        open                                               6
        nanosleep                                          5
        fstat                                              5
        mmap                                               4
        inotify_add_watch                                  3
        brk                                                3
        access                                             3
        timerfd_settime                                    1
        clock_gettime                                      1
        epoll_wait                                         1
        ftruncate                                          1
        munmap                                             1
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Acked-by: default avatarPaul Clarke <pc@us.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/n/tip-bnl67p1alkvx97pn9moxz3qp@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6fae8663
  5. 10 Aug, 2017 10 commits