[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210819125652.bb6b980cf0ef04e0158bc564@kernel.org>
Date: Thu, 19 Aug 2021 12:56:52 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Tzvetomir Stoyanov" <tz.stoyanov@...il.com>,
Tom Zanussi <zanussi@...nel.org>,
linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH v6 7/7] tracing: Add a probe that attaches to trace
events
On Wed, 18 Aug 2021 23:37:57 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> > Here, you don't check the event name collision. Since the kprobe event
> > supports multiprobe event, it checks the collision by itself.
> > See register_trace_kprobe().
> > BTW, I found another issue on the name collision. Let me fix it.
>
> I'm thinking of adding this above before taking the event_mutex:
>
> /* Check if the name already exists */
> if (find_event_probe(group, event))
> return -EEXIST;
>
> Where I have:
>
> static bool find_event_probe(const char *group, const char *event)
> {
> struct dyn_event *ev;
> struct trace_eprobe *ep;
>
> for_each_dyn_event(ev) {
> if (ev->ops != &eprobe_dyn_event_ops)
> continue;
>
> ep = to_trace_eprobe(ev);
> if (strcmp(ep->tp.event->class.system, group) == 0 &&
> strcmp(ep->tp.event->call.name, event) == 0)
> return true;
> }
> return false;
> }
Yeah, but I think this should be done with event_mutex, shouldn't it?
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists