lttng-modules.git
10 years agoVersion 2.2.4 stable-2.2 v2.2.4
Mathieu Desnoyers [Fri, 28 Feb 2014 17:33:30 +0000 (12:33 -0500)] 
Version 2.2.4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: load state dump even if work-around lookup fails
Mathieu Desnoyers [Fri, 28 Feb 2014 17:30:04 +0000 (12:30 -0500)] 
Fix: load state dump even if work-around lookup fails

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: Add statedump exit so module is not permanent
Mathieu Desnoyers [Tue, 11 Feb 2014 23:02:32 +0000 (18:02 -0500)] 
Fix: Add statedump exit so module is not permanent

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: OOT lttng-statedump tracepoints not visible with signed kernels
Mathieu Desnoyers [Tue, 11 Feb 2014 11:02:42 +0000 (06:02 -0500)] 
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>
10 years agoFix: tracepoint event name mapping at unregister
Mathieu Desnoyers [Sat, 25 Jan 2014 20:58:08 +0000 (15:58 -0500)] 
Fix: tracepoint event name mapping at unregister

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: ring buffer check deliver compile fix
Mathieu Desnoyers [Sat, 25 Jan 2014 00:50:05 +0000 (19:50 -0500)] 
Fix: ring buffer check deliver compile fix

Cherry pick of commit:

  "Fix: eliminate timestamp overlap between packets"

Introduced a compile failure due to mismatch of argument number.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: tracepoint name remapping
Mathieu Desnoyers [Sat, 25 Jan 2014 00:16:08 +0000 (19:16 -0500)] 
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>
10 years agoFix: quote event name in metadata
Mathieu Desnoyers [Wed, 18 Dec 2013 18:47:52 +0000 (13:47 -0500)] 
Fix: quote event name in metadata

Allows adding events with a "-" within the name with --probe or
--function.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: handle unknown event type parameter
Mathieu Desnoyers [Tue, 26 Nov 2013 00:40:44 +0000 (19:40 -0500)] 
Fix: handle unknown event type parameter

Skip to an error path if the event type is unknown.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: eliminate timestamp overlap between packets
Mathieu Desnoyers [Sun, 24 Nov 2013 09:09:04 +0000 (04:09 -0500)] 
Fix: eliminate timestamp overlap between packets

By using the timestamp sampled at space reservation when the packet is
being filled as "end timestamp" for a packet, we can ensure there is no
overlap between packet timestamp ranges, so that packet timestamp end <=
following packets timestamp begin.

Overlap between consecutive packets becomes an issue when the end
timestamp of a packet is greater than the end timestamp of a following
packet, IOW a packet completely contains the timestamp range of a
following packet.  This kind of situation does not allow trace viewers
to do binary search within the packet timestamps. This kind of situation
will typically never occur if packets are significantly larger than
event size, but this fix ensures it can never even theoretically happen.

The only case where packets can still theoretically overlap is if they
have equal begin and end timestamps, which is valid.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agogcc blacklist: only apply when building with gcc
Mathieu Desnoyers [Sun, 24 Nov 2013 08:42:22 +0000 (03:42 -0500)] 
gcc blacklist: only apply when building with gcc

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoBlacklist ARM gcc 4.8.0, 4.8.1, 4.8.2
Mathieu Desnoyers [Sun, 24 Nov 2013 08:28:10 +0000 (03:28 -0500)] 
Blacklist ARM gcc 4.8.0, 4.8.1, 4.8.2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.2.3 v2.2.3
Mathieu Desnoyers [Tue, 12 Nov 2013 17:02:53 +0000 (12:02 -0500)] 
Version 2.2.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agolttng-statedump-impl: Fix lttng_list_interrupts for empty implementation
Otavio Salvador [Sat, 26 Oct 2013 19:22:45 +0000 (17:22 -0200)] 
lttng-statedump-impl: Fix lttng_list_interrupts for empty implementation

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoImport fix from LTSI: 3.4+ RT kernels use CONFIG_PREEMPT_RT_FULL
Mathieu Desnoyers [Tue, 15 Oct 2013 12:14:14 +0000 (08:14 -0400)] 
Import fix from LTSI: 3.4+ RT kernels use CONFIG_PREEMPT_RT_FULL

