lttng-modules.git
11 years agofix: block instrumentation: NULL pointer dereference
Mathieu Desnoyers [Thu, 6 Jun 2013 02:54:50 +0000 (22:54 -0400)] 
fix: block instrumentation: NULL pointer dereference

This backtrace appears with kernel 3.9.4:

[19311.313455] BUG: unable to handle kernel NULL pointer dereference at           (null)
[19311.316589] IP: [<ffffffffa076392b>] __event_probe__block_bio+0x8b/0x1a0 [lttng_probe_block]
[19311.316589] PGD 41808a067 PUD 4190a3067 PMD 0
[19311.316589] Oops: 0000 [#1] PREEMPT SMP
[19311.316589] Modules linked in: lttng_probe_writeback(O) lttng_probe_workqueue(O) lttng_probe_vmscan(O) lttng_probe_udp(O) lm
[19311.316589] CPU 4
[19311.316589] Pid: 1423, comm: kjournald Tainted: G           O 3.9.4-trace-test #143 Supermicro X7DAL/X7DAL
[19311.316589] RIP: 0010:[<ffffffffa076392b>]  [<ffffffffa076392b>] __event_probe__block_bio+0x8b/0x1a0 [lttng_probe_block]
[19311.316589] RSP: 0018:ffff88041c0d5aa8  EFLAGS: 00010246
[19311.316589] RAX: 0000000000000000 RBX: ffff88041a994c00 RCX: ffff88041b610800
[19311.316589] RDX: 0000000000000004 RSI: ffff88041c0d5b00 RDI: ffff88041c0d5ab0
[19311.316589] RBP: ffff88041c0d5b18 R08: fffffffffffc0000 R09: 0000000000000000
[19311.316589] R10: ffff88041a9947e8 R11: 0000000000000001 R12: ffff880419252c18
[19311.316589] R13: ffff88041c9e0a48 R14: ffff88041749bd10 R15: ffff88041749bd20
[19311.316589] FS:  0000000000000000(0000) GS:ffff88042fd00000(0000) knlGS:0000000000000000
[19311.316589] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[19311.316589] CR2: 0000000000000000 CR3: 0000000417a0a000 CR4: 00000000000007e0
[19311.316589] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[19311.316589] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[19311.316589] Process kjournald (pid: 1423, threadinfo ffff88041c0d4000, task ffff88041daa0000)
[19311.316589] Stack:
[19311.316589]  0000000000000000 ffff88041c3e4000 ffff880408987518 0000000000000024
[19311.316589]  0000000400000001 ffff88042fd19e30 000000000000002a 00000000000126c1
[19311.316589]  00000000000126bb 0000119043fa4efc ffff880400000000 0000000000000246
[19311.316589] Call Trace:
[19311.316589]  [<ffffffff812e79fb>] bio_attempt_back_merge+0xfb/0x1e0
[19311.316589]  [<ffffffff812ec96f>] blk_queue_bio+0x43f/0x570
[19311.316589]  [<ffffffff812ea68a>] generic_make_request+0xca/0x100
[19311.316589]  [<ffffffff81495bfe>] raid1_unplug+0x12e/0x170
[19311.316589]  [<ffffffff812ec36c>] blk_flush_plug_list+0x9c/0x210
[19311.316589]  [<ffffffff812ec4f8>] blk_finish_plug+0x18/0x50
[19311.316589]  [<ffffffff81243a48>] journal_commit_transaction+0x728/0x1f30
[19311.316589]  [<ffffffff8104e463>] ? try_to_del_timer_sync+0x53/0x70
[19311.316589]  [<ffffffff8104e485>] ? del_timer_sync+0x5/0xd0
[19311.316589]  [<ffffffff8124967d>] kjournald+0xed/0x290
[19311.316589]  [<ffffffff8106a270>] ? __init_waitqueue_head+0x60/0x60
[19311.316589]  [<ffffffff81249590>] ? commit_timeout+0x10/0x10
[19311.316589]  [<ffffffff810695fb>] kthread+0xdb/0xe0
[19311.316589]  [<ffffffff81672c60>] ? _raw_spin_unlock_irq+0x30/0x60
[19311.316589]  [<ffffffff81069520>] ? __init_kthread_worker+0x70/0x70
[19311.316589]  [<ffffffff8167af1c>] ret_from_fork+0x7c/0xb0
[19311.316589]  [<ffffffff81069520>] ? __init_kthread_worker+0x70/0x70

Fixes #559

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: 3.9.0 block layer instrumentation build
Mathieu Desnoyers [Mon, 29 Apr 2013 17:11:46 +0000 (13:11 -0400)] 
Fix: 3.9.0 block layer instrumentation build

Linux upstream commit:

commit 0a82a8d132b26d438eb90b3ab35a7016e7227a1d
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Thu Apr 18 09:00:26 2013 -0700

    Revert "block: add missing block_bio_complete() tracepoint"

Requires us to revert in lttng-modules too.

Fixes #512

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoblock: update instrumentation to 3.9 rc kernel
Mathieu Desnoyers [Sat, 30 Mar 2013 01:38:27 +0000 (21:38 -0400)] 
block: update instrumentation to 3.9 rc kernel

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoBackport block-related changes from "Update kernel probes to more detailed match...
Mathieu Desnoyers [Fri, 7 Jun 2013 18:39:41 +0000 (14:39 -0400)] 
Backport block-related changes from "Update kernel probes to more detailed match to kernel versions"

This commit:

commit 7c68b363332170e4db100327ecc9e09b8a79cf29
Author: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Date:   Mon Dec 10 11:12:14 2012 -0500

    Update kernel probes to more detailed match to kernel versions

    Some ifdef's are added to kernel probes instrumentation to make them
    more close to original tracepoints in different kernel versions.
    Supported kernel version are from 2.6.32 to 3.7.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Contains block-layer related changes needed to push compatibility fixes
for newer kernels.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: warning kvm_trace_exit_reason redefined for 3.9 kernel
Mathieu Desnoyers [Fri, 3 May 2013 13:02:43 +0000 (09:02 -0400)] 
Fix: warning kvm_trace_exit_reason redefined for 3.9 kernel

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix 3.8 kernel support: namespace lttng_is_signed_type()
Mathieu Desnoyers [Wed, 13 Mar 2013 17:49:13 +0000 (13:49 -0400)] 
Fix 3.8 kernel support: namespace lttng_is_signed_type()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agolttng-module: sched.h: Fix compilation on 3.9 kernel
Maxin B. John [Fri, 22 Mar 2013 13:58:53 +0000 (09:58 -0400)] 
lttng-module: sched.h: Fix compilation on 3.9 kernel

With commit 8bd75c77b7c6a3954140dd2e20346aef3efe4a35
included in 3.9-rc1 kernel, rt specific bits in "linux/sched.h"
were moved into new header file "linux/sched/rt.h".

Fixes this compilation error:
 CC [M]  /home/majo/lttng/lttng-modules/probes/lttng-probe-sched.o
...
/home/majo/lttng/lttng-modules/probes/../instrumentation/events/lttng-module
/../../../probes/../instrumentation/events/lttng-module/sched.h:
In function '__event_probe__sched_switch':
/home/majo/lttng/lttng-modules/probes/../instrumentation/events/lttng-module
/../../../probes/../instrumentation/events/lttng-module/sched.h:164:1:
error: 'MAX_RT_PRIO' undeclared (first use in this function)
...

Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't flush-final for offset 0 if reader is on sub-buffer
Mathieu Desnoyers [Wed, 27 Feb 2013 21:48:56 +0000 (16:48 -0500)] 
Fix: don't flush-final for offset 0 if reader is on sub-buffer

Triggers rare sub-buffer corruption when a buffer is completely full and
a final flush is then performed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoVersion 2.1.1 v2.1.1
Mathieu Desnoyers [Thu, 14 Feb 2013 23:35:08 +0000 (18:35 -0500)] 
Version 2.1.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: statedump: missing locking, use lttng_iterate_fd
Mathieu Desnoyers [Fri, 25 Jan 2013 17:25:38 +0000 (12:25 -0500)] 
Fix: statedump: missing locking, use lttng_iterate_fd

- Take a spinlock around use of dentry->d_name.name.
- Use lttng_iterate_fd wrapper (and thus iterate_fd() from Linux kernels
  from v3.7 and onward).

Suggested-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement lttng_iterate_fd wrapper
Mathieu Desnoyers [Fri, 25 Jan 2013 17:24:57 +0000 (12:24 -0500)] 
Implement lttng_iterate_fd wrapper

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix check in lttng_strlen_user_inatomic
Simon Marchi [Wed, 6 Feb 2013 16:26:59 +0000 (11:26 -0500)] 
Fix check in lttng_strlen_user_inatomic

__copy_from_user_inatomic returns the number of bytes that could not be
copied, not an error code. This fixes the test accordingly.

[ Edit by Mathieu Desnoyers: change "ret" type to unsigned long too. ]

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: statedump hang/too early completion due to logic error
Mathieu Desnoyers [Wed, 9 Jan 2013 17:40:55 +0000 (12:40 -0500)] 
Fix: statedump hang/too early completion due to logic error

The previous "Fix: statedump hang due to incorrect wait/wakeup use" was
not actually fixing the real problem.

The issue is that we should pass the expected condition to wait_event()
rather than its contrary.

This bug has been sitting there for a while. I suspect that a recent
change in the Linux scheduler behavior for newly spawned worker threads
might have contributed to trigger the hang more reliably.

The effects of this bugs are:
- possible hang of the lttng-sessiond (within the kernel) at tracing
  start,
- the statedump end event is traced before all worker threads have
  actually completed, which can confuse LTTng viewer state systems.

Reported-by: Phil Wilshire <sysdcs@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: statedump hang due to incorrect wait/wakeup use
Mathieu Desnoyers [Tue, 8 Jan 2013 19:27:05 +0000 (14:27 -0500)] 
Fix: statedump hang due to incorrect wait/wakeup use

Reported-by: Phil Wilshire <sysdcs@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoVersion 2.1.0 v2.1.0
Mathieu Desnoyers [Thu, 20 Dec 2012 18:28:37 +0000 (13:28 -0500)] 
Version 2.1.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoput_ulong calls in lib_ring_buffer_compat_ioctl() should be compat
Corey Minyard [Wed, 12 Dec 2012 02:45:20 +0000 (21:45 -0500)] 
put_ulong calls in lib_ring_buffer_compat_ioctl() should be compat

I was noticing the that some of the put_ulong calls in
lib_ring_buffer_compat_ioctl() were not compat_put_ulong.  I can't
imagine this is correct.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agowrapper/perf.h: Fix kernel version condition
Andrew Gabbasov [Mon, 10 Dec 2012 18:18:32 +0000 (13:18 -0500)] 
wrapper/perf.h: Fix kernel version condition

The pid_t parameter of function perf_event_create_kernel_counter
was changed to task_struct pointer starting from 2.6.37.x.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix possible kernel build errors with linux-patches
Andrew Gabbasov [Mon, 10 Dec 2012 16:01:52 +0000 (11:01 -0500)] 
Fix possible kernel build errors with linux-patches

Kernel sources of version 2.6.32 - 2.6.34 with applied patches
from linux-patches may fail to compile if tracepoint samples
are configured to build. Some part of backported commits
are added to the kernel patches to avoid those errors.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd missing MIT license text to 3 files under this license
Mathieu Desnoyers [Wed, 5 Dec 2012 13:14:39 +0000 (08:14 -0500)] 
Add missing MIT license text to 3 files under this license

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCheck if interrupt action name is not null in statedump
Simon Marchi [Thu, 8 Nov 2012 20:17:54 +0000 (15:17 -0500)] 
Check if interrupt action name is not null in statedump

Protection against poorly written drivers who give a null name to their
irq handlers.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix exec instrumentation: only for kernels 3.4.0 and higher
Mathieu Desnoyers [Fri, 12 Oct 2012 21:01:25 +0000 (17:01 -0400)] 
Fix exec instrumentation: only for kernels 3.4.0 and higher

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd TRACE_EVENT(sched_process_exec) to sched.h
Paul Woegerer [Fri, 12 Oct 2012 14:19:42 +0000 (10:19 -0400)] 
Add TRACE_EVENT(sched_process_exec) to sched.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agolib/ringbuffer/frontend_api.h: Include linux/prefetch.h.
Will Newton [Thu, 11 Oct 2012 16:51:15 +0000 (12:51 -0400)] 
lib/ringbuffer/frontend_api.h: Include linux/prefetch.h.

prefetch() is used in this file so make sure we include the appropriate
header before using it.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix warning with 3.6.0 kernel
Mathieu Desnoyers [Wed, 3 Oct 2012 13:11:00 +0000 (09:11 -0400)] 
Fix warning with 3.6.0 kernel

No actual runtime impact, but neater anyway.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoABI with support for compat 32/64 bits
Julien Desfossez [Mon, 1 Oct 2012 15:59:19 +0000 (11:59 -0400)] 
ABI with support for compat 32/64 bits

The current ABI does not work for compat 32/64 bits.
This patch moves the current ABI as old-abi and provides a new ABI in
which all the structures exchanged between user and kernel-space are
packed. Also this new ABI moves the "int overwrite" member of the
struct lttng_kernel_channel to remove the alignment added by the
compiler.

A patch for lttng-tools has been developed in parallel to this one to
support the new ABI. These 2 patches have been tested in all
possible configurations (applied or not) on 64-bit and 32-bit kernels
(with CONFIG_COMPAT) and a user-space in 32 and 64-bit.

Here are the results of the tests :
k 64 compat     | u 32 compat     | OK
k 64 compat     | u 64 compat     | OK
k 64 compat     | u 32 non-compat | KO
k 64 compat     | u 64 non-compat | OK

k 64 non-compat | u 64 compat     | OK
k 64 non-compat | u 32 compat     | KO
k 64 non-compat | u 64 non-compat | OK
k 64 non-compat | u 32 non-compat | KO

k 32 compat     | u compat        | OK
k 32 compat     | u non-compat    | OK

k 32 non-compat | u compat        | OK
k 32 non-compat | u non-compat    | OK

The results are as expected :
- on 32-bit user-space and kernel, every configuration works.
- on 64-bit user-space and kernel, every configuration works.
- with 32-bit user-space on a 64-bit kernel the only configuration
  where it works is when the compat patch is applied everywhere.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoPerform calculation on bit size in 64-bit
Mathieu Desnoyers [Fri, 28 Sep 2012 00:25:11 +0000 (20:25 -0400)] 
Perform calculation on bit size in 64-bit

allow 32-bit architectures to have sub-buffers larger than 256MB.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUse uint64_t for packet header content size and packet size
Mathieu Desnoyers [Fri, 28 Sep 2012 00:04:02 +0000 (20:04 -0400)] 
Use uint64_t for packet header content size and packet size

Allow packets larger than 256MB (4GB / 8 bits per byte).

Fixes #354

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: compat layer only on supported architectures
Julien Desfossez [Fri, 21 Sep 2012 02:10:50 +0000 (22:10 -0400)] 
Fix: compat layer only on supported architectures

The compat_ulong_t type is only defined on some architectures, so we
need to protect the compat defines with the ifdef CONFIG_COMPAT.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix ring buffer 32/64 bits compat
Julien Desfossez [Thu, 20 Sep 2012 16:00:05 +0000 (12:00 -0400)] 
Fix ring buffer 32/64 bits compat

The type of fields exchanged between kernel and userspace must be
compat_ulong_t instead of unsigned long in case of compat where
userspace is 32 bits and kernel is 64 bits.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix cleanup: move lttng-tracer-core.h include to lib ringbuffer config.h
Mathieu Desnoyers [Thu, 20 Sep 2012 14:20:38 +0000 (10:20 -0400)] 
Fix cleanup: move lttng-tracer-core.h include to lib ringbuffer config.h

This is where it is used. Add a #ifdef check for the LTTNG_TRACER_CORE_H
define to ensure that the header it depends on is always included.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix ring_buffer_frontend.c: missing include lttng-tracer-core.h
Wade Farnsworth [Thu, 20 Sep 2012 13:52:22 +0000 (09:52 -0400)] 
Fix ring_buffer_frontend.c: missing include lttng-tracer-core.h

In lib/ringbuffer/ring_buffer_frontend.c, RING_BUFFER_ALIGN is undefined,
leading to no alignment offset being recorded after the call to
config->cb.record_header_size() in lib_ring_buffer_try_reserve_slow().

However, lttng-ring-buffer-client.h does define RING_BUFFER_ALIGN, so
the alignment offset will be produced when the packet header is written
in lttng_write_event_header().

This discrepancy may be observed on architectures that don't set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, such as ARM, with a babeltrace
error such as:

babeltrace: ../../include/babeltrace/ctf/types.h:206: ctf_pos_get_event:
Assertion `pos->offset <= pos->content_size' failed.
Aborted

indicating that the actual content size differs from the calculated one
due to the difference in alignment.  Including the appropriate header
file in ring_buffer_frontend.c solves the problem.

Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: statedump missing check for NULL namespace
Mathieu Desnoyers [Tue, 11 Sep 2012 16:09:53 +0000 (12:09 -0400)] 
Fix: statedump missing check for NULL namespace

Cause kernel OOPS. statedump PID namespace support is newly introduced
in lttng-modules 2.1. Happens when iterating on a zombie process.

Reported-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.1.0-rc1 v2.1.0-rc1
Mathieu Desnoyers [Mon, 10 Sep 2012 21:19:48 +0000 (17:19 -0400)] 
Update version to 2.1.0-rc1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agofix timestamps on architectures without CONFIG_KTIME_SCALAR
Mathieu Desnoyers [Thu, 6 Sep 2012 14:26:38 +0000 (10:26 -0400)] 
fix timestamps on architectures without CONFIG_KTIME_SCALAR

trace_clock_monotonic_wrapper() should return a u64 representing the
number of nanoseconds since system startup.
ktime_get() provides that value directly within its .tv64 field only
on those architectures defining CONFIG_KTIME_SCALAR, whereas in all
other cases (e.g. PowerPC) a ktime_to_ns() conversion (which
translates back to .tv64 when CONFIG_KTIME_SCALAR is defined)
becomes necessary.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoSupport for linux kernels 2.6.32 through 2.6.37
Mathieu Desnoyers [Sun, 2 Sep 2012 19:33:09 +0000 (12:33 -0700)] 
Support for linux kernels 2.6.32 through 2.6.37

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoDocument limitation of vppid and ppid context wrt eventual RCU instrumentation
Mathieu Desnoyers [Mon, 27 Aug 2012 13:57:09 +0000 (09:57 -0400)] 
Document limitation of vppid and ppid context wrt eventual RCU instrumentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCleanup: no need to hold RCU read-side lock when reading current nsproxy
Mathieu Desnoyers [Mon, 27 Aug 2012 13:46:48 +0000 (09:46 -0400)] 
Cleanup: no need to hold RCU read-side lock when reading current nsproxy

As documented in include/linux/nsproxy.h.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd env hostname information
Mathieu Desnoyers [Mon, 27 Aug 2012 00:23:21 +0000 (20:23 -0400)] 
Add env hostname information

Approximation in case of hostname change or in case of
contextualisation, but it does the job for 95% of use-cases.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: lttng_statedump_process_state for each PID NS has infinite loop
Mathieu Desnoyers [Thu, 23 Aug 2012 21:38:39 +0000 (17:38 -0400)] 
Fix: lttng_statedump_process_state for each PID NS has infinite loop

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agolttng_statedump_process_state for each PID NS
Julien Desfossez [Thu, 23 Aug 2012 21:11:35 +0000 (17:11 -0400)] 
lttng_statedump_process_state for each PID NS

When a process is in a namespace, its pid, tid and ppid are relative to
the namespace. Since namespaces can be nested, we need to know the
representation of each process in each namespace.

This patch changes the lttng_enumerate_task_fd to iterate over each
PID namespace of a process if any, that way we generate, in the
statedump, an entry for each process in each namespace it belongs.
To know the nesting level, the field "level" is added to the
lttng_statedump_process_state event, 0 being the top-level.
For processes running on the top-level namespace, the statedump
behaviour is unchanged (except the added "level" field).

For example (no nesting, just one level of namespace) :
lttng_statedump_process_state: {
        tid = 32185, vtid = 1, pid = 32185,
        vpid = 1, ppid = 32173, vppid = 0,
        level = 1, name = "init" }
lttng_statedump_process_state: {
        tid = 32185, vtid = 32185, pid = 32185,
        vpid = 32185, ppid = 32173, vppid = 32173,
        level = 0, name = "init" }

Confirmed that the process 32173 in the top-level namespace is indeed
the lxc-start command that created the container and its namespace.

[ Edit by Mathieu Desnoyers: Minor cleanups ]

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoSupport the hostname context
Julien Desfossez [Thu, 23 Aug 2012 20:54:03 +0000 (16:54 -0400)] 
Support the hostname context

This is particularly useful when tracing a machine with containers
(lxc), that way we can easily distinguish events generated inside
a container.

[ Edit by Mathieu Desnoyers: various fix. ]

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: statedump namespaced pid, tid and ppid
Julien Desfossez [Thu, 23 Aug 2012 20:19:53 +0000 (16:19 -0400)] 
Fix: statedump namespaced pid, tid and ppid

Use the target process namespace to lookup the value (pid, tid or ppid),
not the current task.

[ Edit by Mathieu Desnoyers: removed extra p->nsproxy check. Already
  performed within rcu read-side critical section. ]

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: statedump: disable vm maps enumeration
Mathieu Desnoyers [Wed, 22 Aug 2012 21:09:20 +0000 (17:09 -0400)] 
Fix: statedump: disable vm maps enumeration

We need the tasklist lock to correctly dump these, which is unavailable
to modules. Disable this feature for now.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: ensure userspace accesses are done with _inatomic
Mathieu Desnoyers [Wed, 22 Aug 2012 20:30:20 +0000 (16:30 -0400)] 
Fix: ensure userspace accesses are done with _inatomic

Otherwise, triggers scheduling while atomic (might_sleep()) warnings,
since we call those from a tracepoint probe (with preemption disabled).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: vppid context should test for current nsproxy
Mathieu Desnoyers [Wed, 22 Aug 2012 19:09:05 +0000 (15:09 -0400)] 
Fix: vppid context should test for current nsproxy

Triggers a NULL pointer exception with tracing scheduling events with
vppid context activated.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd MIPS system call support
Ralf Baechle [Thu, 12 Jul 2012 14:18:54 +0000 (10:18 -0400)] 
Add MIPS system call support

[ Edit by Mathieu: currently missing: update of arch-independent headers
  to include the MIPS headers to complete system call support. ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoChange mode of lttng-syscalls-generate-headers.sh to 755
Mathieu Desnoyers [Thu, 12 Jul 2012 13:39:42 +0000 (09:39 -0400)] 
Change mode of lttng-syscalls-generate-headers.sh to 755

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agocleanup: fix typo in syscall instrumentation header
Ralf Baechle [Mon, 9 Jul 2012 16:48:11 +0000 (12:48 -0400)] 
cleanup: fix typo in syscall instrumentation header

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCleanup: remove trailing whitespace in README
Mathieu Desnoyers [Thu, 5 Jul 2012 18:43:53 +0000 (14:43 -0400)] 
Cleanup: remove trailing whitespace in README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agotrace event: introduce TP_MODULE_NOAUTOLOAD and TP_MODULE_NOINIT
Mathieu Desnoyers [Mon, 2 Jul 2012 15:34:30 +0000 (11:34 -0400)] 
trace event: introduce TP_MODULE_NOAUTOLOAD and TP_MODULE_NOINIT

In preparation for introducing uevent tracing. (user-space events)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoLTTng: probe-statedump: add #include <linux/sched.h>
UCHINO Satoshi [Wed, 27 Jun 2012 05:44:29 +0000 (07:44 +0200)] 
LTTng: probe-statedump: add #include <linux/sched.h>

This fixes the following build error on ARM;

  CC [M]  drivers/staging/lttng/probes/lttng-probe-statedump.o
In file included from drivers/staging/lttng/probes/../instrumentation/events/lttng-module/../../../probes/lttng-events.h:221:0,
                 from drivers/staging/lttng/probes/../instrumentation/events/lttng-module/../../../probes/define_trace.h:117,
                 from drivers/staging/lttng/probes/../instrumentation/events/lttng-module/lttng-statedump.h:162,
                 from drivers/staging/lttng/probes/lttng-probe-statedump.c:41:
drivers/staging/lttng/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/lttng-statedump.h:29:1: error: 'TASK_COMM_LEN' undeclared here (not in a function)

Signed-off-by: UCHINO Satoshi <satoshi.uchino@toshiba.co.jp>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agofix: signal_generate event should print utf8 for comm field
Mathieu Desnoyers [Tue, 12 Jun 2012 22:33:33 +0000 (18:33 -0400)] 
fix: signal_generate event should print utf8 for comm field

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoMakes write operation a parameter for tp_memcpy macro
Francis Giraldeau [Tue, 5 Jun 2012 15:16:14 +0000 (11:16 -0400)] 
Makes write operation a parameter for tp_memcpy macro

Memcpy source can be either user-space or kernel-space. To avoid code
duplication, this patch makes the operation a parameter to the macros.
Available macros are thus:

* tp_memcpy:               kernel-space array copy
* tp_memcpy_from_user:     user-space array copy
* tp_memcpy_dyn:           kernel-space sequence copy
* tp_memcpy_dyn_from_user: user-space sequence copy

Those are TP_fast_assign macros that can be used with __dynamic_array
macros in TP_STRUCT__entry in a TRACE_EVENT.

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd coding style document
Mathieu Desnoyers [Wed, 30 May 2012 13:07:41 +0000 (09:07 -0400)] 
Add coding style document

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate instrumentation/events README file
Mathieu Desnoyers [Mon, 14 May 2012 15:12:00 +0000 (11:12 -0400)] 
Update instrumentation/events README file

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd makefile target for preprocessor
Francis Giraldeau [Thu, 10 May 2012 15:53:20 +0000 (11:53 -0400)] 
Add makefile target for preprocessor

By specifying .i target, it runs gcc preprocessor for that file.
Example:

  make myfile.i

will read myfile.c and output preprocessor to myfile.i

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: free_event_id check should compare unsigned int with -1U
Mathieu Desnoyers [Tue, 8 May 2012 20:02:41 +0000 (16:02 -0400)] 
Fix: free_event_id check should compare unsigned int with -1U

Otherwise, on 32-bit:

lttng-modules/lttng-events.c:295: warning: comparison is always false due
to limited range of data type

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUse unsigned long type for events discarded counter
Mathieu Desnoyers [Wed, 2 May 2012 15:43:47 +0000 (11:43 -0400)] 
Use unsigned long type for events discarded counter

Overflows at 64-bit on 64-bit systems.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: update signal instrumentation for 3.4 kernel
Mathieu Desnoyers [Thu, 26 Apr 2012 21:40:31 +0000 (17:40 -0400)] 
Fix: update signal instrumentation for 3.4 kernel

Fix #226

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoLTTng Modules ARM syscall instrumentation
Ryan Kyser [Tue, 17 Apr 2012 14:54:41 +0000 (10:54 -0400)] 
LTTng Modules ARM syscall instrumentation

This patch adds detailed instrumentation for ARM system calls, based on
a 2.6.38 kernel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: generate header missing echo -e for escape chars
Mathieu Desnoyers [Tue, 17 Apr 2012 14:50:12 +0000 (10:50 -0400)] 
Fix: generate header missing echo -e for escape chars

"why is the -e needed ? What was the experienced oddness ?"

   The \n wasn't getting evaluated to a newline and was being inserted
into the header file as '\n'

   From man echo(1):

       If -e is in effect, the following sequences are recognized:

       \\     backslash

       \a     alert (BEL)

       \b     backspace

       \c     produce no further output

       \e     escape

       \f     form feed

       \n     new line

       \r     carriage return

       \t     horizontal tab

       \v     vertical tab

Suggested-by: Ryan Kyser <Ryan.Kyser@jci.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: add missing uaccess.h include (for ARM)
Mathieu Desnoyers [Tue, 17 Apr 2012 14:49:07 +0000 (10:49 -0400)] 
Fix: add missing uaccess.h include (for ARM)

"What required uaccess.h ?"

   I was getting the following error:
   syscalls_pointers_override.h:6:1: error: implicit declaration of function ?strlen_user?

   I found that strlen_user was defined in asm/uaccess.h, which is
included by linux/uaccess.h.

Suggested-by: Ryan Kyser <Ryan.Kyser@jci.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoREADME: Document that CONFIG_MODULES is required
Mathieu Desnoyers [Wed, 11 Apr 2012 00:36:17 +0000 (20:36 -0400)] 
README: Document that CONFIG_MODULES is required

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: README typo
Mathieu Desnoyers [Mon, 9 Apr 2012 19:40:14 +0000 (15:40 -0400)] 
Fix: README typo

Reported-by: Ryan Kyser <Ryan.Kyser@jci.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: document required and optional kernel config options in README
Mathieu Desnoyers [Fri, 6 Apr 2012 16:32:22 +0000 (12:32 -0400)] 
Fix: document required and optional kernel config options in README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0.1 v2.0.1
Mathieu Desnoyers [Thu, 29 Mar 2012 04:41:11 +0000 (00:41 -0400)] 
Update version to 2.0.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: is_compat_task !CONFIG_COMPAT compile error on kernels >= 3.3
Mathieu Desnoyers [Mon, 26 Mar 2012 15:09:30 +0000 (11:09 -0400)] 
Fix: is_compat_task !CONFIG_COMPAT compile error on kernels >= 3.3

The Linux kernel already defines a is_compat_task()   (0) when
!CONFIG_COMPAT since kernel 3.3, so if we see it is already defined,
don't redefine it.

Closes #195

Reported-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0.0 stable v2.0.0
Mathieu Desnoyers [Tue, 20 Mar 2012 22:34:27 +0000 (18:34 -0400)] 
Update version to 2.0.0 stable

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0.0-rc4 v2.0.0-rc4
Mathieu Desnoyers [Tue, 20 Mar 2012 21:11:02 +0000 (17:11 -0400)] 
Update version to 2.0.0-rc4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate README and add version name place-holder
Mathieu Desnoyers [Tue, 20 Mar 2012 21:09:38 +0000 (17:09 -0400)] 
Update README and add version name place-holder

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0.0-rc3
Mathieu Desnoyers [Fri, 16 Mar 2012 19:44:38 +0000 (15:44 -0400)] 
Update version to 2.0.0-rc3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix clock offset 32-bit multiplication overflow
Mathieu Desnoyers [Tue, 13 Mar 2012 20:11:37 +0000 (16:11 -0400)] 
Fix clock offset 32-bit multiplication overflow

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix : wrong assign of fd in state dump
Julien Desfossez [Mon, 12 Mar 2012 19:00:37 +0000 (15:00 -0400)] 
Fix : wrong assign of fd in state dump

lttng_statedump_file_descriptor was using the tgid instead of the fd for
the fd field.

Reported-by: Mathieu Bain <mathieu.bain@polymtl.ca>
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoLicense cleanup, ifdef namespace cleanup
Mathieu Desnoyers [Fri, 9 Mar 2012 00:28:14 +0000 (19:28 -0500)] 
License cleanup, ifdef namespace cleanup

- Spell out the LGPL license completely in each file.
- Change LINUX_* ifdefs for LIB_* in lib/ringbuffer header.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: ensure power of 2 check handles 64-bit size_t entirely
Mathieu Desnoyers [Thu, 8 Mar 2012 16:00:30 +0000 (11:00 -0500)] 
Fix: ensure power of 2 check handles 64-bit size_t entirely

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0.0-rc2 v2.0.0-rc2
Mathieu Desnoyers [Fri, 2 Mar 2012 22:51:06 +0000 (17:51 -0500)] 
Update version to 2.0.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: dmesg printout should not print metadata warnings
Mathieu Desnoyers [Fri, 2 Mar 2012 15:23:39 +0000 (10:23 -0500)] 
Fix: dmesg printout should not print metadata warnings

Metadata channel retry when an event is dropped by the underlying
buffer. We should not print a message showing that the event has been
dropped to the user on dmesg console.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: use transport name as channel name
Mathieu Desnoyers [Fri, 2 Mar 2012 15:12:42 +0000 (10:12 -0500)] 
Fix: use transport name as channel name

Clarify dmesg printout.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: Return -EINVAL instead of print warning if non power of 2 size/num_subbuf
Mathieu Desnoyers [Wed, 22 Feb 2012 00:20:13 +0000 (19:20 -0500)] 
Fix: Return -EINVAL instead of print warning if non power of 2 size/num_subbuf

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate Version to 2.0.0-rc1 v2.0.0-rc1
Mathieu Desnoyers [Mon, 20 Feb 2012 20:32:01 +0000 (15:32 -0500)] 
Update Version to 2.0.0-rc1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoStandardize version across toolchain
Mathieu Desnoyers [Mon, 20 Feb 2012 19:59:42 +0000 (14:59 -0500)] 
Standardize version across toolchain

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agostatedump: Use old macro name for kernel 2.6.38
Juha Niskanen [Thu, 16 Feb 2012 16:55:42 +0000 (11:55 -0500)] 
statedump: Use old macro name for kernel 2.6.38

Signed-off-by: Juha Niskanen <juniskane@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate ChangeLog to 2.0-pre15 v2.0-pre15
Mathieu Desnoyers [Thu, 16 Feb 2012 16:39:57 +0000 (11:39 -0500)] 
Update ChangeLog to 2.0-pre15

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd timer instrumentation
Mathieu Desnoyers [Thu, 16 Feb 2012 16:00:43 +0000 (11:00 -0500)] 
Add timer instrumentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agofix: need to undef mainline define
Mathieu Desnoyers [Thu, 16 Feb 2012 15:56:11 +0000 (10:56 -0500)] 
fix: need to undef mainline define

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agofix: Include signal.h instead of irq.h for prototype match check
Mathieu Desnoyers [Thu, 16 Feb 2012 15:54:41 +0000 (10:54 -0500)] 
fix: Include signal.h instead of irq.h for prototype match check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd signal instrumentation
Mathieu Desnoyers [Thu, 16 Feb 2012 15:46:32 +0000 (10:46 -0500)] 
Add signal instrumentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate ChangeLog to 2.0-pre14 v2.0-pre14
Mathieu Desnoyers [Thu, 16 Feb 2012 14:36:02 +0000 (09:36 -0500)] 
Update ChangeLog to 2.0-pre14

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agosyscall tracing: sys_getcpu
Mathieu Desnoyers [Thu, 16 Feb 2012 03:13:43 +0000 (22:13 -0500)] 
syscall tracing: sys_getcpu

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd sys_clone x86 instrumentation
Mathieu Desnoyers [Thu, 16 Feb 2012 02:48:30 +0000 (21:48 -0500)] 
Add sys_clone x86 instrumentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agostatedump: fix include circular dep
Mathieu Desnoyers [Thu, 16 Feb 2012 02:13:32 +0000 (21:13 -0500)] 
statedump: fix include circular dep

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoImplement state dump
Mathieu Desnoyers [Thu, 16 Feb 2012 02:02:00 +0000 (21:02 -0500)] 
Implement state dump

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate Changelog to 2.0-pre13 v2.0-pre13
Mathieu Desnoyers [Fri, 10 Feb 2012 00:36:51 +0000 (19:36 -0500)] 
Update Changelog to 2.0-pre13

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate README
Mathieu Desnoyers [Wed, 8 Feb 2012 14:37:11 +0000 (09:37 -0500)] 
Update README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoenvironment: write sysname, release, version, domain to metadata
Mathieu Desnoyers [Tue, 7 Feb 2012 04:29:20 +0000 (23:29 -0500)] 
environment: write sysname, release, version, domain to metadata

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAllow open /proc/lttng for read & write
Mathieu Desnoyers [Tue, 7 Feb 2012 04:23:38 +0000 (23:23 -0500)] 
Allow open /proc/lttng for read & write

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate Changelog to 2.0-pre12 v2.0-pre12
Mathieu Desnoyers [Fri, 3 Feb 2012 03:29:39 +0000 (22:29 -0500)] 
Update Changelog to 2.0-pre12

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd x86 32/64 execve syscall instrumentation override
Mathieu Desnoyers [Thu, 2 Feb 2012 19:42:37 +0000 (14:42 -0500)] 
Add x86 32/64 execve syscall instrumentation override

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRemove unused defines
Mathieu Desnoyers [Thu, 2 Feb 2012 17:21:53 +0000 (12:21 -0500)] 
Remove unused defines

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd padding to ABI
Mathieu Desnoyers [Thu, 2 Feb 2012 17:12:17 +0000 (12:12 -0500)] 
Add padding to ABI

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.044221 seconds and 4 git commands to generate.