Tracepoint cleanup: remove unused API functions
Mathieu Desnoyers
reviewerRFC PATCH 1/3 Tracepoint cleanup: remove unused API functions
After the following commit:
commit b75ef8b44b1cb95f5a26484b0e2fe37a63b12b44
Author: Mathieu Desnoyers <[email protected]> Date: Wed Aug 10 15:18:39 2011 -0400
Tracepoint: Dissociate from module mutex
The following functions became unnecessary:
- tracepoint_probe_register_noupdate,
- tracepoint_probe_unregister_noupdate,
- tracepoint_probe_update_all.
In fact, none of the in-kernel tracers, nor LTTng, nor SystemTAP use them. Remove those.
Moreover, the functions:
- tracepoint_iter_start,
- tracepoint_iter_next,
- tracepoint_iter_stop,
- tracepoint_iter_reset.
are unused by in-kernel tracers, LTTng and SystemTAP. Remove those too.
--- include/linux/tracepoint.h | 18 ----- kernel/tracepoint.c | 179 -------------------------------------------- 2 files changed, 197 deletions(-)
include/linux/tracepoint.h +0 -18
@@ -48,12 +48,6 @@ extern int tracepoint_probe_register(const char *name, void *probe, void *data);extern int tracepoint_probe_unregister (const char *name,void *probe,void *data); -extern int tracepoint_probe_register_noupdate (const char *name,void *probe, -void *data); -extern int tracepoint_probe_unregister_noupdate (const char *name,void *probe, -void *data); -extern void tracepoint_probe_update_all (void ); - #ifdef CONFIG_MODULES struct tp_module { struct list_head list;
@@ -68,18 +62,6 @@ static inline bool trace_module_has_bad_taint(struct module *mod) }#endif /* CONFIG_MODULES */ -struct tracepoint_iter { -#ifdef CONFIG_MODULES -struct tp_module *module; -#endif /* CONFIG_MODULES */ -struct tracepoint *const *tracepoint; -}; - -extern void tracepoint_iter_start (struct tracepoint_iter *iter); -extern void tracepoint_iter_next (struct tracepoint_iter *iter); -extern void tracepoint_iter_stop (struct tracepoint_iter *iter); -extern void tracepoint_iter_reset (struct tracepoint_iter *iter); -/* * tracepoint_synchronize_unregister must be called between the last tracepoint * probe unregistration and the end of module exit to make sure there is no
kernel/tracepoint.c +0 -179
185 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Mathieu Desnoyers
reviewerRFC PATCH 2/3 Tracepoint API doc update: data argument
Describe the @data argument (probe private data).
--- kernel/tracepoint.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/tracepoint.c +2 -0
@@ -373,6 +373,7 @@ tracepoint_add_probe(const char *name, void *probe, void *data)* tracepoint_probe_register - Connect a probe to a tracepoint * @name: tracepoint name * @probe: probe handler +* @data: probe private data * * Returns 0 if ok, error value on error. * The probe address must at least be aligned on the architecture pointer size.
@@ -415,6 +416,7 @@ tracepoint_remove_probe(const char *name, void *probe, void *data)* tracepoint_probe_unregister - Disconnect a probe from a tracepoint * @name: tracepoint name * @probe: probe function pointer +* @data: probe private data * * We do not need to call a synchronize_sched to make sure the probes have * finished running before doing a module unload, because the module unload
Signature · 1 line
1.7.10.4
Mathieu Desnoyers
reviewerRFC PATCH 3/3 Tracepoint: register/unregister struct tracepoint
In reply to Mathieu DesnoyersRegister/unregister tracepoint probes with struct tracepoint pointer rather than tracepoint name.
This change, which vastly simplifies tracepoint.c, has been proposed by Steven Rostedt.
Quoted 1 line
From this point on, the tracers need to pass a struct tracepoint pointer
to probe register/unregister. A probe can now only be connected to a tracepoint that exists. Moreover, tracers are responsible for unregistering the probe before the module containing its associated tracepoint is unloaded.
This patch is currently only compile-tested for kernel/tracepoint.o. The callers still need to be adapted.
--- include/linux/tracepoint.h | 7 +- kernel/tracepoint.c | 440 +++++++++++--------------------------------- 2 files changed, 116 insertions(+), 331 deletions(-)
include/linux/tracepoint.h +4 -3
@@ -39,14 +39,15 @@ struct tracepoint {* Connect a probe to a tracepoint. * Internal API, should not be used directly. */ -extern int tracepoint_probe_register (const char *name,void *probe,void *data); +extern int tracepoint_probe_register (struct tracepoint *tp,void *probe, +void *data);/* * Disconnect a probe from a tracepoint. * Internal API, should not be used directly. */ -extern int -tracepoint_probe_unregister (const char *name,void *probe,void *data); +extern int tracepoint_probe_unregister (struct tracepoint *tp,void *probe, +void *data);#ifdef CONFIG_MODULES struct tp_module {
kernel/tracepoint.c +112 -328
594 lines not on this page · raw message
Signature · 1 line
1.7.10.4