diff options
Diffstat (limited to 'include/trace/events/module.h')
-rw-r--r-- | include/trace/events/module.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 4b0f48ba16a6..c7bb2f0482fe 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
@@ -51,11 +51,14 @@ TRACE_EVENT(module_free, | |||
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 | |||
54 | DECLARE_EVENT_CLASS(module_refcnt, | 57 | DECLARE_EVENT_CLASS(module_refcnt, |
55 | 58 | ||
56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 59 | TP_PROTO(struct module *mod, unsigned long ip), |
57 | 60 | ||
58 | TP_ARGS(mod, ip, refcnt), | 61 | TP_ARGS(mod, ip), |
59 | 62 | ||
60 | TP_STRUCT__entry( | 63 | TP_STRUCT__entry( |
61 | __field( unsigned long, ip ) | 64 | __field( unsigned long, ip ) |
@@ -65,7 +68,7 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
65 | 68 | ||
66 | TP_fast_assign( | 69 | TP_fast_assign( |
67 | __entry->ip = ip; | 70 | __entry->ip = ip; |
68 | __entry->refcnt = refcnt; | 71 | __entry->refcnt = __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs); |
69 | __assign_str(name, mod->name); | 72 | __assign_str(name, mod->name); |
70 | ), | 73 | ), |
71 | 74 | ||
@@ -75,17 +78,18 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
75 | 78 | ||
76 | DEFINE_EVENT(module_refcnt, module_get, | 79 | DEFINE_EVENT(module_refcnt, module_get, |
77 | 80 | ||
78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 81 | TP_PROTO(struct module *mod, unsigned long ip), |
79 | 82 | ||
80 | TP_ARGS(mod, ip, refcnt) | 83 | TP_ARGS(mod, ip) |
81 | ); | 84 | ); |
82 | 85 | ||
83 | DEFINE_EVENT(module_refcnt, module_put, | 86 | DEFINE_EVENT(module_refcnt, module_put, |
84 | 87 | ||
85 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 88 | TP_PROTO(struct module *mod, unsigned long ip), |
86 | 89 | ||
87 | TP_ARGS(mod, ip, refcnt) | 90 | TP_ARGS(mod, ip) |
88 | ); | 91 | ); |
92 | #endif /* CONFIG_MODULE_UNLOAD */ | ||
89 | 93 | ||
90 | TRACE_EVENT(module_request, | 94 | TRACE_EVENT(module_request, |
91 | 95 | ||