diff options
-rw-r--r-- | include/linux/module.h | 6 | ||||
-rw-r--r-- | include/trace/events/module.h | 14 | ||||
-rw-r--r-- | kernel/module.c | 3 |
3 files changed, 10 insertions, 13 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 5e869ffd34aa..393ec39b580a 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -460,8 +460,7 @@ static inline void __module_get(struct module *module) | |||
460 | if (module) { | 460 | if (module) { |
461 | preempt_disable(); | 461 | preempt_disable(); |
462 | __this_cpu_inc(module->refptr->count); | 462 | __this_cpu_inc(module->refptr->count); |
463 | trace_module_get(module, _THIS_IP_, | 463 | trace_module_get(module, _THIS_IP_); |
464 | __this_cpu_read(module->refptr->count)); | ||
465 | preempt_enable(); | 464 | preempt_enable(); |
466 | } | 465 | } |
467 | } | 466 | } |
@@ -475,8 +474,7 @@ static inline int try_module_get(struct module *module) | |||
475 | 474 | ||
476 | if (likely(module_is_live(module))) { | 475 | if (likely(module_is_live(module))) { |
477 | __this_cpu_inc(module->refptr->count); | 476 | __this_cpu_inc(module->refptr->count); |
478 | trace_module_get(module, _THIS_IP_, | 477 | trace_module_get(module, _THIS_IP_); |
479 | __this_cpu_read(module->refptr->count)); | ||
480 | } | 478 | } |
481 | else | 479 | else |
482 | ret = 0; | 480 | ret = 0; |
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 4b0f48ba16a6..a585f8135bd9 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
@@ -53,9 +53,9 @@ TRACE_EVENT(module_free, | |||
53 | 53 | ||
54 | DECLARE_EVENT_CLASS(module_refcnt, | 54 | DECLARE_EVENT_CLASS(module_refcnt, |
55 | 55 | ||
56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 56 | TP_PROTO(struct module *mod, unsigned long ip), |
57 | 57 | ||
58 | TP_ARGS(mod, ip, refcnt), | 58 | TP_ARGS(mod, ip), |
59 | 59 | ||
60 | TP_STRUCT__entry( | 60 | TP_STRUCT__entry( |
61 | __field( unsigned long, ip ) | 61 | __field( unsigned long, ip ) |
@@ -65,7 +65,7 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
65 | 65 | ||
66 | TP_fast_assign( | 66 | TP_fast_assign( |
67 | __entry->ip = ip; | 67 | __entry->ip = ip; |
68 | __entry->refcnt = refcnt; | 68 | __entry->refcnt = __this_cpu_read(mod->refptr->count); |
69 | __assign_str(name, mod->name); | 69 | __assign_str(name, mod->name); |
70 | ), | 70 | ), |
71 | 71 | ||
@@ -75,16 +75,16 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
75 | 75 | ||
76 | DEFINE_EVENT(module_refcnt, module_get, | 76 | DEFINE_EVENT(module_refcnt, module_get, |
77 | 77 | ||
78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 78 | TP_PROTO(struct module *mod, unsigned long ip), |
79 | 79 | ||
80 | TP_ARGS(mod, ip, refcnt) | 80 | TP_ARGS(mod, ip) |
81 | ); | 81 | ); |
82 | 82 | ||
83 | DEFINE_EVENT(module_refcnt, module_put, | 83 | DEFINE_EVENT(module_refcnt, module_put, |
84 | 84 | ||
85 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 85 | TP_PROTO(struct module *mod, unsigned long ip), |
86 | 86 | ||
87 | TP_ARGS(mod, ip, refcnt) | 87 | TP_ARGS(mod, ip) |
88 | ); | 88 | ); |
89 | 89 | ||
90 | TRACE_EVENT(module_request, | 90 | TRACE_EVENT(module_request, |
diff --git a/kernel/module.c b/kernel/module.c index c968d3606dca..21591ad921f3 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -800,8 +800,7 @@ void module_put(struct module *module) | |||
800 | preempt_disable(); | 800 | preempt_disable(); |
801 | __this_cpu_dec(module->refptr->count); | 801 | __this_cpu_dec(module->refptr->count); |
802 | 802 | ||
803 | trace_module_put(module, _RET_IP_, | 803 | trace_module_put(module, _RET_IP_); |
804 | __this_cpu_read(module->refptr->count)); | ||
805 | /* Maybe they're waiting for us to drop reference? */ | 804 | /* Maybe they're waiting for us to drop reference? */ |
806 | if (unlikely(!module_is_live(module))) | 805 | if (unlikely(!module_is_live(module))) |
807 | wake_up_process(module->waiter); | 806 | wake_up_process(module->waiter); |