Fix exec instrumentation: only for kernels 3.4.0 and higher

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
Add ifdefs to net probe to support Linux 2.6.39

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Remove semicolons in TP_fast_assign blocks

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add missing MIT license text to 3 files under this license

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
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>
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>
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>