History

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.

Steven Rostedt committed 16 years ago

Commit eb0c5371 parent ae832d12 files · +7 −2Browse files

Unified · Split

2 files
  1. include/trace/events/module.h +4 −0
  2. kernel/module.c +3 −2
include/trace/events/module.h+4−0
@@ -51,6 +51,9 @@ TRACE_EVENT(module_free, · 50 unmodified lines
51 TP_printk("%s", __get_str(name))51 TP_printk("%s", __get_str(name))
52);52);
53 53
54#ifdef CONFIG_MODULE_UNLOAD
55/* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */
56
54DECLARE_EVENT_CLASS(module_refcnt,57DECLARE_EVENT_CLASS(module_refcnt,
55 58
56 TP_PROTO(struct module *mod, unsigned long ip),59 TP_PROTO(struct module *mod, unsigned long ip),
@@ -86,6 +89,7 @@ DEFINE_EVENT(module_refcnt, module_put, · 29 unmodified lines
86 89
87 TP_ARGS(mod, ip)90 TP_ARGS(mod, ip)
88);91);
92#endif /* CONFIG_MODULE_UNLOAD */
89 93
90TRACE_EVENT(module_request,94TRACE_EVENT(module_request,
91 95
kernel/module.c+3−2
@@ -59,8 +59,6 @@ · 58 unmodified lines
59#define CREATE_TRACE_POINTS59#define CREATE_TRACE_POINTS
60#include <trace/events/module.h>60#include <trace/events/module.h>
61 61
62EXPORT_TRACEPOINT_SYMBOL(module_get);
63
64#if 062#if 0
65#define DEBUGP printk63#define DEBUGP printk
66#else64#else
@@ -467,6 +465,9 @@ MODINFO_ATTR(srcversion); · 400 unmodified lines
467static char last_unloaded_module[MODULE_NAME_LEN+1];465static char last_unloaded_module[MODULE_NAME_LEN+1];
468 466
469#ifdef CONFIG_MODULE_UNLOAD467#ifdef CONFIG_MODULE_UNLOAD
468
469EXPORT_TRACEPOINT_SYMBOL(module_get);
470
470/* Init the unload section of the module. */471/* Init the unload section of the module. */
471static void module_unload_init(struct module *mod)472static void module_unload_init(struct module *mod)
472{473{