This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC] perf-cache command interface design
- From: Hemant Kumar <hemant at linux dot vnet dot ibm dot com>
- To: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, Namhyung Kim <namhyung at kernel dot org>, Arnaldo Carvalho de Melo <acme at redhat dot com>
- Cc: linux-kernel at vger dot kernel dot org, srikar at linux dot vnet dot ibm dot com, peterz at infradead dot org, oleg at redhat dot com, hegdevasant at linux dot vnet dot ibm dot com, mingo at redhat dot com, systemtap at sourceware dot org, aravinda at linux dot vnet dot ibm dot com, penberg at iki dot fi, brendan dot d dot gregg at gmail dot com, "yrl dot pp-manager dot tt at hitachi dot com" <yrl dot pp-manager dot tt at hitachi dot com>
- Date: Fri, 07 Nov 2014 16:21:34 +0530
- Subject: Re: [RFC] perf-cache command interface design
- Authentication-results: sourceware.org; auth=none
- References: <20141102105006 dot 21708 dot 28734 dot stgit at hemant-fedora> <20141102105557 dot 21708 dot 19032 dot stgit at hemant-fedora> <87lhnr5sbl dot fsf at sejong dot aot dot lge dot com> <54588905 dot 7040002 at linux dot vnet dot ibm dot com> <5458CD15 dot 4010101 at hitachi dot com> <874muew2hk dot fsf at sejong dot aot dot lge dot com> <5459E865 dot 6050207 at hitachi dot com> <545B1DDE dot 9000202 at linux dot vnet dot ibm dot com> <545C80F4 dot 4020905 at hitachi dot com>
On 11/07/2014 01:51 PM, Masami Hiramatsu wrote:
> 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!
Thanks, I have some comments below.
> 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 <FILES>
> perf cache --sdt --add|--update <FILES>
> Remove all SDT events for <FILES>
> perf cache --sdt --remove <FILES>
>
> List all SDT events
> perf cache --sdt --list
>
> And --probes for managing probe-caches as below.
>
> Add new probe-cache entries for kernel, <PATH> or <MOD>.
> perf cache --probe [--exec <PATH>|--module <MOD>] --add <SPEC>
>
> Delete existing probe-cache entries for kernel, <PATH> or/and <BUILDID>.
> perf cache --probe --del [<GROUP>:]<EVENT>[@<PATH>][#<BUILDID>]
>
> Or remove all entires for given FILES
> perf cache --probe --remove <FILES>
>
> List the probe caches(including SDT) for kernel, <PATH>, or/and <BUILDID>.
> perf cache --probe --list [@<PATH>][#<BUILDID>]
>
> Query the probe definitions.
> perf cache --probe --query [<GROUP>:]<EVENT>[@<PATH>][#<BUILDID>]
>
> Note that --probes also can be used for managing SDT events, which has % prefix
> e.g.
> Add all SDT events for <PATH>
> perf cache --probe --exec <PATH> --add '%*:*'
>
> Remove some SDT events for <PATH>
> perf cache --probe --del '%some:events@<PATH>'
>
> Or remove all SDT events for <BUILDID>
> perf cache --probe --del '%*:*#<BUILDID>'
Looks nice to me :)
>
> 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/.
>
> This SDT/probe caches contain probe-definitions as following format.
> ----
> #buildid:BUILDID
> #path:PATH
> p:%PROVIDER/EVENT PATH:OFFSET [ARGS]
I think this format isn't accepted by the uprobe_events file (because of
the '%') if we want to cat and grep into uprobe_events file directly.
Although, in case of perf record, we can process it to remove '%' and
then write into uprobe_events file. And, '%' is required as a flag for
the SDT entries.
So, either we can modify the uprobe_events file to ignore '%' in the
event group name (with an additional patch in the SDT series) or we can
leave it to the user to write a script which can do some processing to
remove '%' and then echo it to uprobe_events file.
What would you think?
> 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,
>
--
Thanks,
Hemant Kumar