提交 ae832d1e 编写于 作者: L Li Zefan 提交者: Steven Rostedt

tracing: Remove side effect from module tracepoints that caused a GPF

Remove the @refcnt argument, because it has side-effects, and arguments with
side-effects are not skipped by the jump over disabled instrumentation and are
executed even when the tracepoint is disabled.

This was also causing a GPF as found by Randy Dunlap:

Subject: 2.6.33 GP fault only when built with tracing
LKML-Reference: <4BA2B69D.3000309@oracle.com>

Note, the current 2.6.34-rc has a fix for the actual cause of the GPF,
but this fixes one of its triggers.
Tested-by: NRandy Dunlap <randy.dunlap@oracle.com>
Acked-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4BA97FA7.6040406@cn.fujitsu.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 50354a8a
...@@ -460,8 +460,7 @@ static inline void __module_get(struct module *module) ...@@ -460,8 +460,7 @@ static inline void __module_get(struct module *module)
if (module) { if (module) {
preempt_disable(); preempt_disable();
__this_cpu_inc(module->refptr->count); __this_cpu_inc(module->refptr->count);
trace_module_get(module, _THIS_IP_, trace_module_get(module, _THIS_IP_);
__this_cpu_read(module->refptr->count));
preempt_enable(); preempt_enable();
} }
} }
...@@ -475,8 +474,7 @@ static inline int try_module_get(struct module *module) ...@@ -475,8 +474,7 @@ static inline int try_module_get(struct module *module)
if (likely(module_is_live(module))) { if (likely(module_is_live(module))) {
__this_cpu_inc(module->refptr->count); __this_cpu_inc(module->refptr->count);
trace_module_get(module, _THIS_IP_, trace_module_get(module, _THIS_IP_);
__this_cpu_read(module->refptr->count));
} }
else else
ret = 0; ret = 0;
......
...@@ -53,9 +53,9 @@ TRACE_EVENT(module_free, ...@@ -53,9 +53,9 @@ TRACE_EVENT(module_free,
DECLARE_EVENT_CLASS(module_refcnt, DECLARE_EVENT_CLASS(module_refcnt,
TP_PROTO(struct module *mod, unsigned long ip, int refcnt), TP_PROTO(struct module *mod, unsigned long ip),
TP_ARGS(mod, ip, refcnt), TP_ARGS(mod, ip),
TP_STRUCT__entry( TP_STRUCT__entry(
__field( unsigned long, ip ) __field( unsigned long, ip )
...@@ -65,7 +65,7 @@ DECLARE_EVENT_CLASS(module_refcnt, ...@@ -65,7 +65,7 @@ DECLARE_EVENT_CLASS(module_refcnt,
TP_fast_assign( TP_fast_assign(
__entry->ip = ip; __entry->ip = ip;
__entry->refcnt = refcnt; __entry->refcnt = __this_cpu_read(mod->refptr->count);
__assign_str(name, mod->name); __assign_str(name, mod->name);
), ),
...@@ -75,16 +75,16 @@ DECLARE_EVENT_CLASS(module_refcnt, ...@@ -75,16 +75,16 @@ DECLARE_EVENT_CLASS(module_refcnt,
DEFINE_EVENT(module_refcnt, module_get, DEFINE_EVENT(module_refcnt, module_get,
TP_PROTO(struct module *mod, unsigned long ip, int refcnt), TP_PROTO(struct module *mod, unsigned long ip),
TP_ARGS(mod, ip, refcnt) TP_ARGS(mod, ip)
); );
DEFINE_EVENT(module_refcnt, module_put, DEFINE_EVENT(module_refcnt, module_put,
TP_PROTO(struct module *mod, unsigned long ip, int refcnt), TP_PROTO(struct module *mod, unsigned long ip),
TP_ARGS(mod, ip, refcnt) TP_ARGS(mod, ip)
); );
TRACE_EVENT(module_request, TRACE_EVENT(module_request,
......
...@@ -800,8 +800,7 @@ void module_put(struct module *module) ...@@ -800,8 +800,7 @@ void module_put(struct module *module)
preempt_disable(); preempt_disable();
__this_cpu_dec(module->refptr->count); __this_cpu_dec(module->refptr->count);
trace_module_put(module, _RET_IP_, trace_module_put(module, _RET_IP_);
__this_cpu_read(module->refptr->count));
/* Maybe they're waiting for us to drop reference? */ /* Maybe they're waiting for us to drop reference? */
if (unlikely(!module_is_live(module))) if (unlikely(!module_is_live(module)))
wake_up_process(module->waiter); wake_up_process(module->waiter);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册