Initial LTSI commit:

From: Paul Gortmaker <paul.gortmaker@windriver.com>
> fix reference to obsolete RT Kconfig variable.
>
> The preempt-rt patches no longer use CONFIG_PREEMPT_RT in
> the 3.4 (and newer) versions.  So even though LTSI doesn't
> include RT, having this define present can lead to an easy
> to overlook bug for anyone who does try to layer RT onto
> the LTSI baseline.
>
> Update it to use the currently used define name by RT.
>
> Reported-by: Jim Somerville <Jim.Somerville@windriver.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Merged with kernel version checks for >= 3.4 to support both old and
newer kernels.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.2.2 v2.2.2
Mathieu Desnoyers [Sat, 28 Sep 2013 22:30:41 +0000 (18:30 -0400)] 
Version 2.2.2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoBlacklist kernels 3.10.13 and 3.11.2
Mathieu Desnoyers [Fri, 27 Sep 2013 18:10:40 +0000 (14:10 -0400)] 
Blacklist kernels 3.10.13 and 3.11.2

It looks like my guessing on kernel version at which Greg will pull this
fix was wrong. It will probably appear in the next round of stable
releases.

The fix that needs to reach stable-3.10 and stable-3.11 before we can
remove those from the backlist:

commit 7bd36014460f793c19e7d6c94dab67b0afcfcb7f
Author: John Stultz <john.stultz@linaro.org>
Date:   Wed Sep 11 16:50:56 2013 -0700

    timekeeping: Fix HRTICK related deadlock from ntp lock changes

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: John Stultz <john.stultz@linaro.org>
10 years agoLTTng trace-clock: shrink kernel blacklist
Mathieu Desnoyers [Thu, 19 Sep 2013 18:59:48 +0000 (13:59 -0500)] 
LTTng trace-clock: shrink kernel blacklist

The lockup fix has been pulled into Linux master as:

commit 7bd36014460f793c19e7d6c94dab67b0afcfcb7f
Author: John Stultz <john.stultz@linaro.org>
Date:   Wed Sep 11 16:50:56 2013 -0700

    timekeeping: Fix HRTICK related deadlock from ntp lock changes

Guessing the stable kernel versions in which this fix will appear in
3.10 and 3.11 stable. 3.12+ are OK.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: John Stultz <john.stultz@linaro.org>
10 years agoBlacklist Linux kernels 3.10+
Mathieu Desnoyers [Mon, 16 Sep 2013 16:10:04 +0000 (11:10 -0500)] 
Blacklist Linux kernels 3.10+

Linux kernels 3.10 and 3.11 introduce a deadlock in the timekeeping
subsystem. See
http://lkml.kernel.org/r/1378943457-27314-1-git-send-email-john.stultz@linaro.org
for details. Awaiting patch merge into Linux master, stable-3.10 and
stable-3.11 for fine-grained kernel version blacklisting.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.2.1 v2.2.1
Mathieu Desnoyers [Thu, 11 Jul 2013 18:05:25 +0000 (14:05 -0400)] 
Version 2.2.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: double length of __dynamic_len array
Mathieu Desnoyers [Fri, 5 Jul 2013 02:20:25 +0000 (22:20 -0400)] 
Fix: double length of __dynamic_len array

This is required by the newly introduced __dynamic_array_enc_ext_2() and
tp_memcpy_dyn_2().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix printk instrumentation
Mathieu Desnoyers [Thu, 4 Jul 2013 19:46:20 +0000 (15:46 -0400)] 
Fix printk instrumentation

- Don't require 2kB of stack anymore (requiring so much kernel stack
  space should be considered as a bug in itself),
- Add support for 3.10 kernel printk instrumentation.

This patch uses "Introduce __dynamic_array_enc_ext_2() and
tp_memcpy_dyn_2()".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoIntroduce __dynamic_array_enc_ext_2() and tp_memcpy_dyn_2()
Mathieu Desnoyers [Thu, 4 Jul 2013 19:45:20 +0000 (15:45 -0400)] 
Introduce __dynamic_array_enc_ext_2() and tp_memcpy_dyn_2()

