Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752781AbaKGOnl (ORCPT ); Fri, 7 Nov 2014 09:43:41 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:44216 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752712AbaKGOnf (ORCPT ); Fri, 7 Nov 2014 09:43:35 -0500 Subject: Re: [RFC] perf-cache command interface design From: Namhyung Kim To: Masami Hiramatsu Cc: Hemant Kumar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, srikar@linux.vnet.ibm.com, peterz@infradead.org, oleg@redhat.com, hegdevasant@linux.vnet.ibm.com, mingo@redhat.com, systemtap@sourceware.org, aravinda@linux.vnet.ibm.com, penberg@iki.fi, brendan.d.gregg@gmail.com, "yrl.pp-manager.tt@hitachi.com" In-Reply-To: <545C80F4.4020905@hitachi.com> References: <20141102105006.21708.28734.stgit@hemant-fedora> <20141102105557.21708.19032.stgit@hemant-fedora> <87lhnr5sbl.fsf@sejong.aot.lge.com> <54588905.7040002@linux.vnet.ibm.com> <5458CD15.4010101@hitachi.com> <874muew2hk.fsf@sejong.aot.lge.com> <5459E865.6050207@hitachi.com> <545B1DDE.9000202@linux.vnet.ibm.com> <545C80F4.4020905@hitachi.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 07 Nov 2014 23:43:27 +0900 Message-ID: <1415371407.1648.37.camel@leonhard> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masami, 2014-11-07 (금), 17:21 +0900, Masami Hiramatsu: > Hello, > > Here, I've tried to describe my idea of perf-cache subcommand interface. > It is just a design review, not implemented yet :) > Please give me your comments/ideas! > > Command-line Synopsis > ===================== > > Current "perf buildid-cache [options]" are directly mapped to > "perf cache --buildid [options]". > > And adding --sdt for managing SDT caches as below. > > Add or update SDT events in > perf cache --sdt --add|--update > > Remove all SDT events for > perf cache --sdt --remove > > List all SDT events > perf cache --sdt --list > > And --probes for managing probe-caches as below. > > Add new probe-cache entries for kernel, or . > perf cache --probe [--exec |--module ] --add > > Delete existing probe-cache entries for kernel, or/and . > perf cache --probe --del [:][@][#] > > Or remove all entires for given FILES > perf cache --probe --remove > > List the probe caches(including SDT) for kernel, , or/and . > perf cache --probe --list [@][#] > > Query the probe definitions. > perf cache --probe --query [:][@][#] > > Note that --probes also can be used for managing SDT events, which has % prefix > e.g. > Add all SDT events for > perf cache --probe --exec --add '%*:*' > > Remove some SDT events for > perf cache --probe --del '%some:events@' > > Or remove all SDT events for > perf cache --probe --del '%*:*#' I'd prefer sub-command to option for this mandatory (and exclusive) behavior. What about like this? perf cache kprobe add [-m ] [...] perf cache kprobe del [:] [...] perf cache kprobe list [-m ] perf cache uprobe add -x [...] perf cache uprobe del [:] [...] perf cache uprobe list [-x ] perf cache sdt [add|del|update] [...] perf cache sdt list [-b ] [...] > > > File Format > =========== > All the cache files are placed under ~/.debug/ by default. > The paths of buildid cache of binary/symbols are not changed. > > The SDT/probe caches are placed under the ~/.debug/.probes/path/to/bin/bu/ildid > and that is linked to ~/.debug/.probes/.buildid/bu/ildid > # To avoid conflict with files under /probes/*, I picked up .probes/. However, to be used with perf record, we need a way to find a matching probe cache file from a event name (or group/provider name, preferably). What about having something like below: $ cat ~/.debug/.probes/event.map PROVIDER1 /path/to/some/where PROVIDER2 /path/to/other/place When perf record see a cached event used, it first searches its provider/group name from the event.map file. And then read bulid-id from the matching file on the path and finally find a cached event definition from ~/.debug/.probes/.buildid/bu/ildid file. > > This SDT/probe caches contain probe-definitions as following format. > ---- > #buildid:BUILDID > #path:PATH > p:%PROVIDER/EVENT PATH:OFFSET [ARGS] It seems PATH is redundant and we don't need to repeat it everyline IMHO. Since it need post-processing anyway, maybe it's better to just make it simpler, like: %:PROVIDER/EVENT OFFSET [ARGS] Thanks, Namhyung > p:PROBE/EVENT _text+OFFSET [ARGS] > ---- > > Normal probes and SDT cache entries can be mixed in a cache file, we'll > load all the entries and filter by % prefixes. > > > Thank you, > -- 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/