linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
To: Michael Petlan <mpetlan@redhat.com>, linux-perf-users@vger.kernel.org
Cc: Jiri Olsa <jolsa@redhat.com>, Arnaldo de Melo <acme@redhat.com>
Subject: Re: [PATCH] perf test shell: Fix check open filename arg using 'perf trace'
Date: Thu, 30 Nov 2017 11:28:33 +0100	[thread overview]
Message-ID: <84d4a40a-dfbf-6d9b-9eb2-6912dc6f57e4@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LRH.2.20.1711291656270.9416@Diego>

On 11/29/2017 06:27 PM, Michael Petlan wrote:
> Hi Arnaldo, Jiri and others!
> 
> Posting a fix for perf test "Check open filename arg using perf trace + vfs_getname".
> 
> The commit f231af789b11a2f1a3795acc3228a3e178a80c21 adds an exception for s390x to
> use openat() syscall instead of open(). This exception is not s390x-only, thus I
> adjusted the test to accept both open and openat syscalls, no matter which arch it
> runs on. Does it sound reasonable to you?
> 
> 
> When testing on 4.15.0-rc1, I also hit the following issue:
> 
> # perf probe "vfs_getname=getname_flags:72 pathname=result->name:string"
> Failed to find 'result' in this function.
>   Error: Failed to add events.
> 
> # perf probe -L getname_flags 
> [...]
>      72         result->uptr = filename;
>      73         result->aname = NULL;
> [...]
> 
> # perf probe "vfs_getname=getname_flags:72 pathname=result->uptr:string"
> Failed to find 'result' in this function.
>   Error: Failed to add events.
> 
> ... When the probed var is changed to "filename", it seems to work:
> 
> # perf probe "vfs_getname=getname_flags:72 pathname=filename:string"
> Added new event:
>   probe:vfs_getname    (on getname_flags:72 with pathname=filename:string)
> 
> You can now use it in all perf tools, such as:
> 
> 	perf record -e probe:vfs_getname -aR sleep 1
> 
> 
> So maybe the second attached patch is necessary too, not sure. Just thinking
> that "filename" might be less change-prone, as a func. arg... ?
> 
> Thank you.
> 
> Cheers,
> Michael
> 

Maybe I have done something wrong when I tried your patch. I have download
latest 4.15.0rc1 but your patch does not work for me.
My perf tool does not handle wild cards on events:

root@s35lp76 shell]# /root/linux/tools/perf/perf  trace -e 'open' touch /tmp/xxx
     0.000 ( 0.013 ms): touch/28615 open(filename: 0xbc990692, flags: CLOEXEC                             ) = 3
[root@s35lp76 shell]# /root/linux/tools/perf/perf  trace -e 'openat' touch /tmp/xxx
     0.000 ( 0.011 ms): touch/28617 openat(dfd: CWD, filename: 0xa7324328, flags: CLOEXEC                 ) = 3
     0.037 ( 0.009 ms): touch/28617 openat(dfd: CWD, filename: 0xa737de60, flags: CLOEXEC                 ) = 3
     0.454 ( 0.015 ms): touch/28617 openat(dfd: CWD, filename: 0xeebff57c, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
[root@s35lp76 shell]# /root/linux/tools/perf/perf  trace -e 'open*' touch /tmp/xxx
event syntax error: 'open*'
                     \___ Cannot find PMU `open*'. Missing kernel support?
Run 'perf list' for a list of valid events

 Usage: perf trace [<options>] [<command>]
    or: perf trace [<options>] -- <command> [<options>]
    or: perf trace record [<options>] [<command>]
    or: perf trace record [<options>] -- <command> [<options>]

    -e, --event <event>   event/syscall selector. use 'perf list' to list available events
[root@s35lp76 shell]# 

Is this a configuration error on my side?
-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

  reply	other threads:[~2017-11-30 10:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 17:27 [PATCH] perf test shell: Fix check open filename arg using 'perf trace' Michael Petlan
2017-11-30 10:28 ` Thomas-Mich Richter [this message]
2017-11-30 15:56   ` Arnaldo de Melo
2017-11-30 15:59     ` Arnaldo de Melo
2017-12-05 15:39       ` Hendrik Brueckner
2017-12-06 16:34         ` Arnaldo Carvalho de Melo
2017-12-07  7:39           ` Hendrik Brueckner
2017-12-01  2:33     ` Namhyung Kim
2017-12-01 15:16       ` Arnaldo Carvalho de Melo
2017-12-02 23:21         ` Michael Petlan
2017-12-05 23:18         ` Michael Petlan
2017-12-06 14:28           ` Arnaldo de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84d4a40a-dfbf-6d9b-9eb2-6912dc6f57e4@linux.vnet.ibm.com \
    --to=tmricht@linux.vnet.ibm.com \
    --cc=acme@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).