Allow copying into a single variable-length buffer from two sources.
Needed to fix printk support for Linux kernel < 3.5.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: ring buffer: get_subbuf() checks should be performed on "consumed" parameter
Mathieu Desnoyers [Wed, 3 Jul 2013 22:35:10 +0000 (18:35 -0400)] 
Fix: ring buffer: get_subbuf() checks should be performed on "consumed" parameter

This triggers lots of false-positive -EAGAIN errors in flight recorder
snapshots.

Reported-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: SWITCH_FLUSH new sub-buffer checks
Mathieu Desnoyers [Mon, 1 Jul 2013 22:10:22 +0000 (18:10 -0400)] 
Fix: SWITCH_FLUSH new sub-buffer checks

The SWITCH_FLUSH, when performed on a completely empty sub-buffer, was
missing some checks (imported from space reservation).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: ring buffer: handle concurrent update in nested buffer wrap around check
Mathieu Desnoyers [Mon, 1 Jul 2013 21:01:56 +0000 (17:01 -0400)] 
Fix: ring buffer: handle concurrent update in nested buffer wrap around check

With stress-test loads that trigger sub-buffer switch very frequently
(small 4kB sub-buffers, frequent flush), we currently observe this kind
of warnings once every few minutes:

[65335.896208] ring buffer relay-overwrite-mmap, cpu 5: records were lost. Caused by:
[65335.896208]   [ 0 buffer full, 1 nest buffer wrap-around, 0 event too big ]

It appears that the check for nested buffer wrap-around does not take
into account that a concurrent execution contexts (either nested for
per-cpu buffers, or from another CPU or nested for global buffers) can
update the commit_count value concurrently.

What we really want to do with this check is to ensure that if we enter
a sub-buffer that had an unbalanced reserve/commit count, assuming there
is no hope that this gets rebalanced promptly, we detect this and drop
the current event. However, in the case where the commit counter has
been concurrently updated by another reserve or a switch, we want to
retry the entire reserve operation.

One way to detect this is to sample the reserve offset twice, around the
commit counter read, along with the appropriate memory barriers.
Therefore, we can detect if the mismatch between reserve and commit
counter is actually caused by a concurrent update, which necessarily has
updated the reserve counter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: handle writes of length 0
Mathieu Desnoyers [Sun, 30 Jun 2013 21:38:50 +0000 (17:38 -0400)] 
Fix: handle writes of length 0

lib_ring_buffer_write(), lib_ring_buffer_memset() and
lib_ring_buffer_copy_from_user_inatomic() could be passed a length of 0.
This typically has no side-effect as far as writing into the buffers is
concerned, except for one detail: in overwrite mode, there is a check to
make sure the sub-buffer can be written into. This check is performed
even if length is 0. In the case where this would fall exactly at the
end of a sub-buffer, the check would fail, because the offset would fall
exactly at the beginning of the next sub-buffer.

It triggers this warning:

