Commit 925684d6 authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

tracing: Convert module refcnt events to DEFINE_EVENT

Use DECLARE_EVENT_CLASS to remove duplicate code:

   text    data     bss     dec     hex filename
  29854    1980     128   31962    7cda kernel/module.o.old
  28750    1980     128   30858    788a kernel/module.o

Two events are converted:

  module_refcnt: module_get, module_put

No change in functionality.
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4B0E283B.3010508@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 091ad365
...@@ -51,7 +51,7 @@ TRACE_EVENT(module_free, ...@@ -51,7 +51,7 @@ TRACE_EVENT(module_free,
TP_printk("%s", __get_str(name)) TP_printk("%s", __get_str(name))
); );
TRACE_EVENT(module_get, DECLARE_EVENT_CLASS(module_refcnt,
TP_PROTO(struct module *mod, unsigned long ip, int refcnt), TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
...@@ -73,26 +73,18 @@ TRACE_EVENT(module_get, ...@@ -73,26 +73,18 @@ TRACE_EVENT(module_get,
__get_str(name), (void *)__entry->ip, __entry->refcnt) __get_str(name), (void *)__entry->ip, __entry->refcnt)
); );
TRACE_EVENT(module_put, DEFINE_EVENT(module_refcnt, module_get,
TP_PROTO(struct module *mod, unsigned long ip, int refcnt), TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
TP_ARGS(mod, ip, refcnt), TP_ARGS(mod, ip, refcnt)
);
TP_STRUCT__entry( DEFINE_EVENT(module_refcnt, module_put,
__field( unsigned long, ip )
__field( int, refcnt )
__string( name, mod->name )
),
TP_fast_assign( TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
__entry->ip = ip;
__entry->refcnt = refcnt;
__assign_str(name, mod->name);
),
TP_printk("%s call_site=%pf refcnt=%d", TP_ARGS(mod, ip, refcnt)
__get_str(name), (void *)__entry->ip, __entry->refcnt)
); );
TRACE_EVENT(module_request, TRACE_EVENT(module_request,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment