All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Hemant Kumar <hemant@linux.vnet.ibm.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@kernel.org>,
	Borislav Petkov <bp@suse.de>
Subject: Re: Re: Re: [RFC PATCH perf/core v2 00/16] perf-probe --cache and SDT support
Date: Fri, 24 Jul 2015 12:52:37 -0300	[thread overview]
Message-ID: <20150724155237.GA300@kernel.org> (raw)
In-Reply-To: <20150724075519.GA19672@sejong>

Em Fri, Jul 24, 2015 at 04:55:19PM +0900, Namhyung Kim escreveu:
> On Fri, Jul 24, 2015 at 01:24:53AM +0900, Masami Hiramatsu wrote:
> > On 2015/07/23 23:01, Arnaldo Carvalho de Melo wrote:
> > > Em Thu, Jul 23, 2015 at 10:13:22PM +0900, Masami Hiramatsu escreveu:

> > The following patterns we've discussed.
> > 
> >  - <provider>:<name>
> > 	simple, but could easily clash with others.
> >  - probe_<provider>:<name>
> >  - sdt_<provider>:<name>
> > 	also simple and similar to current solution. but fragile against
> > 	clash among SDTs.
> >  - probe_<binary>:<provider>_<name>
> > 	also simple, but if provider or/and name has '_', it is hard to
> > 	split the provider and name. and fragile against clash among SDTs too.
> >  - <provider>_<buildid>/<name>
> > 	possible, but ugly since buildid is a random long xdigits(maybe cut up
> > 	to 8 or 12 bytes).
 
> As I said, we might allow name clashes as they're rare.  I don't want
> to make it complex just for an uncommon case.  I think such a
> duplicate name is fine as long as 'perf list' indicates it and 'perf
> record' enable them all.

I made some comments about enabling it all by default, look below.
 
> If we agreed to extend the event format, I'd like to keep it simple
> and to make it optional to add more info (separated by colon?).

Reading this again after writing what is below: my suggestion is to use
@, see rationale below.
 
> Maybe something like below.  Suppose we have 3 SDT events with a same
> name:
> 
>  /some/where/dir1/libfoo1.so (build-id: 0x1234...) -->  foo:bar
>  /some/where/dir2/libfoo1.so (build-id: 0x5678...) -->  foo:bar
>  /some/where/dir2/libfoo2.so (build-id: 0xabcd...) -->  foo:bar
> 
> So perf list shows the single name, but also says it has 3 events.
> 
>   $ perf list sdt_foo:bar
>   
>   sdt_foo:bar (total 3 events)            [User SDT event]

I would show what desambiguates them in non verbose mode, i.e., the
above would be:

   $ perf list sdt_foo:bar

   sdt_foo:bar:dir1/libfoo1.so   [User SDT event]
   sdt_foo:bar:dir2/libfoo1.so   [User SDT event]
   sdt_foo:bar:libfoo2.so        [User SDT event]

 The -v one would should both the full path and the buildid, but this
is just polishing up the default output a bit to make it more
informative.

	Now what should be the default when one does:

   perf record -e sdt_foo:bar

        Will it enable all events or bail out and state that multiple
events with that name matches, requiring a '--all-matches' to really
apply it to all events with the same name?

	Humm, this probably will not be that common, so perhaps just
use all matches by default while telling the user that all those places
were used and if the user wants just one of them, be more precise,
adding somehow a disambiguator.

	That would be something like this:

    perf record -e sdt_foo:bar:0x1234

	Or perhaps:

    perf record -e sdt_foo:bar@0x1234

	Because in this case the 'at' meaning of '@' makes sense, i.e.
use the std_foo:bar event at the DSO with a 0x1234 buildid?

	Additionally, for people that don't want to mess with buildids
because its environment is deemed well controlled and this works and is
unambiguous, looking at the LD_LIBRARY_PATH or equivalent:

    perf record -e sdt_foo:bar@libfoo2

	Full paths could be used as well.
> 
>   $ perf list -v sdt_foo:bar
>   
>   sdt_foo:bar:libfoo1.so:0x1234...        [User SDT event]
>   sdt_foo:bar:libfoo1.so:0x5678...        [User SDT event]
>   sdt_foo:bar:libfoo2.so:0xabcd...        [User SDT event]

> 
> Now perf record can accept any of these forms..
> 
>   # record all 3 events
>   $ perf record -e 'sdt_foo:bar'
> 
>   # record 2 events from libfoo1.so
>   $ perf record -e 'sdt_foo:bar:libfoo1.so'
> 
>   # record only 1 event
>   $ perf record -e 'sdt_foo:bar:libfoo1.so:0x1234...'
> 
> 
> What do you think?