[65356.890016] ------------[ cut here ]------------
[65356.890016] WARNING: at /home/compudj/git/lttng-modules/wrapper/ringbuffer/../../lib/ringbuffer/../../wrapper/ringbuffer/../../lib/ringbuffer/backend.h:110 lttng_event_write+0x118/0x140 [lttng_ring_buffer_client_mmap_overwrite]()
[65356.890016] Hardware name: X7DAL
[65356.890016] Modules linked in: lttng_probe_writeback(O) lttng_probe_workqueue(O) lttng_probe_vmscan(O) lttng_probe_udp(O) lttng_probe_timer(O) lttng_probe_sunrpc(O) lttng_probe_statedump(O) lttng_probe_sock(O) lttng_probe_skb(O) lttng_probe_signal(O) lttng_probe_scsi(O) lttng_probe_sched(O) lttng_probe_rcu(O) lttng_probe_random(O) lttng_probe_printk(O) lttng_probe_power(O) lttng_probe_net(O) lttng_probe_napi(O) lttng_probe_module(O) lttng_probe_kvm(O) lttng_probe_kmem(O) lttng_probe_jbd2(O) lttng_probe_jbd(O) lttng_probe_irq(O) lttng_probe_ext4(O) lttng_probe_ext3(O) lttng_probe_compaction(O) lttng_probe_btrfs(O) lttng_probe_block(O) lttng_types(O) lttng_ring_buffer_metadata_mmap_client(O) lttng_ring_buffer_client_mmap_overwrite(O) lttng_ring_buffer_client_mmap_discard(O) lttng_ring_buffer_metadata_client(O) lttng_ring_buffer_client_overwrite(O) lttng_ring_buffer_client_discard(O) lttng_tracer(O) lttng_kretprobes(O) lttng_ftrace(O) lttng_kprobes(O) lttng_statedump(O) lttng_lib_ring_buffer(O) cpufreq_ondemand loop e1000e kvm_intel kvm ptp pps_core [last unloaded: lttng_lib_ring_buffer]
[65357.287529] Pid: 0, comm: swapper/7 Tainted: G           O 3.9.4-trace-test #143
[65357.309694] Call Trace:
[65357.317022]  <IRQ>  [<ffffffff8103a3ef>] warn_slowpath_common+0x7f/0xc0
[65357.336893]  [<ffffffff8103a44a>] warn_slowpath_null+0x1a/0x20
[65357.354368]  [<ffffffffa0ff17b8>] lttng_event_write+0x118/0x140 [lttng_ring_buffer_client_mmap_overwrite]
[65357.383025]  [<ffffffffa100134f>] __event_probe__block_rq_with_error+0x1bf/0x220 [lttng_probe_block]
[65357.410376]  [<ffffffff812ea134>] blk_update_request+0x324/0x720
[65357.428364]  [<ffffffff812ea561>] blk_update_bidi_request+0x31/0x90
[65357.447136]  [<ffffffff812eb68c>] blk_end_bidi_request+0x2c/0x80
[65357.465127]  [<ffffffff812eb6f0>] blk_end_request+0x10/0x20
[65357.481822]  [<ffffffff81406b7c>] scsi_io_completion+0x9c/0x670
[65357.499555]  [<ffffffff813fe320>] scsi_finish_command+0xb0/0xe0
[65357.517283]  [<ffffffff81406965>] scsi_softirq_done+0xa5/0x140
[65357.534758]  [<ffffffff812f1d30>] blk_done_softirq+0x80/0xa0
[65357.551710]  [<ffffffff81043b00>] __do_softirq+0xe0/0x440
[65357.567881]  [<ffffffff81043ffe>] irq_exit+0x9e/0xb0
[65357.582754]  [<ffffffff81026465>] smp_call_function_single_interrupt+0x35/0x40
[65357.604388]  [<ffffffff8167be2f>] call_function_single_interrupt+0x6f/0x80
[65357.624976]  <EOI>  [<ffffffff8100ac06>] ? default_idle+0x46/0x300
[65357.643541]  [<ffffffff8100ac04>] ? default_idle+0x44/0x300
[65357.660235]  [<ffffffff8100b899>] cpu_idle+0x89/0xe0
[65357.675109]  [<ffffffff81664911>] start_secondary+0x220/0x227

Always from an event that can write a 0-length field as last field of
its payload, and it always happen directly on a sub-buffer boundary.

While we are there, check for length 0 in lib_ring_buffer_read_cstr()
too.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: ring buffer: RING_BUFFER_FLUSH ioctl buffer corruption
Mathieu Desnoyers [Sun, 30 Jun 2013 19:37:46 +0000 (15:37 -0400)] 
Fix: ring buffer: RING_BUFFER_FLUSH ioctl buffer corruption

lib_ring_buffer_switch_slow() clearly states:

 * Note, however, that as a v_cmpxchg is used for some atomic
 * operations, this function must be called from the CPU which owns the
 * buffer for a ACTIVE flush.

