lkml.org 
[lkml]   [2015]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH perf/core v2 14/16] perf probe: Add group name support
On Mon, Jul 20, 2015 at 01:48:36PM +0900, Masami Hiramatsu wrote:
> On 2015/07/19 19:16, Namhyung Kim wrote:
> > On Wed, Jul 15, 2015 at 06:15:30PM +0900, Masami Hiramatsu wrote:
> >> Allow user to set group name for adding new event.
> >> Note that this can easily shot yourself in the foot.
> >> E.g. Existing group name can conflict with other events.
> >> Especially, using the group name reserved for kernel
> >> modules can break something when loading/unloading
> >> modules.
> >
> > Yes, I agree that this can be dangerous. How about enforcing
> > [ku]probes to make the directory of dynamic events safely?
>
> What the safety issue would you afraid?

As you said, I worried that an arbitrary group/event names can clash
with another module's group/event names.


>
> > I think
> > it'd be better putting all dynamic events in a single directory -
> > e.g. $tracefs/events/probe/. Any events lack group name are created
> > in the directory. Any events have group name create subdirectories as
> > group name under the directory. The perf tools (and others too)
> > should be changed to lookup the directory after the usual location.
>
> That will be possible, but includes a big change on event namespace,
> e.g. how we'll show the events by perf-list? Even if we can avoid
> namespace conflict on tracefs, perf-list event namespace is still
> fragile.

Yes, it's a big change. And I think we can easily fix perf-list to
handle the new event namespace. But other tools/scripts will break.


>
> > What do you think?
>
> I think there are 2 purposes of probe-event, one is just additional
> debug points, another is an extensible event-set. The former will not
> any namespace problem, we just add it into new namespace. But latter
> requires to be treated as a part of existing (in-kernel) events.
> And (userspace)SDT is clearly the latter one.
>
> However, avoiding the conflict of namespace is also important, how
> about simply using sdt_<PROVIDER>:<NAME> ?
>
> - Give just a name on a userspace binary
> perf probe -x <BIN> --add <NAME>=<PROBEDEF>
> -> probe_<BIN>:<NAME>
> - Give a pair of group and name on a userspace binary
> perf probe -x <BIN> --add <GRP>:<NAME>=<PROBEDEF>
> -> probe_<GRP>:<NAME>
> - Set an sdt event on a userspace binary
> perf probe -x <BIN> --add %<PROV>:<NAME> # or %sdt_<PROV> ?
> -> sdt_<PROV>:<NAME>
> - Set an cached event on a userspace binary
> perf probe -x <BIN> --add %<GRP>:<NAME> # or %probe_<GRP> ?
> -> probe_<GRP>:<NAME>

I think this is good for perf. It seems same problem still exists
when users access tracefs directly though.

Thanks,
Namhyung


\
 
 \ /
  Last update: 2015-07-20 18:01    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog