Add metadata channel, basic test passes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 14 May 2011 15:20:52 +0000 (11:20 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 14 May 2011 15:20:52 +0000 (11:20 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/lttng.h [new file with mode: 0644]
ltt-debugfs-abi.c
ltt-events.c
ltt-events.h
ltt-ring-buffer-metadata-client.h
probes/Makefile
probes/lttng-probe-lttng.c [new file with mode: 0644]

diff --git a/instrumentation/events/lttng-module/lttng.h b/instrumentation/events/lttng-module/lttng.h
new file mode 100644 (file)
index 0000000..690b5df
--- /dev/null
@@ -0,0 +1,29 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM lttng
+
+#if !defined(_TRACE_LTTNG_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_LTTNG_H
+
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(lttng_metadata,
+
+       TP_PROTO(const char *str),
+
+       TP_ARGS(str),
+
+       TP_STRUCT__entry(
+               __string(       string,         str     )
+       ),
+
+       TP_fast_assign(
+               tp_strcpy(string, str)
+       ),
+
+       TP_printk("")
+)
+
+#endif /*  _TRACE_LTTNG_H */
+
+/* This part must be outside protection */
+#include "define_trace.h"
index 0f649fc2af4bd10682949be82408cce0b7191ec9..7c9f88ab98d0ed98bf26a0018208d56183b57963 100644 (file)
@@ -123,7 +123,7 @@ static
 void lttng_metadata_create_events(struct file *channel_file)
 {
        struct ltt_channel *channel = channel_file->private_data;
-       char *event_name = "lttng-metadata";
+       char *event_name = "lttng_metadata";
        const struct lttng_event_desc *event_desc;
        struct ltt_event *event;
        int ret;
@@ -210,8 +210,10 @@ int lttng_abi_create_channel(struct file *session_file,
        chan->file = chan_file;
        chan_file->private_data = chan;
        fd_install(chan_fd, chan_file);
-       if (channel_type == METADATA_CHANNEL)
+       if (channel_type == METADATA_CHANNEL) {
                lttng_metadata_create_events(chan_file);
+               session->metadata = chan;
+       }
 
        /* The channel created holds a reference on the session */
        atomic_long_inc(&session_file->f_count);
index b0191596d4519529be5a15fcfd3744aaf16ce7cf..1d729210f83049ba3fcc7f5364988afedcfaf901 100644 (file)
@@ -515,7 +515,7 @@ int _ltt_session_metadata_statedump(struct ltt_session *session)
        if (session->metadata_dumped)
                goto skip_session;
        if (!session->metadata) {
-               printk(KERN_WARNING "LTTng: tracing is starting, but metadata channel is not found\n");
+               printk(KERN_WARNING "LTTng: attempt to start tracing, but metadata channel is not found. Operation abort.\n");
                return -EPERM;
        }
 
index cc8e8097836dadcd8bf93f7f7d586eca3181a40a..3bacac785a2acd007f0a8c3bf5c06471100d7165 100644 (file)
@@ -217,5 +217,7 @@ int ltt_probe_register(struct lttng_probe_desc *desc);
 void ltt_probe_unregister(struct lttng_probe_desc *desc);
 const struct lttng_event_desc *ltt_event_get(const char *name);
 void ltt_event_put(const struct lttng_event_desc *desc);
+int ltt_probes_init(void);
+void ltt_probes_exit(void);
 
 #endif /* _LTT_EVENTS_H */
index 68ce958772c4f681448b535892cf902b43eb86b9..a0f6f9e12f2c45c75e6d13db2b9cc0db5dc4cf2f 100644 (file)
@@ -172,13 +172,10 @@ static
 struct lib_ring_buffer *ltt_buffer_read_open(struct channel *chan)
 {
        struct lib_ring_buffer *buf;
-       int cpu;
 
-       for_each_channel_cpu(cpu, chan) {
-               buf = channel_get_ring_buffer(&client_config, chan, cpu);
-               if (!lib_ring_buffer_open_read(buf))
-                       return buf;
-       }
+       buf = channel_get_ring_buffer(&client_config, chan, 0);
+       if (!lib_ring_buffer_open_read(buf))
+               return buf;
        return NULL;
 }
 
@@ -186,7 +183,6 @@ static
 void ltt_buffer_read_close(struct lib_ring_buffer *buf)
 {
        lib_ring_buffer_release_read(buf);
-       
 }
 
 static
index 7bc3a51cd4373902195e0ec4cccaf7b1c2a6a8e3..add4e88fc0e48664a4c8b8fc0384e37263c20c26 100644 (file)
@@ -8,6 +8,8 @@ ifneq ($(CONFIG_TRACEPOINTS),)
 ccflags-y += -I$(PWD)/probes
 obj-m += lttng-types.o
 
+obj-m += lttng-probe-lttng.o
+
 obj-m += lttng-probe-sched.o
 obj-m += lttng-probe-kvm.o
 obj-m += lttng-probe-irq.o
diff --git a/probes/lttng-probe-lttng.c b/probes/lttng-probe-lttng.c
new file mode 100644 (file)
index 0000000..99a3dd9
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * probes/lttng-probe-core.c
+ *
+ * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * LTTng core probes.
+ */
+
+#include <linux/module.h>
+
+/*
+ * Create LTTng tracepoint probes.
+ */
+#define LTTNG_PACKAGE_BUILD
+#define CREATE_TRACE_POINTS
+#define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module
+
+#include "../instrumentation/events/lttng-module/lttng.h"
+
+MODULE_LICENSE("GPL and additional rights");
+MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
+MODULE_DESCRIPTION("LTTng core probes");
This page took 0.030066 seconds and 4 git commands to generate.