Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751671AbbDIF2C (ORCPT ); Thu, 9 Apr 2015 01:28:02 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:33839 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751293AbbDIF17 (ORCPT ); Thu, 9 Apr 2015 01:27:59 -0400 Message-ID: <55260DD8.50409@hitachi.com> Date: Thu, 09 Apr 2015 14:27:52 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: David Ahern , Jiri Olsa , Namhyung Kim , Ingo Molnar , Linux Kernel Mailing List Subject: Re: [RFE] perf probe: Support globbing/regex in -a References: <20150408194826.GI5403@kernel.org> In-Reply-To: <20150408194826.GI5403@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4833 Lines: 131 Hi Arnaldo, (2015/04/09 4:48), Arnaldo Carvalho de Melo wrote: > Hi Masami, > > In tools/perf constructors are named __new, and right now I want > to know hoe many of each objects are being allocated, so I expected to > be able to do: > > [root@zoo ~]# perf probe -x ~/bin/perf -a "*__new" > Probe point '*__new' not found. > Error: Failed to add events. > [root@zoo ~]# Actually, I had sent it :) https://lkml.org/lkml/2014/10/31/207 https://lkml.org/lkml/2014/10/31/213 I'll update and resend the wildcard support. > > And get the same result that I get from: > > [root@zoo ~]# perf probe -x ~/bin/perf `perf probe -x ~/bin/perf -F | grep __new | sed 's/^/-a /g' | sort -u` > Added new event: > probe_perf:call_path__new (on call_path__new in /home/acme/bin/perf) > > You can now use it in all perf tools, such as: > > perf record -e probe_perf:call_path__new -aR sleep 1 > > Added new event: > probe_perf:call_path_root__new (on call_path_root__new in /home/acme/bin/perf) > > You can now use it in all perf tools, such as: > > perf record -e probe_perf:call_path_root__new -aR sleep 1 > > Added new event: > probe_perf:call_return_processor__new (on call_return_processor__new in /home/acme/bin/perf) > > > > > I.e. that I end up with: > > [root@zoo ~]# perf probe -l 2>&1 | grep probe_perf:.*__new > probe_perf:call_path__new (on call_path__new@util/thread-stack.c in /home/acme/bin/perf) > probe_perf:call_path_root__new (on call_path_root__new@util/thread-stack.c in /home/acme/bin/perf) > probe_perf:call_return_processor__new (on call_return_processor__new@util/thread-stack.c in /home/acme/bin/perf) > probe_perf:comm__new (on comm__new@util/comm.c in /home/acme/bin/perf) > probe_perf:cpu_map__new (on cpu_map__new@util/cpumap.c in /home/acme/bin/perf) > probe_perf:debuginfo__new (on debuginfo__new@util/probe-finder.c in /home/acme/bin/perf) > probe_perf:disasm_line__new (on disasm_line__new@util/annotate.c in /home/acme/bin/perf) > probe_perf:dso__new (on dso__new@util/dso.c in /home/acme/bin/perf) > probe_perf:dso__new_map (on dso__new_map@util/dso.c in /home/acme/bin/perf) > probe_perf:fdarray__new (on fdarray__new@fd/array.c in /home/acme/bin/perf) > probe_perf:hist_browser__new (on hist_browser__new@ui/browsers/hists.c in /home/acme/bin/perf) > > probe_perf:thread_map__new_by_uid (on thread_map__new_by_uid@util/thread_map.c in /home/acme/bin/perf) > probe_perf:thread_map__new_dummy (on thread_map__new_dummy@util/thread_map.c in /home/acme/bin/perf) > probe_perf:thread_map__new_str (on thread_map__new_str@util/thread_map.c in /home/acme/bin/perf) > [root@zoo ~]# > > Some more goodies to have, please consider better compressing the output of successfully installed probes, > Something like: > > [root@zoo ~]# perf probe -x ~/bin/perf `perf probe -x ~/bin/perf -F | grep __new | sed 's/^/-a /g' | sort -u` > Added 46 new events: > probe_perf:call_path__new (on call_path__new in /home/acme/bin/perf) > probe_perf:call_path_root__new (on call_path_root__new in /home/acme/bin/perf) > probe_perf:call_return_processor__new (on call_return_processor__new in /home/acme/bin/perf) > > > You can now use them in all perf tools, e.g.: > > perf record -e probe_perf:call_path_root__new -aR sleep 1 > > ------ > > Also that -l should output to stdout, so that we can grep it, also it would be nice if it -l worked > like in perf list: > > [root@zoo ~]# perf probe -l probe_perf:* > Semantic error :There is non-digit char in line number. > Error: Command Parse Error. Hmm, right. This should be fixed. Thank you! > [root@zoo ~]# > > Fails, but: > > [root@zoo ~]# perf list *:*switch* > > List of pre-defined events (to be used in -e): > > cfg80211:cfg80211_ch_switch_notify [Tracepoint event] > cfg80211:rdev_channel_switch [Tracepoint event] > mac80211:api_chswitch_done [Tracepoint event] > mac80211:drv_channel_switch [Tracepoint event] > mac80211:drv_channel_switch_beacon [Tracepoint event] > mac80211:drv_switch_vif_chanctx [Tracepoint event] > sched:sched_switch [Tracepoint event] > > [root@zoo ~]# > > Works :-) > > - Arnaldo > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu.pt@hitachi.com -- 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/