tracepoints: Code clean up
Steven Rostedt
maintainerPATCH v2 1/1 tracepoints: Code clean up
From: "Steven Rostedt (VMware)" <[email protected]>
Restructure the code a bit to make it simpler, fix some formatting problems and add READ_ONCE/WRITE_ONCE to make sure there's no compiler load/store tearing to the variables that can be accessed across CPUs.
Started with Mathieu Desnoyers's patch:
And will keep his signature, but I will take the responsibility of this being correct, and keep the authorship.
Signed-off-by Mathieu Desnoyers <[email protected]>
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- include/linux/tracepoint.h | 2 +- kernel/tracepoint.c | 91 +++++++++++++++----------------------- 2 files changed, 36 insertions(+), 57 deletions(-)
include/linux/tracepoint.h +1 -1
@@ -309,7 +309,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) rcu_dereference_raw((&__tracepoint_##_name)->funcs); \if (it_func_ptr) { \do { \ - it_func = (it_func_ptr)->func; \ + it_func =READ_ONCE ((it_func_ptr)->func); \ __data = (it_func_ptr)->data; \ ((void (*)(void *,proto ))(it_func))(__data, args); \ }while ((++it_func_ptr)->func); \
kernel/tracepoint.c +35 -56
126 lines not on this page · raw message
Signature · 1 line
2.25.4