From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Tom Zanussi <zanussi@kernel.org>,
Tzvetomir Stoyanov <tz.stoyanov@gmail.com>,
Yordan Karadzhov <y.karadz@gmail.com>
Subject: Re: [PATCH v2] tracing: Fix event probe removal from dynamic events
Date: Wed, 13 Oct 2021 23:42:06 +0900 [thread overview]
Message-ID: <20211013234206.37dd18ffcc2a2cbf4493f125@kernel.org> (raw)
In-Reply-To: <20211012200856.6e5b8f28@gandalf.local.home>
On Tue, 12 Oct 2021 20:08:56 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Wed, 13 Oct 2021 07:42:26 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > On Tue, 12 Oct 2021 12:03:10 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > On Tue, 12 Oct 2021 23:31:07 +0900
> > > Masami Hiramatsu <mhiramat@kernel.org> wrote:
> > >
> > > > Hmm, this seems something wrong. Via dynamic_events interface, all the
> > > > events must be parsed equaly. If you have to pass the attached "system/event"
> > > > that's something wrong. The dynamic_events interface will accept
> > > >
> > > > -:[GROUP/]EVENT [optional arguments]
> > > >
> > > > Or
> > > >
> > > > !e:[GROUP/]EVENT [optional arguments]
> > > >
> > > > What did you expect other that these syntax?
> > >
> > > But there are non "optional arguments".
> > >
> > > To create the event probe, we need to send:
> > >
> > > e:[GROUP/]EVENT system/event [optional arguments]
> > >
> > > Where the "system/event" is what we attach to. Similar to adding a function
> > > or address to kprobes. Do you not need to add that for deleting a kprobe?
> >
> > No, since if the GROUP name is given, we can identify the event.
> >
> > And sorry. I misunderstood your patch, simply I mixed the group/event is
> > the name of group/event or the attached group/event.
>
> The GROUP/EVENT is the name of the created eprobe, my "system/event" is the
> name of the probe being attached.
OK, I understand that.
>
> >
> > Actually, the dynamic_events delete command is something like wildcard
> > unless you specify the options.
>
> OK, so we need to update this a little bit more. But currently, it fails if
> you do:
>
> # echo 'e:hrstate timer/hrtimer_cancel state=+0x38($hrtimer):u8' >> dynamic_events
> # cat dynamic_events
> eprobes/hrstate timer.hrtimer_cancel state=+0x38($hrtimer):u8
BTW, Isn't there 'e:' prefix like below?
e:eprobes/hrstate timer.hrtimer_cancel state=+0x38($hrtimer):u8
> # echo '-:eprobes/hrstate timer.hrtimer_cancel state=+0x38($hrtimer):u8' >> dynamic_events
>
> It will error out with "-EBUSY".
That may be another reason. (Did you enable the eprobes/hrstate?)
If the event doesn't match, it will return -ENOENT.
>
> It would make sense if we echo in exactly what is in dynamic_events with
> "-:" in front of it it, that it will remove it. But currently, it expects:
>
> # echo '-:eprobes/hrstate state=+0x38($hrtimer):u8' >> dynamic_events
>
> Which is completely wrong.
Ah, I see what was wrong... you used trace_probe_match_command_args() but
didn't skip the attached system/event. Thus the patch check and skipped it.
> > > That is, if I create a kprobe with:
> > >
> > > p:myprobe schedule > dynamic_events
> > >
> > > To remove it, don't we need to have:
> > >
> > > -:myprobe schedule >> dynamic_events
> >
> > Yes, it is possible. But you can also do
> >
> > -:kprobes/myprobe >> dynamic_events
> >
> > So, the "schedule" trace point is optional.
> >
> > Anyway, let me comment on your patch again.
>
> OK, we can make it optional, but we need to fix it so that it also works.
Agreed.
Thank you,
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2021-10-13 14:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 12:19 Steven Rostedt
2021-10-12 14:31 ` Masami Hiramatsu
2021-10-12 16:03 ` Steven Rostedt
2021-10-12 22:42 ` Masami Hiramatsu
2021-10-13 0:08 ` Steven Rostedt
2021-10-13 14:42 ` Masami Hiramatsu [this message]
2021-10-13 16:53 ` Steven Rostedt
2021-10-12 22:46 ` Masami Hiramatsu
2021-10-13 0:15 ` Steven Rostedt
2021-10-13 14:32 ` Masami Hiramatsu
2021-10-13 15:09 ` Steven Rostedt
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=20211013234206.37dd18ffcc2a2cbf4493f125@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tz.stoyanov@gmail.com \
--cc=y.karadz@gmail.com \
--cc=zanussi@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
all inboxes | Powered by JetHome®