lkml.org 
[lkml]   [2009]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tracing/kprobes 5/7] tracing/kprobes: Add argument name support
Steven Rostedt wrote:
> On Thu, 2009-09-10 at 19:53 -0400, Masami Hiramatsu wrote:
>
>> @@ -870,9 +892,13 @@ print_kprobe_event(struct trace_iterator *iter, int flags)
>> {
>> struct kprobe_trace_entry *field;
>> struct trace_seq *s =&iter->seq;
>> + struct trace_event *event;
>> + struct trace_probe *tp;
>> int i;
>>
>> field = (struct kprobe_trace_entry *)iter->ent;
>> + event = ftrace_find_event(field->ent.type);
>> + tp = container_of(event, struct trace_probe, event);
>
> Can this function be called the data is in the ring buffer, but the
> probe has been unregistered? If so, the result of ftrace_find_event be
> NULL?

Hmm, it will depend on ftrace implementation. Before releasing
trace_probe, kprobe tracer tries to unregister event call.
If it's correctly locking mutex or some rw_lock for both of
unregistering and printing, it will be safe.

Unfortunately, it seems not :-(.

In trace_events.c,
1054 static void __trace_remove_event_call(struct ftrace_event_call *call)
1055 {
1056 ftrace_event_enable_disable(call, 0);
1057 if (call->event)
1058 __unregister_ftrace_event(call->event);

What we need to do is calling unregister_ftrace_event() instead of
__unregister_ftrace_event.


Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



\
 
 \ /
  Last update: 2009-09-11 18:11    [W:0.264 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site