Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932852AbbGTPeR (ORCPT ); Mon, 20 Jul 2015 11:34:17 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:35498 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932181AbbGTPd6 (ORCPT ); Mon, 20 Jul 2015 11:33:58 -0400 Date: Tue, 21 Jul 2015 00:31:37 +0900 From: Namhyung Kim To: Masami Hiramatsu Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , linux-kernel@vger.kernel.org, Adrian Hunter , Ingo Molnar , Paul Mackerras , Jiri Olsa , Borislav Petkov , Hemant Kumar Subject: Re: [RFC PATCH perf/core v2 14/16] perf probe: Add group name support Message-ID: <20150720153137.GA9265@danjae.kornet> References: <20150715091352.8915.87480.stgit@localhost.localdomain> <20150715091530.8915.91220.stgit@localhost.localdomain> <20150719101633.GA25163@danjae.kornet> <55AC7DA4.80301@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55AC7DA4.80301@hitachi.com> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2892 Lines: 71 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_: ? > > - Give just a name on a userspace binary > perf probe -x --add = > -> probe_: > - Give a pair of group and name on a userspace binary > perf probe -x --add := > -> probe_: > - Set an sdt event on a userspace binary > perf probe -x --add %: # or %sdt_ ? > -> sdt_: > - Set an cached event on a userspace binary > perf probe -x --add %: # or %probe_ ? > -> probe_: I think this is good for perf. It seems same problem still exists when users access tracefs directly though. Thanks, Namhyung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/