summaryrefslogtreecommitdiffstats
path: root/include/linux/tracepoint.h
diff options
context:
space:
mode:
authorZenghui Yu <yuzenghui@huawei.com>2018-11-27 22:35:23 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-11-29 22:08:38 -0500
commit0c7a52e4d4b5c4d35b31f3c3ad32af814f1bf491 (patch)
tree9a4f0aa2071f6b1561c3b0f8b382368ab49eb834 /include/linux/tracepoint.h
parent3054426dc68e5d63aa6a6e9b91ac4ec78e3f3805 (diff)
tracepoint: Use __idx instead of idx in DO_TRACE macro to make it unique
After enabling KVM event tracing, almost all of trace_kvm_exit()'s printk shows "kvm_exit: IRQ: ..." even if the actual exception_type is NOT IRQ. More specifically, trace_kvm_exit() is defined in virt/kvm/arm/trace.h by TRACE_EVENT. This slight problem may have existed after commit e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU"). There are two variables in trace_kvm_exit() and __DO_TRACE() which have the same name, *idx*. Thus the actual value of *idx* will be overwritten when tracing. Fix it by adding a simple prefix. Cc: Joel Fernandes <joel@joelfernandes.org> Cc: Wang Haibin <wanghaibin.wang@huawei.com> Cc: linux-trace-devel@vger.kernel.org Cc: stable@vger.kernel.org Fixes: e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU") Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/tracepoint.h')
-rw-r--r--include/linux/tracepoint.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 538ba1a58f5b..e9de8ad0bad7 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -166,7 +166,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
166 struct tracepoint_func *it_func_ptr; \ 166 struct tracepoint_func *it_func_ptr; \
167 void *it_func; \ 167 void *it_func; \
168 void *__data; \ 168 void *__data; \
169 int __maybe_unused idx = 0; \ 169 int __maybe_unused __idx = 0; \
170 \ 170 \
171 if (!(cond)) \ 171 if (!(cond)) \
172 return; \ 172 return; \
@@ -182,7 +182,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
182 * doesn't work from the idle path. \ 182 * doesn't work from the idle path. \
183 */ \ 183 */ \
184 if (rcuidle) { \ 184 if (rcuidle) { \
185 idx = srcu_read_lock_notrace(&tracepoint_srcu); \ 185 __idx = srcu_read_lock_notrace(&tracepoint_srcu);\
186 rcu_irq_enter_irqson(); \ 186 rcu_irq_enter_irqson(); \
187 } \ 187 } \
188 \ 188 \
@@ -198,7 +198,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
198 \ 198 \
199 if (rcuidle) { \ 199 if (rcuidle) { \
200 rcu_irq_exit_irqson(); \ 200 rcu_irq_exit_irqson(); \
201 srcu_read_unlock_notrace(&tracepoint_srcu, idx);\ 201 srcu_read_unlock_notrace(&tracepoint_srcu, __idx);\
202 } \ 202 } \
203 \ 203 \
204 preempt_enable_notrace(); \ 204 preempt_enable_notrace(); \