But unfortunately, the RING_BUFFER_FLUSH ioctl does not follow these
important directives. Therefore, whenever the consumer daemon or session
daemon explicitly triggers a "flush" on a buffer, it can race with data
being written to the buffer, leading to corruption of the reserve/commit
counters, and therefore corruption of data in the buffer. It triggers
these warnings for overwrite mode buffers:

[65356.890016] WARNING: at
/home/compudj/git/lttng-modules/wrapper/ringbuffer/../../lib/ringbuffer/../../wrapper/ringbuffer/../../lib/ringbuffer/backend.h:110 lttng_event_write+0x118/0x140 [lttng_ring_buffer_client_mmap_overwrite]()

Which indicates that we are trying to write into a sub-buffer for which
we don't have exclusive access. It also causes the following warnings to
show up:

[65335.896208] ring buffer relay-overwrite-mmap, cpu 5: records were lost. Caused by:
[65335.896208]   [ 0 buffer full, 80910 nest buffer wrap-around, 0 event too big ]

Which is caused by corrupted commit counter.

Fix this by sending an IPI to the CPU owning the flushed buffer for
per-cpu synchronization. For global synchronization, no IPI is needed,
since we allow writes from remote CPUs.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.2.0 v2.2.0
Mathieu Desnoyers [Tue, 25 Jun 2013 21:53:38 +0000 (17:53 -0400)] 
Version 2.2.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoUpdate README
Mathieu Desnoyers [Tue, 25 Jun 2013 21:53:17 +0000 (17:53 -0400)] 
Update README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.2.0-rc3 v2.2.0-rc3
Mathieu Desnoyers [Wed, 19 Jun 2013 01:29:22 +0000 (21:29 -0400)] 
Version 2.2.0-rc3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix CPU hotplug section mismatches
Jan Glauber [Thu, 23 May 2013 11:35:16 +0000 (07:35 -0400)] 
Fix CPU hotplug section mismatches

Get rid of the following section mismatches:

WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lttng-tracer.o(.text+0x19dc0): Section mismatch in reference from the function lttng_add_perf_counter_to_ctx() to the function .cpuinit.text:lttng_perf_counter_cpu_hp_callback()
The function lttng_add_perf_counter_to_ctx() references
the function __cpuinit lttng_perf_counter_cpu_hp_callback().
This is often because lttng_add_perf_counter_to_ctx lacks a __cpuinit
annotation or the annotation of lttng_perf_counter_cpu_hp_callback is wrong.

WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x1204): Section mismatch in reference from the function channel_backend_init() to the function .cpuinit.text:lib_ring_buffer_cpu_hp_callback()
The function channel_backend_init() references
the function __cpuinit lib_ring_buffer_cpu_hp_callback().
This is often because channel_backend_init lacks a __cpuinit
annotation or the annotation of lib_ring_buffer_cpu_hp_callback is wrong.

WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x269c): Section mismatch in reference from the function channel_create() to the function .cpuinit.text:lib_ring_buffer_cpu_hp_callback()
The function channel_create() references
the function __cpuinit lib_ring_buffer_cpu_hp_callback().
This is often because channel_create lacks a __cpuinit
annotation or the annotation of lib_ring_buffer_cpu_hp_callback is wrong.

WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x4a1c): Section mismatch in reference from the function channel_iterator_init() to the function .cpuinit.text:channel_iterator_cpu_hotplug()
The function channel_iterator_init() references
the function __cpuinit channel_iterator_cpu_hotplug().
This is often because channel_iterator_init lacks a __cpuinit
annotation or the annotation of channel_iterator_cpu_hotplug is wrong.

Signed-off-by: Jan Glauber <jan.glauber@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoRemove useless lttng_metadata probe
Julien Desfossez [Wed, 8 May 2013 14:09:19 +0000 (10:09 -0400)] 
Remove useless lttng_metadata probe

We don't use this event anymore since we write the metadata directly
into the ring buffer, no need for an external event. This probe was
the only one in the lttng-probe-lttng module, so we can get rid of
this module as well.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix build and load against linux-2.6.33.x
Samuel Martin [Mon, 17 Jun 2013 14:28:51 +0000 (10:28 -0400)] 
Fix build and load against linux-2.6.33.x

