linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Shuah Khan <shuah@kernel.org>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/4] selftests/ftrace: Add a test to probe module functions
Date: Mon, 3 Jul 2017 12:51:09 +0900	[thread overview]
Message-ID: <20170703125109.191c52bdc0495cc41e742d84@kernel.org> (raw)
In-Reply-To: <20170703122733.e0f7043415e495352c0a12a9@kernel.org>

On Mon, 3 Jul 2017 12:27:33 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Thu, 29 Jun 2017 19:05:37 +0530
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:
> 
> > Add a kprobes test to ensure that we are able to add a probe on a
> > module function using 'p <mod>:<func>' format, without having to
> > specify a probe name.
> > 
> > Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
> > Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
> > Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> > ---
> >  .../testing/selftests/ftrace/test.d/kprobe/probe_module.tc | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >  create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/probe_module.tc
> > 
> > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/probe_module.tc b/tools/testing/selftests/ftrace/test.d/kprobe/probe_module.tc
> > new file mode 100644
> > index 000000000000..ea7657041ba6
> > --- /dev/null
> > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/probe_module.tc
> > @@ -0,0 +1,14 @@
> > +#!/bin/sh
> > +# description: Kprobe dynamic event - probing module
> > +
> > +[ -f kprobe_events ] || exit_unsupported # this is configurable
> > +
> > +echo 0 > events/enable
> > +echo > kprobe_events
> > +export MOD=`lsmod | head -n 2 | tail -n 1 | cut -f1 -d" "`
> > +export FUNC=`grep -m 1 ".* t .*\\[$MOD\\]" /proc/kallsyms | xargs | cut -f3 -d" "`
> > +[ "x" != "x$MOD" -a "y" != "y$FUNC" ] || exit_untested
> 
> Could you also add below case?
> 
> echo p:probe_$MOD/$FUNC $MOD/$FUNC > kprobe_events 

Oops, it should be something like

echo "p:test_${MOD}_${FUNC} $MOD/$FUNC" > kprobe_events

since we would like to avoid adding new group name for it.

(Adding new group name should be a separated one.)

Thank you,

> 
> This is for "new event with name on module" case, your one is for "new event without name on module (automatic name generation)"
> 
> We should have different test case, because those kicks slightly different parts in kprobe tracer.
> 
> Thank you,
> 
> > +echo p $MOD:$FUNC > kprobe_events
> > +grep $MOD kprobe_events
> > +echo > kprobe_events
> > +clear_trace
> > -- 
> > 2.13.1
> > 
> 
> 
> -- 
> Masami Hiramatsu <mhiramat@kernel.org>


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2017-07-03  3:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 13:35 [PATCH v2 0/4] A fix and a few new tests for kprobe tracer Naveen N. Rao
2017-06-29 13:35 ` [PATCH v2 1/4] trace/kprobes: Sanitize derived event names Naveen N. Rao
2017-06-29 13:35 ` [PATCH v2 2/4] selftests/ftrace: Add a test to probe module functions Naveen N. Rao
2017-07-03  3:27   ` Masami Hiramatsu
2017-07-03  3:51     ` Masami Hiramatsu [this message]
2017-07-07 16:09       ` Naveen N. Rao
2017-06-29 13:35 ` [PATCH v2 3/4] selftests/ftrace: Update multiple kprobes test for powerpc Naveen N. Rao
2017-07-03  3:28   ` Masami Hiramatsu
2017-06-29 13:35 ` [PATCH v2 4/4] selftests/ftrace: Add a testcase for kprobe event naming Naveen N. Rao
2017-07-03  3:38   ` Masami Hiramatsu

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=20170703125109.191c52bdc0495cc41e742d84@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=shuah@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).