Fix: provide more precise error report for enable event

Fixes #658

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Update sched instrumentation to Linux 3.13

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Update kvm instrumentation to Linux 3.13

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: enable event error path memory corruption

The call to

  kmem_cache_free(event_cache, event);

after setting event to ERR_PTR() value is causing memory corruption
(kernel oops). This bug has been introduced very recently by commit:

  Fix: provide more precise error report for enable event

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: tracepoint name remapping

Commit

  "Introduce API to remap event names exposed by LTTng"

failed to map the event names enabled by the user to tracepoint names
known to the kernel. For instance, tracing with the kmem_kmalloc event
enabled is not gathering any event. This issue applies to all tracepoint
events declared with a different name within LTTng than within the Linux
kernel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: tracepoint event name mapping at unregister

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Version 2.4.0-rc3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: OOT lttng-statedump tracepoints not visible with signed kernels

Users have reported being unable to trace non-signed modules loaded
within a kernel supporting module signature.

Here is the relevant report of this issue to Linux upstream, with a
proposed fix: https://lkml.org/lkml/2014/2/10/747

Work-around the issue for lttng-statedump.ko tracepoints.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: move callback init to static initialization

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Add statedump exit so module is not permanent

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: use after free in ring buffer clients

Don't use ring buffer client's struct lttng_channel from ioctl which
applies to ring buffer streams, because lttng_channel is freed while lib
ring buffer stream and channel are still in use. Their lifetime persists
until the consumer daemon releases its handles on the related stream
file descriptors.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Version 2.4.0-rc4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add extraversion (e.g. -rc4) to lttng-tracer modinfo

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: correctly version kvm events to build against v3.0 kernel

Cleanly build against v3.0 kernel.  I didn't add versioning for mainline commit 0d460ffc as it's build compatible.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: fix comment

Fixes #652

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: load state dump even if work-around lookup fails

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Version 2.4.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
LTTng logger ABI

Add a user-space ABI (new file /proc/lttng-logger) to lttng-modules
which can be written into by any user on the system. The content is
saved into the kernel trace stream into the "lttng_logger" kernel event.

The content of a single write is written into an lttng_logger event.
The write count is truncated to 1024 bytes (if larger), which is much
smaller than the smallest subbuffer size available (4096 bytes). This
ensures all written data makes it into the active tracing buffers.

Example use:

lttng-sessiond -d # (as root)
lttng create
lttng enable-event -k lttng_logger
lttng start

echo -n "this is a test" > /proc/lttng-logger

lttng stop
lttng view

Example result:

[17:00:04.251970425] (+179.750663203) thinkos lttng_logger: { cpu_id = 3 }, { _msg_length = 14, msg = "this is a test" }

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Karim Yaghmour <karim.yaghmour@opersys.com>
Fix file permissions for lttng-statedump-impl.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: remove __exit annotation

lttng_abi_exit() is now used by init error path too.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>