diff options
-rw-r--r-- | include/linux/tracepoint.h | 3 | ||||
-rw-r--r-- | kernel/tracepoint.c | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 08150e265761..69a298b07357 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -47,8 +47,7 @@ for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv), | |||
47 | #ifdef CONFIG_MODULES | 47 | #ifdef CONFIG_MODULES |
48 | struct tp_module { | 48 | struct tp_module { |
49 | struct list_head list; | 49 | struct list_head list; |
50 | unsigned int num_tracepoints; | 50 | struct module *mod; |
51 | struct tracepoint * const *tracepoints_ptrs; | ||
52 | }; | 51 | }; |
53 | 52 | ||
54 | bool trace_module_has_bad_taint(struct module *mod); | 53 | bool trace_module_has_bad_taint(struct module *mod); |
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index 01b3bd84daa1..162be198a247 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
@@ -374,8 +374,7 @@ static int tracepoint_module_coming(struct module *mod) | |||
374 | ret = -ENOMEM; | 374 | ret = -ENOMEM; |
375 | goto end; | 375 | goto end; |
376 | } | 376 | } |
377 | tp_mod->num_tracepoints = mod->num_tracepoints; | 377 | tp_mod->mod = mod; |
378 | tp_mod->tracepoints_ptrs = mod->tracepoints_ptrs; | ||
379 | list_add_tail(&tp_mod->list, &tracepoint_module_list); | 378 | list_add_tail(&tp_mod->list, &tracepoint_module_list); |
380 | blocking_notifier_call_chain(&tracepoint_notify_list, | 379 | blocking_notifier_call_chain(&tracepoint_notify_list, |
381 | MODULE_STATE_COMING, tp_mod); | 380 | MODULE_STATE_COMING, tp_mod); |
@@ -393,7 +392,7 @@ static void tracepoint_module_going(struct module *mod) | |||
393 | 392 | ||
394 | mutex_lock(&tracepoint_module_list_mutex); | 393 | mutex_lock(&tracepoint_module_list_mutex); |
395 | list_for_each_entry(tp_mod, &tracepoint_module_list, list) { | 394 | list_for_each_entry(tp_mod, &tracepoint_module_list, list) { |
396 | if (tp_mod->tracepoints_ptrs == mod->tracepoints_ptrs) { | 395 | if (tp_mod->mod == mod) { |
397 | blocking_notifier_call_chain(&tracepoint_notify_list, | 396 | blocking_notifier_call_chain(&tracepoint_notify_list, |
398 | MODULE_STATE_GOING, tp_mod); | 397 | MODULE_STATE_GOING, tp_mod); |
399 | list_del(&tp_mod->list); | 398 | list_del(&tp_mod->list); |
@@ -447,9 +446,9 @@ static __init int init_tracepoints(void) | |||
447 | int ret; | 446 | int ret; |
448 | 447 | ||
449 | ret = register_module_notifier(&tracepoint_module_nb); | 448 | ret = register_module_notifier(&tracepoint_module_nb); |
450 | if (ret) { | 449 | if (ret) |
451 | pr_warning("Failed to register tracepoint module enter notifier\n"); | 450 | pr_warning("Failed to register tracepoint module enter notifier\n"); |
452 | } | 451 | |
453 | return ret; | 452 | return ret; |
454 | } | 453 | } |
455 | __initcall(init_tracepoints); | 454 | __initcall(init_tracepoints); |