* lttng-event.h declared but did not implement
  lttng_add_perf_counter_to_ctx on kernel >=2.6.33, the implementation
  was in lttng-context-perf-counters.c, which was only included for
  kernel >=2.6.34.  This prevented the module from being loaded.

* on kernel 2.6.33.x, lttng-context-perf-counters.c complains about
  implicit declaration for {get,put}_online_cpus and
  {,un}register_cpu_notifier; so fix header inclusion.

Signed-off-by: Samuel Martin <smartin@aldebaran-robotics.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agofix block instrumentation probe signature mismatch for 3.9.x kernels
Mathieu Desnoyers [Thu, 6 Jun 2013 14:02:47 +0000 (10:02 -0400)] 
fix block instrumentation probe signature mismatch for 3.9.x kernels

Was causing OOPS when tracing the block layer.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 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>
10 years agoUpdate rcu instrumentation to 3.9.[0-4]
Mathieu Desnoyers [Wed, 5 Jun 2013 21:56:03 +0000 (17:56 -0400)] 
Update rcu instrumentation to 3.9.[0-4]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoRemove bashism in lttng-syscalls-generate-headers.sh
Jon Bernard [Mon, 13 May 2013 15:38:17 +0000 (11:38 -0400)] 
Remove bashism in lttng-syscalls-generate-headers.sh

Options to echo are not portable. In particular, the 'echo -e' option is
implemented by some shells, including bash, to expand escape sequences.
However, dash is one of the other family of shells that instead expands
escape sequences by default.

The printf command is portable and much more reliable.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 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>
10 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>
10 years agoRevert "Stop build if CONFIG_TRACEPOINTS is not set"
Mathieu Desnoyers [Thu, 25 Apr 2013 19:11:43 +0000 (15:11 -0400)] 
Revert "Stop build if CONFIG_TRACEPOINTS is not set"

This reverts commit 699f9673466e1a6537ad23cc697b79660639f260.

It breaks make clean.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoStop build if CONFIG_TRACEPOINTS is not set
Samu Voutilainen [Mon, 22 Apr 2013 17:05:05 +0000 (13:05 -0400)] 
Stop build if CONFIG_TRACEPOINTS is not set

Previously it just tries to compile with zero modules, which is
confusing if you thought you had configured everything correctly. Now it
throws an error which tells which went wrong.

Fixes #506

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAdd comments to endifs.
Samu Voutilainen [Mon, 22 Apr 2013 17:03:52 +0000 (13:03 -0400)] 
Add comments to endifs.

This should make it easier to read construction of the makefile.

Refs #506

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: remove ARM set_tls system call override
Mathieu Desnoyers [Wed, 10 Apr 2013 16:14:38 +0000 (12:14 -0400)] 
Fix: remove ARM set_tls system call override

We'll need to find a better way to instrument ARM-specific system calls
located at a far offset from the standard systems calls. A 16MB
lttng-modules kernel module is really not acceptable.

Removing this instrumentation for now. sys_set_tls will appear as
sys_unknown.

Fixes #472

CC: Ryan Kyser <Ryan.Kyser@jci.com>
Ref: http://lists.lttng.org/pipermail/lttng-dev/2013-April/019990.html
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup: arm sys_mmap whitespace
Mathieu Desnoyers [Wed, 10 Apr 2013 16:14:15 +0000 (12:14 -0400)] 
Cleanup: arm sys_mmap whitespace

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoClean up using global_dirty_limit wrapper for writeback probe
Andrew Gabbasov [Tue, 2 Apr 2013 13:25:37 +0000 (09:25 -0400)] 
Clean up using global_dirty_limit wrapper for writeback probe

Move the wrapper around reading of global_dirty_limit to /wrapper/
directory.  Introduce a new kallsyms_lookup_dataptr function for
obtaining the address unchanged and use it in global_dirty_limit
wrapper.  Since the data address is available only if
CONFIG_KALLSYMS_ALL is set, omit the whole probe from building if this
config is missing.

