--- /dev/null
+#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"
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;
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);
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;
}
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 */
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;
}
void ltt_buffer_read_close(struct lib_ring_buffer *buf)
{
lib_ring_buffer_release_read(buf);
-
}
static
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
--- /dev/null
+/*
+ * 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");