From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26218 invoked by alias); 8 Nov 2014 04:38:49 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 26209 invoked by uid 89); 8 Nov 2014 04:38:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail9.hitachi.co.jp Received: from mail9.hitachi.co.jp (HELO mail9.hitachi.co.jp) (133.145.228.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Nov 2014 04:38:47 +0000 Received: from mlsv7.hitachi.co.jp (unknown [133.144.234.166]) by mail9.hitachi.co.jp (Postfix) with ESMTP id 133C937C82; Sat, 8 Nov 2014 13:38:45 +0900 (JST) Received: from mfilter03.hitachi.co.jp by mlsv7.hitachi.co.jp (8.13.1/8.13.1) id sA84cjbG016183; Sat, 8 Nov 2014 13:38:45 +0900 Received: from vshuts04.hitachi.co.jp (vshuts04.hitachi.co.jp [10.201.6.86]) by mfilter03.hitachi.co.jp (Switch-3.3.4/Switch-3.3.4) with ESMTP id sA84chtj024328; Sat, 8 Nov 2014 13:38:44 +0900 Received: from gxml20a.ad.clb.hitachi.co.jp (unknown [158.213.157.160]) by vshuts04.hitachi.co.jp (Postfix) with ESMTP id 5576914003B; Sat, 8 Nov 2014 13:38:43 +0900 (JST) Received: from [10.198.220.44] by gxml20a.ad.clb.hitachi.co.jp (Switch-3.1.10/Switch-3.1.9) id 6A843265M0000B8F4; Sat, 08 Nov 2014 13:38:42 +0900 Message-ID: <545D9E4F.9020607@hitachi.com> Date: Sat, 08 Nov 2014 04:38:00 -0000 From: Masami Hiramatsu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Namhyung Kim 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" Subject: Re: [RFC] perf-cache command interface design 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> <1415371407.1648.37.camel@leonhard> In-Reply-To: <1415371407.1648.37.camel@leonhard> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-q4/txt/msg00128.txt.bz2 (2014/11/07 23:43), Namhyung Kim wrote: > 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? I consider this will also confusing users because it's different from other subcommands. And Arnaldo gives us a better solution :) > > 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 ] Since perf has only "probe" subcommand, we shouldn't separate uprobe and kprobe. > > 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 Hmm, agreed. We'd better have this kind of provider index file to accelerate searching. > 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] Hmm, this is not good because this line will not be able to pass to tracing/uprobe_events... And also, I think we can compress this cache with gzip, then such redundancy will not be a problem. Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com