[ Edit by Mathieu Desnoyers: small coding style fixes ]

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoVersion 2.2.0-rc1 v2.2.0-rc1
Mathieu Desnoyers [Sat, 30 Mar 2013 02:35:56 +0000 (22:35 -0400)] 
Version 2.2.0-rc1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate README
Mathieu Desnoyers [Sat, 30 Mar 2013 02:32:13 +0000 (22:32 -0400)] 
Update README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: vmscan instrumentation build
Mathieu Desnoyers [Sat, 30 Mar 2013 02:12:42 +0000 (22:12 -0400)] 
Fix: vmscan instrumentation build

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agowriteback instrumentation: remove duplicated structures
Mathieu Desnoyers [Sat, 30 Mar 2013 01:45:17 +0000 (21:45 -0400)] 
writeback instrumentation: remove duplicated structures

Don't replicate internal structures from the kernel: this is asking for
serious trouble, and could lead to breakage if building on newer kernels
that have modified structures.

The proper approach, if we really need to extract this information,
would be to add APIs to the Linux kernel workqueue that allow getting
this information.

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 agorcu: update to 3.9 rc kernel instrumentation
Mathieu Desnoyers [Sat, 30 Mar 2013 01:32:47 +0000 (21:32 -0400)] 
rcu: update to 3.9 rc kernel instrumentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoworkqueue instrumentation: remove duplicated structures
Mathieu Desnoyers [Sat, 30 Mar 2013 00:47:25 +0000 (20:47 -0400)] 
workqueue instrumentation: remove duplicated structures

Don't replicate internal structures from the kernel: this is asking for
serious trouble, and could lead to breakage if building on newer kernels
that have modified structures.

The proper approach, if we really need to extract this information,
would be to add APIs to the Linux kernel workqueue that allow getting
this information.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRename odd event names
Mathieu Desnoyers [Sat, 30 Mar 2013 00:39:34 +0000 (20:39 -0400)] 
Rename odd event names

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoIntroduce API to remap event names exposed by LTTng
Mathieu Desnoyers [Sat, 30 Mar 2013 00:38:18 +0000 (20:38 -0400)] 
Introduce API to remap event names exposed by LTTng

