提交 dd004c47 编写于 作者: M Masami Hiramatsu 提交者: Ingo Molnar

kprobe-tracer: Compare both of event-name and event-group to find probe

Fix find_probe_event() to compare both of event-name and
event-group. Without this fix, kprobe-tracer overwrites existing
same event-name probe even if its group-name is different.
Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
LKML-Reference: <20091027204244.30545.27516.stgit@harusame>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 3f7e454a
...@@ -353,12 +353,14 @@ static void free_trace_probe(struct trace_probe *tp) ...@@ -353,12 +353,14 @@ static void free_trace_probe(struct trace_probe *tp)
kfree(tp); kfree(tp);
} }
static struct trace_probe *find_probe_event(const char *event) static struct trace_probe *find_probe_event(const char *event,
const char *group)
{ {
struct trace_probe *tp; struct trace_probe *tp;
list_for_each_entry(tp, &probe_list, list) list_for_each_entry(tp, &probe_list, list)
if (!strcmp(tp->call.name, event)) if (strcmp(tp->call.name, event) == 0 &&
strcmp(tp->call.system, group) == 0)
return tp; return tp;
return NULL; return NULL;
} }
...@@ -383,7 +385,7 @@ static int register_trace_probe(struct trace_probe *tp) ...@@ -383,7 +385,7 @@ static int register_trace_probe(struct trace_probe *tp)
mutex_lock(&probe_lock); mutex_lock(&probe_lock);
/* register as an event */ /* register as an event */
old_tp = find_probe_event(tp->call.name); old_tp = find_probe_event(tp->call.name, tp->call.system);
if (old_tp) { if (old_tp) {
/* delete old event */ /* delete old event */
unregister_trace_probe(old_tp); unregister_trace_probe(old_tp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册