File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ struct tp_module {
64
64
bool trace_module_has_bad_taint (struct module * mod );
65
65
extern int register_tracepoint_module_notifier (struct notifier_block * nb );
66
66
extern int unregister_tracepoint_module_notifier (struct notifier_block * nb );
67
+ void for_each_module_tracepoint (void (* fct )(struct tracepoint * , void * ),
68
+ void * priv );
67
69
#else
68
70
static inline bool trace_module_has_bad_taint (struct module * mod )
69
71
{
@@ -79,6 +81,11 @@ int unregister_tracepoint_module_notifier(struct notifier_block *nb)
79
81
{
80
82
return 0 ;
81
83
}
84
+ static inline
85
+ void for_each_module_tracepoint (void (* fct )(struct tracepoint * , void * ),
86
+ void * priv )
87
+ {
88
+ }
82
89
#endif /* CONFIG_MODULES */
83
90
84
91
/*
Original file line number Diff line number Diff line change @@ -735,6 +735,27 @@ static __init int init_tracepoints(void)
735
735
return ret ;
736
736
}
737
737
__initcall (init_tracepoints );
738
+
739
+ /**
740
+ * for_each_module_tracepoint - iteration on all tracepoints in all modules
741
+ * @fct: callback
742
+ * @priv: private data
743
+ */
744
+ void for_each_module_tracepoint (void (* fct )(struct tracepoint * tp , void * priv ),
745
+ void * priv )
746
+ {
747
+ struct tp_module * tp_mod ;
748
+ struct module * mod ;
749
+
750
+ mutex_lock (& tracepoint_module_list_mutex );
751
+ list_for_each_entry (tp_mod , & tracepoint_module_list , list ) {
752
+ mod = tp_mod -> mod ;
753
+ for_each_tracepoint_range (mod -> tracepoints_ptrs ,
754
+ mod -> tracepoints_ptrs + mod -> num_tracepoints ,
755
+ fct , priv );
756
+ }
757
+ mutex_unlock (& tracepoint_module_list_mutex );
758
+ }
738
759
#endif /* CONFIG_MODULES */
739
760
740
761
/**
You can’t perform that action at this time.
0 commit comments