From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf probe: fix module name matching
Date: Mon, 8 Aug 2016 16:34:00 -0300 [thread overview]
Message-ID: <20160808193400.GB3192@kernel.org> (raw)
In-Reply-To: <20160805211729.c0358de5d225f09050c57bbc@kernel.org>
Em Fri, Aug 05, 2016 at 09:17:29PM +0900, Masami Hiramatsu escreveu:
> On Fri, 05 Aug 2016 12:41:03 +0300
> Konstantin Khlebnikov <khlebnikov@yandex-team.ru> wrote:
>
> > If module is "module" then dso->short_name is "[module]".
> > Substring comparing is't enough: "raid10" matches to "[raid1]".
> > This patch also checks terminating zero in module name.
>
> Right, just one comment on this patch.
>
> >
> > Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> > ---
> > tools/perf/util/probe-event.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> > index 953dc1ab2ed7..c27b7aca4a6d 100644
> > --- a/tools/perf/util/probe-event.c
> > +++ b/tools/perf/util/probe-event.c
> > @@ -170,8 +170,10 @@ static struct map *kernel_get_module_map(const char *module)
> > module = "kernel";
> >
> > for (pos = maps__first(maps); pos; pos = map__next(pos)) {
> > + /* short_name is "[module]" */
> > if (strncmp(pos->dso->short_name + 1, module,
> > - pos->dso->short_name_len - 2) == 0) {
> > + pos->dso->short_name_len - 2) == 0 &&
> > + module[pos->dso->short_name_len - 2] == 0) {
>
> Here, please use '\0' instead of 0, because "module" should points a null
> terminated string.
I can do this myself, with that, can I have your Acked-by?
> Thanks,
>
> > return pos;
> > }
> > }
> >
>
>
> --
> Masami Hiramatsu <mhiramat@kernel.org>
prev parent reply other threads:[~2016-08-08 19:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 9:41 [PATCH] perf probe: fix module name matching Konstantin Khlebnikov
2016-08-05 12:17 ` Masami Hiramatsu
2016-08-08 19:34 ` Arnaldo Carvalho de Melo [this message]
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=20160808193400.GB3192@kernel.org \
--to=acme@kernel.org \
--cc=khlebnikov@yandex-team.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).