[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 12 Dec 2017 04:05:23 +0100 (CET)
From: Michael Petlan <mpetlan@...hat.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
cc: Arnaldo de Melo <acme@...hat.com>,
linux-perf-users@...r.kernel.org, Jiri Olsa <jolsa@...hat.com>,
Thomas-Mich Richter <tmricht@...ux.vnet.ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] perf test shell: Fix check open filename arg using
'perf trace
On Mon, 11 Dec 2017, Arnaldo Carvalho de Melo wrote:
> It is not working here:
Hmm, I think I got it.
The following construction:
evts=`perf list syscalls:sys_enter_open* |& egrep 'open(at)? ' | sed -r 's/.*sys_enter_(.*) +\[.*/-e \1/'`
... expands to:
"-e open -e openat"
... which is a format that perf-trace does not seem to accept.
It simply overrides the first event with the second, thus it
only traces "openat". It worked for me, since I tested it on
aarch64 where $evts expanded to only one "-e" parameter.
Attaching a patch for perf-trace that should address it. It
seems to work, so perf-trace accepts "-e open -e openat".
However, one weak point is there:
"-e open,openat -e stat" works, while
"-e open -e openat,stat" does not.
In case you don't like the patch for perf-trace, the test's
patch would need to expand events to something else (which is
of course possible).
Also, on my system (x86_64, 4.15.0-rc1), I needed another
patch for the test (perf_test_shell_fix_filename_arg.patch),
because the variable name changed...
> [root@...et mnt]# perf test -v 62
> 62: Check open filename arg using perf trace + vfs_getname:
> --- start ---
> test child forked, pid 4919
> 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 -1
> ---- end ----
> Check open filename arg using perf trace + vfs_getname: FAILED!
> [root@...et mnt]#
>
> and when I run this with strace -e open to see if it is picking the
> right script, it is:
>
> open("/home/acme/libexec/perf-core/tests/shell/record+script_probe_vfs_getname.sh", O_RDONLY) = 4
> open("/home/acme/libexec/perf-core/tests/shell/trace+probe_libc_inet_pton.sh", O_RDONLY) = 4
> open("/home/acme/libexec/perf-core/tests/shell/trace+probe_vfs_getname.sh", O_RDONLY) = 4
> 62: Check open filename arg using perf trace + vfs_getname:
> --- start ---
> test child forked, pid 4947
> 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
>
> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4947, si_uid=0, si_status=255, si_utime=0, si_stime=0} ---
> test child finished with -1
> ---- end ----
> Check open filename arg using perf trace + vfs_getname: FAILED!
> open("/home/acme/libexec/perf-core/tests/shell/probe_vfs_getname.sh", O_RDONLY) = 4
> +++ exited with 0 +++
> [root@...et mnt]#
>
> [acme@...et linux]$ diff -u /home/acme/libexec/perf-core/tests/shell/probe_vfs_getname.sh tools/perf/tests/shell/probe_vfs_getname.sh
> [acme@...et linux]$ git log --oneline -1
> 0553ba305e4e (HEAD -> perf/core) perf test shell: Fix check open filename arg using 'perf trace
> [acme@...et linux]$
>
> So can you please check if the file you're using is the one in this
> patch submission?
So attaching all three patches to be sure. I have tested them on
two environments:
* x86_64 with 4.15.0-rc1
* aarch64 with 4.14.0
Both work with all three patches applied, applying on perf/core's
head (commit 26ea2ece7802f8fdaaacf321dbfb22de3271ab82).
>
> - Arnaldo
>
Thanks for your patience :)
Cheers,
Michael
View attachment "perf_trace_support_multiple_-e_arguments.patch" of type "text/plain" (1899 bytes)
View attachment "perf_test_shell_fix_filename_arg.patch" of type "text/plain" (691 bytes)
View attachment "perf_test_shell_fix_check_open_filename_arg__v2.patch" of type "text/plain" (1785 bytes)
Powered by blists - more mailing lists