aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-10-27 16:42:44 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-29 03:47:47 -0400
commitdd004c475cd15a5749b04b0283d41ffdfa57d658 (patch)
treee5656577b7a2805ed99dfaf6a966756568c6390d
parent3f7e454af1dd8b9cea410d9380d3f71477e94f2b (diff)
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: Masami 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: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/trace/trace_kprobe.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index b8ef707c84d7..a86c3ac0df21 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -353,12 +353,14 @@ static void free_trace_probe(struct trace_probe *tp)
353 kfree(tp); 353 kfree(tp);
354} 354}
355 355
356static struct trace_probe *find_probe_event(const char *event) 356static struct trace_probe *find_probe_event(const char *event,
357 const char *group)
357{ 358{
358 struct trace_probe *tp; 359 struct trace_probe *tp;
359 360
360 list_for_each_entry(tp, &probe_list, list) 361 list_for_each_entry(tp, &probe_list, list)
361 if (!strcmp(tp->call.name, event)) 362 if (strcmp(tp->call.name, event) == 0 &&
363 strcmp(tp->call.system, group) == 0)
362 return tp; 364 return tp;
363 return NULL; 365 return NULL;
364} 366}
@@ -383,7 +385,7 @@ static int register_trace_probe(struct trace_probe *tp)
383 mutex_lock(&probe_lock); 385 mutex_lock(&probe_lock);
384 386
385 /* register as an event */ 387 /* register as an event */
386 old_tp = find_probe_event(tp->call.name); 388 old_tp = find_probe_event(tp->call.name, tp->call.system);
387 if (old_tp) { 389 if (old_tp) {
388 /* delete old event */ 390 /* delete old event */
389 unregister_trace_probe(old_tp); 391 unregister_trace_probe(old_tp);