[patch 11/16] Tracepoint Use Unregister Return Value

Mathieu Desnoyers
2008-11-14T23:01:29Z

[-- Attachment #1: tracepoint-use-unregister-return-value.patch --]
[-- Type: text/plain, Size: 1531 bytes --]

Unregistering a tracepoint can fail. Return the error value.

Impact: bugfix.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: 'Ingo Molnar' <mingo@elte.hu>
CC: Lai Jiangshan <laijs@cn.fujitsu.com>
---
include/linux/tracepoint.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6-lttng/include/linux/tracepoint.h
===================================================================
--- linux-2.6-lttng.orig/include/linux/tracepoint.h 2008-09-19 22:40:43.000000000 -0400
+++ linux-2.6-lttng/include/linux/tracepoint.h 2008-09-19 23:03:20.000000000 -0400
@@ -73,9 +73,9 @@ struct tracepoint {
return tracepoint_probe_register(#name ":" #proto, \
(void *)probe); \
} \
- static inline void unregister_trace_##name(void (*probe)(proto))\
+ static inline int unregister_trace_##name(void (*probe)(proto)) \
{ \
- tracepoint_probe_unregister(#name ":" #proto, \
+ return tracepoint_probe_unregister(#name ":" #proto, \
(void *)probe); \
}

@@ -92,8 +92,10 @@ extern void tracepoint_update_probe_rang
{ \
return -ENOSYS; \
} \
- static inline void unregister_trace_##name(void (*probe)(proto))\
- { }
+ static inline int unregister_trace_##name(void (*probe)(proto)) \
+ { \
+ return -ENOSYS; \
+ }

static inline void tracepoint_update_probe_range(struct tracepoint *begin,
struct tracepoint *end)