X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-probes.c;h=51b0f8652a297eee9bb5d7a15df443972732f595;hb=1b25fe5879436a90fd22a731e9d3371807e78ba1;hp=ee75e33d7881f9528043dd492a63351ef73714de;hpb=021153c017dd6cb9dc5ec5fe74fadd6536f1327d;p=lttng-modules.git diff --git a/lttng-probes.c b/lttng-probes.c index ee75e33d..51b0f865 100644 --- a/lttng-probes.c +++ b/lttng-probes.c @@ -25,7 +25,7 @@ #include #include -#include "lttng-events.h" +#include /* * probe list is protected by sessions lock. @@ -44,6 +44,10 @@ static LIST_HEAD(lazy_probe_init); */ static int lazy_nesting; +DEFINE_PER_CPU(struct lttng_dynamic_len_stack, lttng_dynamic_len_stack); + +EXPORT_PER_CPU_SYMBOL_GPL(lttng_dynamic_len_stack); + /* * Called under sessions lock. */ @@ -251,10 +255,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 +274,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]; @@ -318,3 +326,12 @@ const struct file_operations lttng_tracepoint_list_fops = { .llseek = seq_lseek, .release = seq_release, }; + +int lttng_probes_init(void) +{ + int cpu; + + for_each_possible_cpu(cpu) + per_cpu_ptr(<tng_dynamic_len_stack, cpu)->offset = 0; + return 0; +}