1. 11 7月, 2018 1 次提交
    • K
      perf test shell: Replace '|&' with '2>&1 |' to work with more shells · 508ef3e7
      Kim Phillips 提交于
      Since we do not specify bash (and/or zsh) as a requirement, use the
      standard error redirection that is more widely supported.
      
      BEFORE:
      
       $ sudo perf test -v 62
       62: Check open filename arg using perf trace + vfs_getname:
       --- start ---
       test child forked, pid 27305
       ./tests/shell/trace+probe_vfs_getname.sh: 20: ./tests/shell/trace+probe_vfs_getname.sh: Syntax error: "&" unexpected
       test child finished with -2
       ---- end ----
       Check open filename arg using perf trace + vfs_getname: Skip
      
      AFTER:
      
       $ sudo perf test -v 62
       64: Check open filename arg using perf trace + vfs_getname               :
       --- start ---
       test child forked, pid 23008
       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
      
            0.361 ( 0.008 ms): touch/23032 openat(dfd: CWD, filename: /tmp/temporary_file.VEh0n, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 4
       test child finished with 0
       ---- end ----
       Check open filename arg using perf trace + vfs_getname: Ok
      
      Similar to commit 35435cd0, with the same title.
      Signed-off-by: NKim Phillips <kim.phillips@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20180629124633.0a9f4bea54b8d2c28f265de2@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      508ef3e7
  2. 27 12月, 2017 1 次提交
  3. 29 11月, 2017 1 次提交
    • T
      perf test shell: Fix check open filename arg using 'perf trace' on s390x · ccafc38f
      Thomas Richter 提交于
      This 'perf test' case fails on s390x. The 'touch' command on s390x uses
      the 'openat' system call to open the file named on the command line:
      
      [root@s35lp76 perf]# perf probe -l
        probe:vfs_getname    (on getname_flags:72@fs/namei.c with pathname)
      [root@s35lp76 perf]# perf trace -e open touch /tmp/abc
           0.400 ( 0.015 ms): touch/27542 open(filename:
      		/usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
      [root@s35lp76 perf]#
      
      There is no 'open' system call for file '/tmp/abc'. Instead the 'openat'
      system call is used:
      
      [root@s35lp76 perf]# strace touch /tmp/abc
          execve("/usr/bin/touch", ["touch", "/tmp/abc"], 0x3ffd547ec98
      			/* 30 vars */) = 0
          [...]
          openat(AT_FDCWD, "/tmp/abc", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
          [...]
      
      On s390x the 'egrep' command does not find a matching pattern and
      returns an error.
      
      Fix this for s390x create a platform dependent command line to enable
      the 'perf probe' call to listen to the 'openat' system call and get the
      expected output.
      Signed-off-by: NThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      LPU-Reference: 20171114071847.2381-1-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-3qf38jk0prz54rhmhyu871my@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ccafc38f
  4. 17 11月, 2017 1 次提交
    • T
      perf test shell: Fix check open filename arg using 'perf trace' on s390x · f231af78
      Thomas Richter 提交于
      This 'perf test' case fails on s390x. The 'touch' command on s390x uses
      the 'openat' system call to open the file named on the command line:
      
      [root@s35lp76 perf]# perf probe -l
        probe:vfs_getname    (on getname_flags:72@fs/namei.c with pathname)
      [root@s35lp76 perf]# perf trace -e open touch /tmp/abc
           0.400 ( 0.015 ms): touch/27542 open(filename:
      		/usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
      [root@s35lp76 perf]#
      
      There is no 'open' system call for file '/tmp/abc'. Instead the 'openat'
      system call is used:
      
      [root@s35lp76 perf]# strace touch /tmp/abc
          execve("/usr/bin/touch", ["touch", "/tmp/abc"], 0x3ffd547ec98
      			/* 30 vars */) = 0
          [...]
          openat(AT_FDCWD, "/tmp/abc", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
          [...]
      
      On s390x the 'egrep' command does not find a matching pattern and
      returns an error.
      
      Fix this for s390x create a platform dependent command line to enable
      the 'perf probe' call to listen to the 'openat' system call and get the
      expected output.
      Signed-off-by: NThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      LPU-Reference: 20171114071847.2381-1-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-3qf38jk0prz54rhmhyu871my@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f231af78
  5. 15 8月, 2017 1 次提交
    • A
      perf test shell: Check if 'perf probe' is available, skip tests if not · 1ad5a182
      Arnaldo Carvalho de Melo 提交于
      Add a library function that checks if 'perf probe' is built into the
      tool being tested, skipping tests that need it.
      
      Testing it on a system after removing the library needed to build
      'probe' as a perf subcommand:
      
        # perf test ping vfs_getname
        59: Use vfs_getname probe to get syscall args filenames   : Skip
        60: probe libc's inet_pton & backtrace it with ping       : Skip
        61: Check open filename arg using perf trace + vfs_getname: Skip
        62: Add vfs_getname probe to get syscall args filenames   : Skip
        # perf probe
        perf: 'probe' is not a perf-command. See 'perf --help'.
        #
      
      Now reinstalling elfutils-libelf-devel on this Fedora 26 system to
      rebuild perf and then retest this:
      
        # perf test ping vfs_getname
        60: Use vfs_getname probe to get syscall args filenames   : Ok
        61: probe libc's inet_pton & backtrace it with ping       : Ok
        62: Check open filename arg using perf trace + vfs_getname: Ok
        63: Add vfs_getname probe to get syscall args filenames   : Ok
        #
      Reported-by: NKim Phillips <kim.phillips@arm.com>
      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-ctdck2gzsskqhjzu3ebb62zm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1ad5a182
  6. 12 8月, 2017 1 次提交
    • A
      perf test shell: Add test using vfs_getname + 'perf trace' · e498f336
      Arnaldo Carvalho de Melo 提交于
      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: NArnaldo Carvalho de Melo <acme@redhat.com>
      e498f336