lkml.org 
[lkml]   [2010]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 03/11] tracing: Inject lock_class_init events on registration
From
Date
On Wed, 2010-02-03 at 10:14 +0100, Frederic Weisbecker wrote:

> static inline void lockdep_off(void)
> diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h
> index 90af03c..6999f16 100644
> --- a/include/trace/events/lock.h
> +++ b/include/trace/events/lock.h
> @@ -9,7 +9,7 @@
>
> #ifdef CONFIG_LOCKDEP
>
> -TRACE_EVENT(lock_class_init,
> +TRACE_EVENT_INJECT(lock_class_init,
>
> TP_PROTO(struct lock_class *class),
>
> @@ -30,7 +30,14 @@ TRACE_EVENT(lock_class_init,
> __entry->class_id = (void *)class->name;
> ),
>
> - TP_printk("%p %s", __entry->class_id, __get_str(class_name))
> + TP_printk("%p %s", __entry->class_id, __get_str(class_name)),
> +
> + /*
> + * On activation, we want to send an event for each lock
> + * classes that have been recorded by lockdep, so that we
> + * catch up with the existing class:name mappings.
> + */
> + lock_class_init_inject_events
> );
>

I also suggested this type of registering:

register_event_callback("event", "command", command_func,
command_enable_func,
command_disable_func);

Where command_func, command_enable_func and command_disable_func can all
be a function pointer or NULL.

command_func gets called every time the event is hit while enabled.

command_enable_func gets called when the event is enabled

command_disable_func gets called when the event is disabled.

Hmm,

I could make it so that if the string "command" is NULL that these
functions are registered permanent, and can not be disabled by the user?
Otherwise, the user needs to set them with "echo command > command"

-- Steve




\
 
 \ /
  Last update: 2010-02-05 15:15    [W:0.114 / U:3.424 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site