From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Wang Nan <wangnan0@huawei.com>,
a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
namhyung@kernel.org, lizefan@huawei.com, pi3orama@163.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH tip/perf/core] perf probe: Load map before glob matching
Date: Tue, 19 May 2015 10:46:25 -0300 [thread overview]
Message-ID: <20150519134625.GD13946@kernel.org> (raw)
In-Reply-To: <555A78AA.1040406@hitachi.com>
Em Tue, May 19, 2015 at 08:41:30AM +0900, Masami Hiramatsu escreveu:
> On 2015/05/18 22:17, Arnaldo Carvalho de Melo wrote:
> > Em Sat, May 16, 2015 at 09:10:59PM +0900, Masami Hiramatsu escreveu:
> >> On 2015/05/16 5:07, Arnaldo Carvalho de Melo wrote:
> >> OK, then I'm OK for this patch.
> >
> > Ok, tranforming the above statement into an Acked-by, ok?
>
> Yes, here is my ack :)
>
> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>
>
> And also, I've found that including map__load() in map__for_each_symbol()
> is not good idea. Also I think map__for_each_symbol_by_name() should
> not call map__load(), since the "filter" argument will be ignored if
> the map is already loaded. This means that the iterated elements can
> be changed.
> So, obviously the map should be loaded before calling map__for_each_XXX.
Right, agreed with your comments, and that filter thing needs moving to
some other suitable place, like setting a filter at symbol system start,
etc.
- Arnaldo
> Thank you,
>
> >
> >> Thank you,
> >>
> >>>
> >>> - Arnaldo
> >>>
> >>>> Thank you,
> >>>>
> >>>>>
> >>>>> This patch ensures map__load() is called before using
> >>>>> map__for_each_symbol().
> >>>>>
> >>>>> After this patch:
> >>>>>
> >>>>> # /root/perf probe kmem_cache_free
> >>>>> Added new event:
> >>>>> probe:kmem_cache_free (on kmem_cache_free%return)
> >>>>>
> >>>>> You can now use it in all perf tools, such as:
> >>>>>
> >>>>> perf record -e probe:kmem_cache_free -aR sleep 1
> >>>>>
> >>>>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> >>>>> ---
> >>>>> tools/perf/util/probe-event.c | 3 +++
> >>>>> 1 file changed, 3 insertions(+)
> >>>>>
> >>>>> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> >>>>> index 2399dc4..1faa1e6 100644
> >>>>> --- a/tools/perf/util/probe-event.c
> >>>>> +++ b/tools/perf/util/probe-event.c
> >>>>> @@ -2499,6 +2499,9 @@ static int find_probe_functions(struct map *map, char *name)
> >>>>> struct symbol *sym;
> >>>>> struct rb_node *tmp;
> >>>>>
> >>>>> + if (map__load(map, NULL) < 0)
> >>>>> + return 0;
> >>>>> +
> >>>>> map__for_each_symbol(map, sym, tmp) {
> >>>>> if (strglobmatch(sym->name, name))
> >>>>> found++;
> >>>>>
> >>>>
> >> --
> >> 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
> >
>
>
> --
> 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
next prev parent reply other threads:[~2015-05-19 13:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 12:14 [PATCH tip/perf/core] perf probe: Load map before glob matching Wang Nan
2015-05-15 15:15 ` Masami Hiramatsu
2015-05-15 20:07 ` Arnaldo Carvalho de Melo
2015-05-16 12:10 ` Masami Hiramatsu
2015-05-18 13:17 ` Arnaldo Carvalho de Melo
2015-05-18 23:41 ` Masami Hiramatsu
2015-05-19 13:46 ` Arnaldo Carvalho de Melo [this message]
2015-05-20 12:23 ` [tip:perf/core] " tip-bot for Wang Nan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150519134625.GD13946@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox