X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt-probes.c;h=668f6678ad3ec13c15cfb8518e8d20b32b5afa76;hb=e17d7b2781e42b8bfe6f86272a29299dff6d2912;hp=249fc333d02b7cd9a95a79404085b815aa171c0f;hpb=a51729c7236fffff3f514174fb3b10a07e1a2b58;p=lttng-modules.git diff --git a/ltt-probes.c b/ltt-probes.c index 249fc333..668f6678 100644 --- a/ltt-probes.c +++ b/ltt-probes.c @@ -4,6 +4,8 @@ * Copyright 2010 (c) - Mathieu Desnoyers * * Holds LTTng probes registry. + * + * Dual LGPL v2.1/GPL v2 license. */ #include @@ -90,6 +92,7 @@ void *tp_list_start(struct seq_file *m, loff_t *pos) struct lttng_probe_desc *probe_desc; int iter = 0, i; + mutex_lock(&probe_mutex); list_for_each_entry(probe_desc, &probe_list, head) { for (i = 0; i < probe_desc->nr_events; i++) { if (iter++ >= *pos) @@ -120,6 +123,7 @@ void *tp_list_next(struct seq_file *m, void *p, loff_t *ppos) static void tp_list_stop(struct seq_file *m, void *p) { + mutex_unlock(&probe_mutex); } static @@ -127,6 +131,11 @@ int tp_list_show(struct seq_file *m, void *p) { const struct lttng_event_desc *probe_desc = p; + /* + * Don't export lttng internal events (metadata). + */ + if (!strncmp(probe_desc->name, "lttng_", sizeof("lttng_") - 1)) + return 0; seq_printf(m, "event { name = %s; };\n", probe_desc->name); return 0; @@ -147,6 +156,7 @@ int lttng_tracepoint_list_open(struct inode *inode, struct file *file) } const struct file_operations lttng_tracepoint_list_fops = { + .owner = THIS_MODULE, .open = lttng_tracepoint_list_open, .read = seq_read, .llseek = seq_lseek,