From: Mathieu Desnoyers Date: Fri, 23 Oct 2015 21:17:43 +0000 (-0400) Subject: Fix: tracepoint listing misses last loaded probe X-Git-Tag: v2.8.0-rc1~64 X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=commitdiff_plain;h=a1031097400268ccb8e02855da46a1efeb88ecdc Fix: tracepoint listing misses last loaded probe The seqfile iteration listing tracepoints operates on the probe list directly, without going through the lttng_get_probe_list_head() accessor which ensures that the lazy list of probes is moved to the actual list of probes. This causes an issue when loading a probe and then listing the tracepoints when no tracing sessions are active: the last probe loaded is missing from the listing. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-probes.c b/lttng-probes.c index ee75e33d..0385a79c 100644 --- a/lttng-probes.c +++ b/lttng-probes.c @@ -251,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]; @@ -268,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];