If nothing prevents using @ with the meaning of "event at LOCATION"
where LOCATION is a buildid (noticed because it starts with 0x) or
a library name or pathname, then that looks more natural.

- Arnaldo

  reply	other threads:[~2015-07-24 15:52 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15  9:13 [RFC PATCH perf/core v2 00/16] perf-probe --cache and SDT support Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 01/16] perf probe: Simplify __add_probe_trace_events code Masami Hiramatsu
2015-07-21  9:34   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 02/16] perf probe: Move ftrace probe-event operations to probe-file.c Masami Hiramatsu
2015-07-21  9:35   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 03/16] perf probe: Use strbuf for making strings in probe-event.c Masami Hiramatsu
2015-07-17  7:42   ` Namhyung Kim
2015-07-17 10:16     ` Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 04/16] perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildid Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 05/16] perf buildid: Use SBUILD_ID_SIZE macro Masami Hiramatsu
2015-07-20 18:47   ` Arnaldo Carvalho de Melo
2015-07-21  9:35   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 06/16] perf buildid: Introduce sysfs/filename__sprintf_build_id Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 07/16] perf: Add lsdir to read a directory Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 08/16] perf-buildid-cache: Use lsdir for looking up buildid caches Masami Hiramatsu
2015-07-15  9:14 ` [RFC PATCH perf/core v2 09/16] perf probe: Add --cache option to cache the probe definitions Masami Hiramatsu
2015-07-15  9:15 ` [RFC PATCH perf/core v2 10/16] perf probe: Use cache entry if possible Masami Hiramatsu
2015-07-15  9:15 ` [RFC PATCH perf/core v2 11/16] perf probe: Show all cached probes Masami Hiramatsu
2015-07-15  9:15 ` [RFC PATCH perf/core v2 12/16] perf probe: Remove caches when --cache is given Masami Hiramatsu
2015-07-15  9:15 ` [RFC PATCH perf/core v2 13/16] perf/sdt: ELF support for SDT Masami Hiramatsu
2015-07-15  9:15 ` [RFC PATCH perf/core v2 14/16] perf probe: Add group name support Masami Hiramatsu
2015-07-19 10:16   ` Namhyung Kim
2015-07-20  4:48     ` Masami Hiramatsu
2015-07-20 15:31       ` Namhyung Kim
2015-07-15  9:15 ` [RFC PATCH perf/core v2 15/16] perf buildid-cache: Scan and import user SDT events to probe cache Masami Hiramatsu
2015-07-19 10:46   ` Namhyung Kim
2015-07-20  3:19     ` Masami Hiramatsu
2015-07-20 15:52       ` Namhyung Kim
2015-07-21 10:42         ` Masami Hiramatsu
2015-07-15  9:15 ` [RFC PATCH perf/core v2 16/16] perf probe: Accept %sdt and %cached event name Masami Hiramatsu
2015-07-19 10:53   ` Namhyung Kim
2015-07-20  3:03     ` Masami Hiramatsu
2015-07-16  3:13 ` [RFC PATCH perf/core v2 00/16] perf-probe --cache and SDT support Hemant Kumar
2015-07-17  3:21   ` Masami Hiramatsu
2015-07-19  4:24     ` Namhyung Kim
2015-07-20  5:47       ` Brendan Gregg
2015-07-20 16:20         ` Namhyung Kim
2015-07-21 10:34           ` Masami Hiramatsu
2015-07-22 14:12     ` Hemant Kumar
2015-07-23 13:13       ` Masami Hiramatsu
2015-07-23 14:01         ` Arnaldo Carvalho de Melo
2015-07-23 16:24           ` Masami Hiramatsu
2015-07-23 16:42             ` Arnaldo Carvalho de Melo
2015-07-24  7:55             ` Namhyung Kim
2015-07-24 15:52               ` Arnaldo Carvalho de Melo [this message]
2015-07-25  0:51                 ` Masami Hiramatsu
2015-07-27 14:03                 ` Re: " Namhyung Kim
2015-07-27 15:16                   ` Arnaldo Carvalho de Melo
2015-07-28  0:42                     ` Masami Hiramatsu
2015-07-28 13:45                       ` Arnaldo Carvalho de Melo
2015-07-20 18:36 ` Arnaldo Carvalho de Melo
2015-07-20 18:42   ` Arnaldo Carvalho 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=20150724155237.GA300@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adrian.hunter@intel.com \
    --cc=bp@suse.de \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.