X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-probes.c;h=0385a79cdf94d780b6ca0b88809b263fb3e0296b;hb=refs%2Fheads%2Fstable-2.7;hp=d2723969ef7d887d818ce670a2ad8218aba46a45;hpb=3c9970797850893aaf1b9019d21868d73580e17d;p=lttng-modules.git diff --git a/lttng-probes.c b/lttng-probes.c index d2723969..0385a79c 100644 --- a/lttng-probes.c +++ b/lttng-probes.c @@ -60,6 +60,14 @@ int check_event_provider(struct lttng_probe_desc *desc) desc->provider, provider_name_len)) return 0; /* provider mismatch */ + /* + * The event needs to contain at least provider name + _ + + * one or more letter. + */ + if (strlen(desc->event_desc[i]->name) <= provider_name_len + 1) + return 0; /* provider mismatch */ + if (desc->event_desc[i]->name[provider_name_len] != '_') + return 0; /* provider mismatch */ } return 1; } @@ -103,7 +111,7 @@ void lttng_lazy_probe_register(struct lttng_probe_desc *desc) /* We should be added at the head of the list */ list_add(&desc->head, probe_list); desc_added: - printk(KERN_DEBUG "just registered probe %s containing %u events\n", + pr_debug("LTTng: just registered probe %s containing %u events\n", desc->provider, desc->nr_events); } @@ -167,7 +175,7 @@ int lttng_probe_register(struct lttng_probe_desc *desc) } list_add(&desc->lazy_init_head, &lazy_probe_init); desc->lazy = 1; - printk(KERN_DEBUG "adding probe %s containing %u events to lazy registration list\n", + pr_debug("LTTng: adding probe %s containing %u events to lazy registration list\n", desc->provider, desc->nr_events); /* * If there is at least one active session, we need to register @@ -189,7 +197,7 @@ void lttng_probe_unregister(struct lttng_probe_desc *desc) list_del(&desc->head); else list_del(&desc->lazy_init_head); - printk(KERN_DEBUG "just unregistered probe %s\n", desc->provider); + pr_debug("LTTng: just unregistered probe %s\n", desc->provider); lttng_unlock_sessions(); } EXPORT_SYMBOL_GPL(lttng_probe_unregister); @@ -243,10 +251,12 @@ static void *tp_list_start(struct seq_file *m, loff_t *pos) { struct lttng_probe_desc *probe_desc; + struct list_head *probe_list; int iter = 0, i; lttng_lock_sessions(); - list_for_each_entry(probe_desc, &_probe_list, head) { + probe_list = lttng_get_probe_list_head(); + list_for_each_entry(probe_desc, probe_list, head) { for (i = 0; i < probe_desc->nr_events; i++) { if (iter++ >= *pos) return (void *) probe_desc->event_desc[i]; @@ -260,10 +270,12 @@ static void *tp_list_next(struct seq_file *m, void *p, loff_t *ppos) { struct lttng_probe_desc *probe_desc; + struct list_head *probe_list; int iter = 0, i; (*ppos)++; - list_for_each_entry(probe_desc, &_probe_list, head) { + probe_list = lttng_get_probe_list_head(); + list_for_each_entry(probe_desc, probe_list, head) { for (i = 0; i < probe_desc->nr_events; i++) { if (iter++ >= *ppos) return (void *) probe_desc->event_desc[i];