lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1415371407.1648.37.camel@leonhard>
Date:	Fri, 07 Nov 2014 23:43:27 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc:	Hemant Kumar <hemant@...ux.vnet.ibm.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	linux-kernel@...r.kernel.org, srikar@...ux.vnet.ibm.com,
	peterz@...radead.org, oleg@...hat.com,
	hegdevasant@...ux.vnet.ibm.com, mingo@...hat.com,
	systemtap@...rceware.org, aravinda@...ux.vnet.ibm.com,
	penberg@....fi, brendan.d.gregg@...il.com,
	"yrl.pp-manager.tt@...achi.com" <yrl.pp-manager.tt@...achi.com>
Subject: Re: [RFC] perf-cache command interface design

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 <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>'

I'd prefer sub-command to option for this mandatory (and exclusive)
behavior.  What about like this?

  perf cache kprobe add [-m <module>] <spec> [<spec>...]
  perf cache kprobe del [<group>:]<event> [<event>...]
  perf cache kprobe list [-m <module>]

  perf cache uprobe add -x <path> <spec> [<spec>...]
  perf cache uprobe del [<group>:]<event> [<event>...]
  perf cache uprobe list [-x <path>]

  perf cache sdt [add|del|update] <file> [<file>...]
  perf cache sdt list [-b <build-id>] [<file>...]


> 
> 
> 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