Some kernel event providers don't follow naming hierarchy. Rename them
internally within LTTng.

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:56:13 +0000 (09:56 -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 Linux 3.8 btrfs probe warning
Mathieu Desnoyers [Wed, 13 Mar 2013 19:04:56 +0000 (15:04 -0400)] 
Fix Linux 3.8 btrfs probe warning

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix Linux 3.8 ext4 probe support
Mathieu Desnoyers [Wed, 13 Mar 2013 18:56:49 +0000 (14:56 -0400)] 
Fix Linux 3.8 ext4 probe support

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 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 agoinstrumentation sched: add missing fork pid info
Mathieu Desnoyers [Fri, 22 Feb 2013 16:18:50 +0000 (11:18 -0500)] 
instrumentation sched: add missing fork pid info

Fixes #434

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 agoinstrumentation: sync with Linux commit a1ce392
Francis Giraldeau [Mon, 28 Jan 2013 16:21:43 +0000 (11:21 -0500)] 
instrumentation: sync with Linux commit a1ce392

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 agoInstrumentation cleanup: kmem events should print hex pointers
Mathieu Desnoyers [Mon, 21 Jan 2013 19:00:41 +0000 (14:00 -0500)] 
Instrumentation cleanup: kmem events should print hex pointers

Fixes #422

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix compilation of ext4 and btrfs tracepoints on 2.6.40 kernels
Simon Marchi [Thu, 10 Jan 2013 23:12:27 +0000 (18:12 -0500)] 
Fix compilation of ext4 and btrfs tracepoints on 2.6.40 kernels

See f95480cf62e9acb42b74fce162544694b76c9704.

The new btrfs and ext4 tracepoints used 3.0.0 in the compilation logic.

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 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 agoAdd new kernel probes instrumentation
Andrew Gabbasov [Mon, 10 Dec 2012 16:14:52 +0000 (11:14 -0500)] 
Add new kernel probes instrumentation

Add kernel probes for btrfs, compaction, ext4, printk, random, rcu,
regmap, rpm, sunrpc, workqueue, writeback.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate kernel probes to more detailed match to kernel versions
Andrew Gabbasov [Mon, 10 Dec 2012 16:12:14 +0000 (11:12 -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>
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>
11 years agoUpdate sites using kernel version checking macro to new range
Andrew Gabbasov [Tue, 27 Nov 2012 16:44:17 +0000 (17:44 +0100)] 
Update sites using kernel version checking macro to new range

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoMake upper bound of kernel version checking macro exclusive
Andrew Gabbasov [Tue, 27 Nov 2012 16:43:38 +0000 (17:43 +0100)] 
Make upper bound of kernel version checking macro exclusive

It's more usable to have the upper limit exclusive. It helps to avoid
hardcoding of stable branch highest version number, i.e. having a range
from 3.1.0 up to 3.2.0 (exclusively) gives us all 3.1.x versions.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agosock instrumentation: fix fields to get referenced values
Andrew Gabbasov [Sun, 25 Nov 2012 21:13:16 +0000 (16:13 -0500)] 
sock instrumentation: fix fields to get referenced values

Due to specific of passing values in lttng-modules, if it is supposed
to display the values, passing a pointer will not be enough,
we need to store the actual values.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoext3 instrumentation: fix of assignment code conversion
Andrew Gabbasov [Sun, 25 Nov 2012 21:12:46 +0000 (16:12 -0500)] 
ext3 instrumentation: fix of assignment code conversion

Due to specifics of handling assignment code in lttng-modules,
plain code in TP_fast_assign (outside tp_* macros) will not be reached.
Everything should be enclosed into tp_* fragments.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agosched instrumentation: rename "pid" fields in sched_process_exec
Andrew Gabbasov [Sun, 25 Nov 2012 21:12:18 +0000 (16:12 -0500)] 
sched instrumentation: rename "pid" fields in sched_process_exec

Rename "pid" to "tid" fields in new code, similarly to what was
done earlier for all sched tracepoints.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove remaining semicolons in TP_fast_assign blocks
Andrew Gabbasov [Sun, 25 Nov 2012 21:11:33 +0000 (16:11 -0500)] 
Remove remaining semicolons in TP_fast_assign blocks

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix compilation for 3.0 kernels that are named 2.6.40
Simon Marchi [Fri, 23 Nov 2012 23:11:04 +0000 (18:11 -0500)] 
Fix compilation for 3.0 kernels that are named 2.6.40

Since some distro released the 3.0 kernel as 2.6.40, it might be useful
to adjust some checks to treat 2.6.40 kernels as 3.0.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix compilation for 3.0 branch (>= 3.0.39)
Simon Marchi [Fri, 23 Nov 2012 23:10:38 +0000 (18:10 -0500)] 
Fix compilation for 3.0 branch (>= 3.0.39)

The isolate_mode_t type that appeared in 3.2 was backported to 3.0.39 so
the version check must be fixed. It was not backported to the 3.1 branch
though, so it must be excluded.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd kernel version checking macro
Mathieu Desnoyers [Fri, 23 Nov 2012 20:05:12 +0000 (15:05 -0500)] 
Add kernel version checking macro

It contains a macro to help checking for kernel version ranges.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove semicolons in TP_fast_assign blocks
Paul Woegerer [Wed, 14 Nov 2012 16:04:46 +0000 (11:04 -0500)] 
Remove semicolons in TP_fast_assign blocks

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd ifdefs to net probe to support Linux 2.6.39
Paul Woegerer [Wed, 14 Nov 2012 16:03:42 +0000 (11:03 -0500)] 
Add ifdefs to net probe to support Linux 2.6.39

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd kernel probes for supplementary subsystems
Paul Woegerer [Wed, 14 Nov 2012 16:02:46 +0000 (11:02 -0500)] 
Add kernel probes for supplementary subsystems

Add probes for: asoc, ext3, gpio, jbd, jbd2, kmem, lock, module, napi,
net, power, regulator, scsi, skb, sock, udp, vmscan subsystems.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
This page took 0.046462 seconds and 4 git commands to generate.