linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo de Melo <acme@redhat.com>
To: Michael Petlan <mpetlan@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>,
	linux-perf-users@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
	kernel-team@lge.com
Subject: Re: [PATCH] perf test shell: Fix check open filename arg using 'perf trace'
Date: Wed, 6 Dec 2017 12:28:56 -0200	[thread overview]
Message-ID: <20171206142856.GA3138@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.20.1712060007430.9416@Diego>

Em Wed, Dec 06, 2017 at 12:18:59AM +0100, Michael Petlan escreveu:
> On Fri, 1 Dec 2017, Arnaldo Carvalho de Melo wrote:
> > Em Fri, Dec 01, 2017 at 11:33:14AM +0900, Namhyung Kim escreveu:
> [...]
> >  
> > > > What differs from x86 to others is that x86 uses syscalltbl, not requiring
> > > > audit-libs to map syscall numbers to names, so perhaps it is something in there...
> >  
> > > If it only needs to consider open or openat, why not specifying the
> > > both directly?
> >  
> > >   # perf trace -e open -e openat touch /etc/passwd
> > 
> > Same effect, works with other perf trace versions, but one suggestion to
> > make it shorter:
> > 
> > 	perf trace -e open,openat touch /etc/passwd
> > 
> > Does the same thing :-)
> 
> Well, do I understand it correctly, that we prefer the "-e open,openat" over
> the "-e 'open*'" because there are issues with the globbing feature on some
> architectures?

The best one is '-e open*', but then wildcard support is recent, so not
all backports have it, so I thought about '-e open,openat', but that
shouldn't be used due to reasons you pointed out, so probably we should
try to one that works most of the time and then check if it worked, if
not, try the other one
 
> I see a disadvantage of "-e open,openat" concept in that it does not work
> in case any of them is unavailable. So in case some kernel does not contain
> e.g. open in favor of openat, perf-trace fails to trace them. This can be
> easily simulated like `perf trace -e open,openit`:
> 
> event syntax error: 'openit'
>                      \___ Cannot find PMU `openit'. Missing kernel support?
> Run 'perf list' for a list of valid events
> 
> Since it is possible that open is not even supported, having both of them
> there is fragile. The "-e 'open*'" approach should expand only to supported
> syscalls.
> 
> The '' are necessary there, since just open* can expand to some filename.
> 
> .....
> 
> I also see problems with globbing on my aarch64 with 4.14, so that makes

Right, only x86 has support for globbing, a fallback method for using
audit-libs to get the list of syscall names to apply the glob and get
the result (open, openat) from open* remains to be done.

For s/390 it is being worked on by Hendrik, IIRC without using
audit-libs.

So, for the tiem being, it seems the best way is to do something like:

[root@jouet acme]# perf list syscalls:sys_enter_open* |& egrep 'open(at)? ' | sed -r 's/.*sys_enter_(.*) +\[.*/-e \1/'
-e open                           
-e openat                         
[root@jouet acme]# 

Because 'perf list' should have glob support for long enough for use to
use it here?

- Arnaldo

      reply	other threads:[~2017-12-06 14: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
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 [this message]

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=20171206142856.GA3138@redhat.com \
    --to=acme@redhat.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kernel-team@lge.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=tmricht@linux.vnet.ibm.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).