Commit eb0c5377 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

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: default avatarSteven Rostedt <rostedt@goodmis.org>
parent ae832d1e
...@@ -51,6 +51,9 @@ TRACE_EVENT(module_free, ...@@ -51,6 +51,9 @@ TRACE_EVENT(module_free,
TP_printk("%s", __get_str(name)) 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, DECLARE_EVENT_CLASS(module_refcnt,
TP_PROTO(struct module *mod, unsigned long ip), TP_PROTO(struct module *mod, unsigned long ip),
...@@ -86,6 +89,7 @@ DEFINE_EVENT(module_refcnt, module_put, ...@@ -86,6 +89,7 @@ DEFINE_EVENT(module_refcnt, module_put,
TP_ARGS(mod, ip) TP_ARGS(mod, ip)
); );
#endif /* CONFIG_MODULE_UNLOAD */
TRACE_EVENT(module_request, TRACE_EVENT(module_request,
......
...@@ -59,8 +59,6 @@ ...@@ -59,8 +59,6 @@
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include <trace/events/module.h> #include <trace/events/module.h>
EXPORT_TRACEPOINT_SYMBOL(module_get);
#if 0 #if 0
#define DEBUGP printk #define DEBUGP printk
#else #else
...@@ -467,6 +465,9 @@ MODINFO_ATTR(srcversion); ...@@ -467,6 +465,9 @@ MODINFO_ATTR(srcversion);
static char last_unloaded_module[MODULE_NAME_LEN+1]; static char last_unloaded_module[MODULE_NAME_LEN+1];
#ifdef CONFIG_MODULE_UNLOAD #ifdef CONFIG_MODULE_UNLOAD
EXPORT_TRACEPOINT_SYMBOL(module_get);
/* Init the unload section of the module. */ /* Init the unload section of the module. */
static void module_unload_init(struct module *mod) static void module_unload_init(struct module *mod)
{ {
......
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