tracing: Fix compile error in module tracepoints when MODULE_UNLOAD not set

If modules are configured in the build but unloading of modules is not,
then the refcnt is not defined. Place the get/put module tracepoints
under CONFIG_MODULE_UNLOAD since it references this field in the module
structure.

As a side-effect, this patch also reduces the code when MODULE_UNLOAD
is not set, because these unused tracepoints are not created.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt
2010-03-29 14:25:18 -04:00
committed by Steven Rostedt
parent ae832d1e03
commit eb0c53771f
2 changed files with 7 additions and 2 deletions

View File

@@ -51,6 +51,9 @@ TRACE_EVENT(module_free,
TP_printk("%s", __get_str(name))
);
#ifdef CONFIG_MODULE_UNLOAD
/* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */
DECLARE_EVENT_CLASS(module_refcnt,
TP_PROTO(struct module *mod, unsigned long ip),
@@ -86,6 +89,7 @@ DEFINE_EVENT(module_refcnt, module_put,
TP_ARGS(mod, ip)
);
#endif /* CONFIG_MODULE_UNLOAD */
TRACE_EVENT(module_request,