lttng-modules.git
6 years agoVersion 2.9.4 v2.9.4
Mathieu Desnoyers [Tue, 3 Oct 2017 18:37:51 +0000 (14:37 -0400)] 
Version 2.9.4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: version check error in btrfs instrumentation
Michael Jeanson [Fri, 29 Sep 2017 20:40:36 +0000 (16:40 -0400)] 
Fix: version check error in btrfs instrumentation

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update btrfs instrumentation for kernel 4.14
Michael Jeanson [Wed, 20 Sep 2017 16:12:41 +0000 (12:12 -0400)] 
Fix: update btrfs instrumentation for kernel 4.14

See upstream commit:

  Author: Jeff Mahoney <jeffm@suse.com>
  Date:   Wed Jun 28 21:56:54 2017 -0600

    btrfs: constify tracepoint arguments

    Tracepoint arguments are all read-only.  If we mark the arguments
    as const, we're able to keep or convert those arguments to const
    where appropriate.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update writeback instrumentation for kernel 4.14
Michael Jeanson [Wed, 20 Sep 2017 16:12:40 +0000 (12:12 -0400)] 
Fix: update writeback instrumentation for kernel 4.14

See upstream commits:

  commit 11fb998986a72aa7e997d96d63d52582a01228c5
  Author: Mel Gorman <mgorman@techsingularity.net>
  Date:   Thu Jul 28 15:46:20 2016 -0700

    mm: move most file-based accounting to the node

    There are now a number of accounting oddities such as mapped file pages
    being accounted for on the node while the total number of file pages are
    accounted on the zone.  This can be coped with to some extent but it's
    confusing so this patch moves the relevant file-based accounted.  Due to
    throttling logic in the page allocator for reliable OOM detection, it is
    still necessary to track dirty and writeback pages on a per-zone basis.

  commit c4a25635b60d08853a3e4eaae3ab34419a36cfa2
  Author: Mel Gorman <mgorman@techsingularity.net>
  Date:   Thu Jul 28 15:46:23 2016 -0700

    mm: move vmscan writes and file write accounting to the node

    As reclaim is now node-based, it follows that page write activity due to
    page reclaim should also be accounted for on the node.  For consistency,
    also account page writes and page dirtying on a per-node basis.

    After this patch, there are a few remaining zone counters that may appear
    strange but are fine.  NUMA stats are still per-zone as this is a
    user-space interface that tools consume.  NR_MLOCK, NR_SLAB_*,
    NR_PAGETABLE, NR_KERNEL_STACK and NR_BOUNCE are all allocations that
    potentially pin low memory and cannot trivially be reclaimed on demand.
    This information is still useful for debugging a page allocation failure
    warning.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update block instrumentation for kernel 4.14
Michael Jeanson [Wed, 20 Sep 2017 16:12:39 +0000 (12:12 -0400)] 
Fix: update block instrumentation for kernel 4.14

See upstream commit:

  commit 74d46992e0d9dee7f1f376de0d56d31614c8a17a
  Author: Christoph Hellwig <hch@lst.de>
  Date:   Wed Aug 23 19:10:32 2017 +0200

    block: replace bi_bdev with a gendisk pointer and partitions index

    This way we don't need a block_device structure to submit I/O.  The
    block_device has different life time rules from the gendisk and
    request_queue and is usually only available when the block device node
    is open.  Other callers need to explicitly create one (e.g. the lightnvm
    passthrough code, or the new nvme multipathing code).

    For the actual I/O path all that we need is the gendisk, which exists
    once per block device.  But given that the block layer also does
    partition remapping we additionally need a partition index, which is
    used for said remapping in generic_make_request.

    Note that all the block drivers generally want request_queue or
    sometimes the gendisk, so this removes a layer of indirection all
    over the stack.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: vmalloc wrapper on kernel < 2.6.38
Michael Jeanson [Tue, 26 Sep 2017 18:16:47 +0000 (14:16 -0400)] 
Fix: vmalloc wrapper on kernel < 2.6.38

Ensure that all probes end up including the vmalloc wrapper through the
lttng-tracer.h header so the trace_*() static inlines are generated
through inclusion of include/trace/events/kmem.h before we define
CREATE_TRACE_POINTS.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: vmalloc wrapper on kernel >= 4.12
Michael Jeanson [Tue, 26 Sep 2017 17:46:30 +0000 (13:46 -0400)] 
Fix: vmalloc wrapper on kernel >= 4.12

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoAdd kmalloc failover to vmalloc
Michael Jeanson [Mon, 25 Sep 2017 14:56:20 +0000 (10:56 -0400)] 
Add kmalloc failover to vmalloc

This patch is based on the kvmalloc helpers introduced in kernel 4.12.

It will gracefully failover memory allocations of more than one page to
vmalloc for systems under high memory pressure or fragmentation.

See Linux kernel commit:
  commit a7c3e901a46ff54c016d040847eda598a9e3e653
  Author: Michal Hocko <mhocko@suse.com>
  Date:   Mon May 8 15:57:09 2017 -0700

    mm: introduce kv[mz]alloc helpers

    Patch series "kvmalloc", v5.

    There are many open coded kmalloc with vmalloc fallback instances in the
    tree.  Most of them are not careful enough or simply do not care about
    the underlying semantic of the kmalloc/page allocator which means that
    a) some vmalloc fallbacks are basically unreachable because the kmalloc
    part will keep retrying until it succeeds b) the page allocator can
    invoke a really disruptive steps like the OOM killer to move forward
    which doesn't sound appropriate when we consider that the vmalloc
    fallback is available.

    As it can be seen implementing kvmalloc requires quite an intimate
    knowledge if the page allocator and the memory reclaim internals which
    strongly suggests that a helper should be implemented in the memory
    subsystem proper.

    Most callers, I could find, have been converted to use the helper
    instead.  This is patch 6.  There are some more relying on __GFP_REPEAT
    in the networking stack which I have converted as well and Eric Dumazet
    was not opposed [2] to convert them as well.

    [1] http://lkml.kernel.org/r/20170130094940.13546-1-mhocko@kernel.org
    [2] http://lkml.kernel.org/r/1485273626.16328.301.camel@edumazet-glaptop3.roam.corp.google.com

    This patch (of 9):

    Using kmalloc with the vmalloc fallback for larger allocations is a
    common pattern in the kernel code.  Yet we do not have any common helper
    for that and so users have invented their own helpers.  Some of them are
    really creative when doing so.  Let's just add kv[mz]alloc and make sure
    it is implemented properly.  This implementation makes sure to not make
    a large memory pressure for > PAGE_SZE requests (__GFP_NORETRY) and also
    to not warn about allocation failures.  This also rules out the OOM
    killer as the vmalloc is a more approapriate fallback than a disruptive
    user visible action.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: mmap: caches aliased on virtual addresses
Mathieu Desnoyers [Tue, 19 Sep 2017 16:16:58 +0000 (12:16 -0400)] 
Fix: mmap: caches aliased on virtual addresses

Some architectures (e.g. implementations of arm64) implement their
caches based on the virtual addresses (rather than physical address).
It has the upside of making the cache access faster (no TLB lookup
required to access the cache line), but the downside of requiring
virtual mappings (e.g. kernel vs user-space) to be aligned on the number
of bits used for cache aliasing.

Perform dcache flushing for the entire sub-buffer in the get_subbuf
operation on those architectures, thus ensuring we don't end up with
cache aliasing issues.

An alternative approach we could eventually take would be to create a
kernel mapping for the ring buffer that is aligned with the user-space
mapping.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update ext4 instrumentation for kernel 4.13
Michael Jeanson [Mon, 21 Aug 2017 18:47:08 +0000 (14:47 -0400)] 
Fix: update ext4 instrumentation for kernel 4.13

See this upstream commit :

  commit a627b0a7c15ee4d2c87a86d5be5c8167382e8d0d
  Author: Eric Whitney <enwlinux@gmail.com>
  Date:   Sun Jul 30 22:30:11 2017 -0400

      ext4: remove unused metadata accounting variables

      Two variables in ext4_inode_info, i_reserved_meta_blocks and
      i_allocated_meta_blocks, are unused.  Removing them saves a little
      memory per in-memory inode and cleans up clutter in several tracepoints.
      Adjust tracepoint output from ext4_alloc_da_blocks() for consistency
      and fix a typo and whitespace near these changes.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: Sleeping function called from invalid context
Mathieu Desnoyers [Fri, 21 Jul 2017 12:22:04 +0000 (08:22 -0400)] 
Fix: Sleeping function called from invalid context

It affects system call instrumentation for accept, accept4 and connect,
only on the x86-64 architecture.

We need to use the LTTng accessing functions to touch user-space memory,
which take care of disabling the page fault handler, so we don't preempt
while in preempt-off context (tracepoints disable preemption).

Fixes #1111

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: sched for v4.11.5-rt1
Michael Jeanson [Mon, 10 Jul 2017 22:13:11 +0000 (18:13 -0400)] 
Fix: sched for v4.11.5-rt1

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: handle missing ftrace header on v4.12
Michael Jeanson [Fri, 23 Jun 2017 18:29:42 +0000 (14:29 -0400)] 
Fix: handle missing ftrace header on v4.12

Properly handle the case where we build against the distro headers of a
kernel >= 4.12 and ftrace is enabled but the private header is
unavailable.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoVersion 2.9.3 v2.9.3
Mathieu Desnoyers [Mon, 12 Jun 2017 21:47:32 +0000 (17:47 -0400)] 
Version 2.9.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: pid tracker should track "pgid"
Mathieu Desnoyers [Thu, 1 Jun 2017 18:24:11 +0000 (14:24 -0400)] 
Fix: pid tracker should track "pgid"

The "pid" notion exposed by LTTng translates to the "pgid" notion in the
Linux kernel. Therefore using "current->pid" as argument to the PID
tracker actually ends up behaving as a "tid" tracker, which does not
match the intent nor the user-space tracer behavior.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: Build ftrace probe on kernels prior to 4.12
Francis Deslauriers [Tue, 30 May 2017 13:36:31 +0000 (09:36 -0400)] 
Fix: Build ftrace probe on kernels prior to 4.12

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update ftrace probe for kernel 4.12
Michael Jeanson [Thu, 25 May 2017 20:56:52 +0000 (16:56 -0400)] 
Fix: update ftrace probe for kernel 4.12

Follow changes introduced by Linux upstream commits:
  ec19b85913486993d7d6f747beed1a711afd47d8
  bca6c8d0480a8aa5c86f8f416db96c71f6b79e29
  b5f081b563a6cdcb85a543df8c851951a8978275
  6e4443199e5354255e8a4c1e8e5cfc8ef064c3ce

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update block instrumentation for kernel 4.12
Michael Jeanson [Thu, 25 May 2017 20:56:51 +0000 (16:56 -0400)] 
Fix: update block instrumentation for kernel 4.12

Follow changes introduced by Linux upstream commits:
  48b77ad6084481ef9330a5d2bee289966da0975b
  cee4b7ce3f9161c88f7255a3d73c1c4d5bbabea7
  caf7df12272118e0274c8353bcfeaf60c7743a47

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: Add support for 4.9.27-rt18 kernel
Michael Jeanson [Wed, 24 May 2017 15:19:50 +0000 (11:19 -0400)] 
Fix: Add support for 4.9.27-rt18 kernel

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update btrfs instrumentation for kernel 4.12
Michael Jeanson [Tue, 23 May 2017 19:46:41 +0000 (15:46 -0400)] 
Fix: update btrfs instrumentation for kernel 4.12

See upstream commit 490b54d6fb75f6ffd0471ec58bb38a992e2b40cd

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update ringbuffer for kernel 4.12
Michael Jeanson [Tue, 23 May 2017 19:45:47 +0000 (15:45 -0400)] 
Fix: update ringbuffer for kernel 4.12

flags removed from splice_pipe_desc in 4.12.

See upstream commit f81dc7d7d5a2528f98f26a0b9406e822d0b35011

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: update sched instrumentation for kernel 4.12
Michael Jeanson [Tue, 23 May 2017 19:45:18 +0000 (15:45 -0400)] 
Fix: update sched instrumentation for kernel 4.12

See upstream commit b91473ff6e979c0028f02f90e40c844959c736d8

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: ext3 was completely removed from the kernel in v4.3
Michael Jeanson [Tue, 23 May 2017 19:43:25 +0000 (15:43 -0400)] 
Fix: ext3 was completely removed from the kernel in v4.3

Don't display the warning about missing ext3 headers on kernels >= 4.3

See upstream commit e31fb9e00543e5d3c5b686747d3c862bc09b59f3

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: NULL pointer dereference of THIS_MODULE with built-in modules
Francis Deslauriers [Wed, 17 May 2017 21:09:12 +0000 (17:09 -0400)] 
Fix: NULL pointer dereference of THIS_MODULE with built-in modules

THIS MODULE is defined to 0 when a module is built-in the kernel [1].
This caused NULL pointer dereference when booting a kernel with the
lttng-modules built-in.
To fix this issue, add #if guard around the wrapper_lttng_fixup_sig
function checking if the MODULE macro is defined to confirm that this
piece of code will end up in a module and not in the kernel itself.

[1]: linux/include/linux/export.h:32
Fixes: #1107
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: add "flush empty" ioctl for stream intersection
Mathieu Desnoyers [Thu, 11 May 2017 20:50:50 +0000 (16:50 -0400)] 
Fix: add "flush empty" ioctl for stream intersection

Changing the behavior of the "snapshot" lttng command to implicitly do a
buffer "flush" (even when current packet is empty) had unwanted
side-effects: for instance, the snapshot ABI is used by the live timer
to grab the buffer positions, and we don't want to generate useless
empty packets in that scenario.

Therefore, add the "flush empty" behavior as a new ioctl to the ring
buffer. This allows lttng-tools to perform buffer flush (even for empty
packets) when it needs to. Given that this new ioctl is added within
stable branches as well, lttng-tools always need to handle "-ENOSYS"
gracefully.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoRevert "Fix: flush empty packets on snapshot channel"
Mathieu Desnoyers [Thu, 11 May 2017 20:42:46 +0000 (16:42 -0400)] 
Revert "Fix: flush empty packets on snapshot channel"

This reverts commit dc5cd5702b74d72f0db0141c6d888a1d820aed9c.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoRevert "Fix: don't perform extra flush on metadata channel"
Mathieu Desnoyers [Thu, 11 May 2017 20:42:34 +0000 (16:42 -0400)] 
Revert "Fix: don't perform extra flush on metadata channel"

This reverts commit 7cf44d034bdda1896f6b0c6374c90c06d45ee4fd.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: remove CONFIG_KALLSYMS_ALL warning on clean
Michael Jeanson [Fri, 5 May 2017 16:08:07 +0000 (12:08 -0400)] 
Fix: remove CONFIG_KALLSYMS_ALL warning on clean

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoVersion 2.9.2 v2.9.2
Mathieu Desnoyers [Tue, 25 Apr 2017 13:56:53 +0000 (09:56 -0400)] 
Version 2.9.2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 years agoFix: Always build vmscan probe
Michael Jeanson [Thu, 20 Apr 2017 19:23:25 +0000 (15:23 -0400)] 
Fix: Always build vmscan probe

The mm/vmscan.c compile unit is a obj-y, even on an old 2.6.36 kernel,
always build the vmscan probe regardless of kernel configuration.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: use of uninitialized ret value in lttng_abi_open_metadata_stream
Francis Deslauriers [Wed, 8 Mar 2017 19:32:31 +0000 (14:32 -0500)] 
Fix: use of uninitialized ret value in lttng_abi_open_metadata_stream

Fixes the following compiler warning:

lttng-abi.c: In function ‘lttng_metadata_ioctl’:
lttng-abi.c:971:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  int ret;
      ^

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: kref changes for kernel 4.11
Francis Deslauriers [Wed, 8 Mar 2017 04:37:30 +0000 (23:37 -0500)] 
Fix: kref changes for kernel 4.11

The underlying type of `struct kref` changed in kernel 4.11 from an
atomic_t to a refcount_t. This change was introduced in kernel
commit:10383ae. This commit also added a builtin overflow checks to
`kref_get()` so we use it.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: atomic_add_unless() returns true/false rather than prior value
Francis Deslauriers [Wed, 8 Mar 2017 16:50:38 +0000 (11:50 -0500)] 
Fix: atomic_add_unless() returns true/false rather than prior value

The previous implementation assumed that `atomic_add_unless` returned
the prior value of the atomic counter when in fact it returned if the
addition was performed (true) or not performed (false).
Since `atomic_add_unless` can not return INT_MAX, the `lttng_kref_get`
always returned that the call was successful.

This issue had a low likelihood of being triggered since the two refcounts
of the counters used with this call are both bounded by the maximum
number of file descriptors on the system.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: timers cputime_t arguments replaced by ull in kernel 4.11
Francis Deslauriers [Tue, 7 Mar 2017 16:21:59 +0000 (11:21 -0500)] 
Fix: timers cputime_t arguments replaced by ull in kernel 4.11

cputime_t was changed to ull in the kernel commit: 858cf3a

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: update scsi instrumentation for kernel 4.11
Francis Deslauriers [Tue, 7 Mar 2017 16:16:47 +0000 (11:16 -0500)] 
Fix: update scsi instrumentation for kernel 4.11

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: changes to the vm_op fault cb prototype in libringbuffer
Francis Deslauriers [Tue, 7 Mar 2017 15:35:21 +0000 (10:35 -0500)] 
Fix: changes to the vm_op fault cb prototype in libringbuffer

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: update btrfs instrumentation for kernel 4.11
Francis Deslauriers [Tue, 7 Mar 2017 15:14:19 +0000 (10:14 -0500)] 
Fix: update btrfs instrumentation for kernel 4.11

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: update mm_vmscan instrumentation for kernel 4.11
Francis Deslauriers [Tue, 7 Mar 2017 14:48:08 +0000 (09:48 -0500)] 
Fix: update mm_vmscan instrumentation for kernel 4.11

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: section mismatch warning caused by __exit annotation
Francis Deslauriers [Tue, 7 Mar 2017 14:12:31 +0000 (09:12 -0500)] 
Fix: section mismatch warning caused by __exit annotation

lttng_logger_exit is used in a non-exit function so it should not be
annotated with `__exit`.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoVersion 2.9.1 v2.9.1
Mathieu Desnoyers [Fri, 17 Feb 2017 17:16:41 +0000 (12:16 -0500)] 
Version 2.9.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: nmi-safe clock on 32-bit systems
Mathieu Desnoyers [Fri, 10 Feb 2017 01:46:44 +0000 (20:46 -0500)] 
Fix: nmi-safe clock on 32-bit systems

On 32-bit systems, the algorithm within lttng-modules that ensures the
nmi-safe clock increases monotonically on a CPU assumes to have one
clock read per 32-bit LSB overflow period, which is not guaranteed. It
also has an issue on the first clock reads after module load, because
the initial value for the last LSB is 0. It can cause the time to stay
stuck at the same value for a few seconds at the beginning of the trace,
which is unfortunate for the first trace after module load, because this
is where the offset between realtime and trace_clock is sampled, which
prevents correlation of kernel and user-space traces for that session.

It only affects 32-bit systems with kernels >= 3.17.

Fix this by using the non-nmi-safe clock source on 32-bit systems.

While we are there, remove an implementation-defined c99 behavior
regarding casting u64 to long by using unsigned arithmetic instead:

turn:
  if (((long) now - (long) last) < 0)
into:
  if (U64_MAX / 2 < now - last)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: only include linux/cpuhotplug.h for kernels >= 4.10
Mathieu Desnoyers [Mon, 23 Jan 2017 20:16:22 +0000 (15:16 -0500)] 
Fix: only include linux/cpuhotplug.h for kernels >= 4.10

Kernels at least <= 4.4 did not have this header file.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: 4.10 hotplug adaptation backward compat
Mathieu Desnoyers [Mon, 23 Jan 2017 17:34:07 +0000 (12:34 -0500)] 
Fix: 4.10 hotplug adaptation backward compat

                 from /home/compudj/git/lttng-modules/lttng-context-perf-counters.c:23:
/home/compudj/git/lttng-modules/lttng-context-perf-counters.c: In function ‘lttng_add_perf_counter_to_ctx’:
/home/compudj/git/lttng-modules/lttng-context-perf-counters.c:353:22: error: ‘cpu’ undeclared (first use in this function)
  for_each_online_cpu(cpu) {
                      ^
./include/linux/cpumask.h:223:8: note: in definition of macro ‘for_each_cpu’
  for ((cpu) = -1;    \
        ^
/home/compudj/git/lttng-modules/lttng-context-perf-counters.c:353:2: note: in expansion of macro ‘for_each_online_cpu’
  for_each_online_cpu(cpu) {
  ^
/home/compudj/git/lttng-modules/lttng-context-perf-counters.c:353:22: note: each undeclared identifier is reported only once for each function it appears in
  for_each_online_cpu(cpu) {
                      ^
./include/linux/cpumask.h:223:8: note: in definition of macro ‘for_each_cpu’
  for ((cpu) = -1;    \
        ^
/home/compudj/git/lttng-modules/lttng-context-perf-counters.c:353:2: note: in expansion of macro ‘for_each_online_cpu’
  for_each_online_cpu(cpu) {
  ^
./include/linux/cpumask.h:224:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
   (cpu) = cpumask_next((cpu), (mask)), \
                                      ^
./include/linux/cpumask.h:717:36: note: in expansion of macro ‘for_each_cpu’
 #define for_each_online_cpu(cpu)   for_each_cpu((cpu), cpu_online_mask)
                                    ^
/home/compudj/git/lttng-modules/lttng-context-perf-counters.c:353:2: note: in expansion of macro ‘for_each_online_cpu’
  for_each_online_cpu(cpu) {
  ^
scripts/Makefile.build:289: recipe for target '/home/compudj/git/lttng-modules/lttng-context-perf-counters.o' failed
make[2]: *** [/home/compudj/git/lttng-modules/lttng-context-perf-counters.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoAdapt lttng-modules to Linux 4.10 cpu hotplug state machine
Mathieu Desnoyers [Tue, 10 Jan 2017 16:19:51 +0000 (11:19 -0500)] 
Adapt lttng-modules to Linux 4.10 cpu hotplug state machine

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: 4.10 btrfs instrumentation update backward compat
Mathieu Desnoyers [Mon, 23 Jan 2017 17:32:17 +0000 (12:32 -0500)] 
Fix: 4.10 btrfs instrumentation update backward compat

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoUpdate btrfs instrumentation for 4.10 kernel
Mathieu Desnoyers [Mon, 23 Jan 2017 17:18:35 +0000 (12:18 -0500)] 
Update btrfs instrumentation for 4.10 kernel

Based on commit 92a1bf76 "Btrfs: add 'inode' for extent map tracepoint"
in the upstream Linux kernel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agobtrfs instrumentation: update to 4.10 kernel
Mathieu Desnoyers [Tue, 10 Jan 2017 16:41:11 +0000 (11:41 -0500)] 
btrfs instrumentation: update to 4.10 kernel

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agotimer instrumentation: adapt to ktime_t without union
Mathieu Desnoyers [Tue, 10 Jan 2017 16:29:49 +0000 (11:29 -0500)] 
timer instrumentation: adapt to ktime_t without union

Introduced in Linux upstream in 4.10.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: asoc instrumentation for RHEL 7.3
Michael Jeanson [Wed, 7 Dec 2016 19:17:33 +0000 (14:17 -0500)] 
Fix: asoc instrumentation for RHEL 7.3

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: SCSI instrumentation for SLES12 SP2
Michael Jeanson [Wed, 7 Dec 2016 16:09:31 +0000 (11:09 -0500)] 
Fix: SCSI instrumentation for SLES12 SP2

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoAdd SUSE Linux Enterprise kernel version tests
Michael Jeanson [Wed, 7 Dec 2016 16:09:30 +0000 (11:09 -0500)] 
Add SUSE Linux Enterprise kernel version tests

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoVersion 2.9.0 v2.9.0
Mathieu Desnoyers [Tue, 29 Nov 2016 22:26:02 +0000 (17:26 -0500)] 
Version 2.9.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: add missing unlikely in reserve
Mathieu Desnoyers [Mon, 21 Nov 2016 21:08:22 +0000 (16:08 -0500)] 
Performance: add missing unlikely in reserve

Add missing branch prediction hints within lttng_event_reserve().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: preemptible and migratable context error handling
Mathieu Desnoyers [Mon, 24 Oct 2016 17:27:01 +0000 (13:27 -0400)] 
Fix: preemptible and migratable context error handling

When built against preempt-rt and preempt kernels, the "return 0" case
means success, but lttng-modules incorrectly prints an error in the
kernel log.

Given that we handle the -ENOSYS error in lttng_context_init, there is
no need to keep the ifdefs in that function.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoVersion 2.9.0-rc2 v2.9.0-rc2
Mathieu Desnoyers [Thu, 13 Oct 2016 14:18:07 +0000 (16:18 +0200)] 
Version 2.9.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: bump stable kernel version ranges for clock work-around
Mathieu Desnoyers [Thu, 13 Oct 2016 13:50:21 +0000 (15:50 +0200)] 
Fix: bump stable kernel version ranges for clock work-around

Linux commit 27727df240c7 ("Avoid taking lock in NMI path with
CONFIG_DEBUG_TIMEKEEPING"), changed the logic to open-code
the timekeeping_get_ns() function, but forgot to include
the unit conversion from cycles to nanoseconds, breaking the
function's output, which impacts LTTng.

We expected Linux commit 58bfea9532 "timekeeping: Fix
__ktime_get_fast_ns() regression" to make its way into stable
kernels promptly, but it appears new stable kernel releases were
done before the fix was cherry-picked from the master branch.

We therefore need to bump the version ranges for the work-around
in lttng-modules.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: John Stultz <john.stultz@linaro.org>
7 years agoVersion 2.9.0-rc1 v2.9.0-rc1
Mathieu Desnoyers [Fri, 7 Oct 2016 19:19:52 +0000 (15:19 -0400)] 
Version 2.9.0-rc1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: i2c: support kernels < 3.15
Mathieu Desnoyers [Fri, 7 Oct 2016 14:55:16 +0000 (10:55 -0400)] 
Fix: i2c: support kernels < 3.15

i2c instrumentation has only been added in kernel 3.15.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: show warning for broken clock work-around
Mathieu Desnoyers [Thu, 6 Oct 2016 11:45:35 +0000 (07:45 -0400)] 
Fix: show warning for broken clock work-around

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoBump minor ABI version
Mathieu Desnoyers [Wed, 5 Oct 2016 16:47:58 +0000 (12:47 -0400)] 
Bump minor ABI version

Command added: LTTNG_KERNEL_SESSION_STATEDUMP

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: work-around upstream Linux timekeeping bug
Mathieu Desnoyers [Wed, 5 Oct 2016 11:20:32 +0000 (07:20 -0400)] 
Fix: work-around upstream Linux timekeeping bug

Linux commit 27727df240c7 ("Avoid taking lock in NMI path with
CONFIG_DEBUG_TIMEKEEPING"), changed the logic to open-code
the timekeeping_get_ns() function, but forgot to include
the unit conversion from cycles to nanoseconds, breaking the
function's output, which impacts LTTng.

The following kernel versions are affected: 4.8, 4.7.4+, 4.4.20+,
4.1.32+

We expect that the upstream fix will reach the master and stable
branches timely before the next releases, so we use 4.8.1, 4.7.7,
4.4.24, and 4.1.34 as upper bounds (exclusive).

Fall-back to the non-NMI-safe trace clock for those kernel versions.
We simply discard events from NMI context with a in_nmi() check,
as we did before Linux 3.17.

Link: http://lkml.kernel.org/r/1475636148-26539-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoAdd support for i2c tracepoints
Simon Marchi [Tue, 4 Oct 2016 21:07:05 +0000 (17:07 -0400)] 
Add support for i2c tracepoints

This patch teaches lttng-modules about the i2c tracepoints in the Linux
kernel.

It contains the following tracepoints:

  * i2c_write
  * i2c_read
  * i2c_reply
  * i2c_result

I translated the fields and assignments from the kernel's
include/trace/events/i2c.h as well as I could.  I also tried building
this module against a kernel without CONFIG_I2C, and it built fine (the
required types are unconditionally defined).  So I don't think any "#if
CONFIG_I2C" or similar are required.

A module parameter (extract_sensitive_payload) controls the extraction
of possibly sensitive data from events.

[ With edit by Mathieu Desnoyers. ]

Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoCleanup: makefile version checks with single "ge"
Mathieu Desnoyers [Mon, 3 Oct 2016 21:35:27 +0000 (17:35 -0400)] 
Cleanup: makefile version checks with single "ge"

Version checks in makefiles should always be a disjunctive normal form
where the conjunctions consist of one or more "equals" comparisons and
at most a single greater-or-equal comparison.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: special-case NULL in lttng_strlen_user_inatomic
Mathieu Desnoyers [Mon, 26 Sep 2016 17:37:50 +0000 (13:37 -0400)] 
Performance: special-case NULL in lttng_strlen_user_inatomic

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: lttng_inline_memcpy does not take a __user argument
Mathieu Desnoyers [Sun, 25 Sep 2016 16:30:00 +0000 (12:30 -0400)] 
Fix: lttng_inline_memcpy does not take a __user argument

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: implement lttng_inline_memcpy
Mathieu Desnoyers [Sun, 25 Sep 2016 16:27:01 +0000 (12:27 -0400)] 
Performance: implement lttng_inline_memcpy

Because all length parameters received for serializing data coming from
applications go through a callback, they are never constant, and it
hurts performance to perform a call to memcpy each time.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: cache the backend pages pointer in context
Mathieu Desnoyers [Sun, 25 Sep 2016 16:02:25 +0000 (12:02 -0400)] 
Performance: cache the backend pages pointer in context

Getting the backend pages pointer requires pointer chasing through the
ring buffer backend tables. Cache the current value so it can be re-used
for all backend write operations writing fields for the same event.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoCleanup: libringbuffer: remove duplicate pointer chasing in slow paths
Mathieu Desnoyers [Sun, 25 Sep 2016 15:11:48 +0000 (11:11 -0400)] 
Cleanup: libringbuffer: remove duplicate pointer chasing in slow paths

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: Only dereference commit index once
Mathieu Desnoyers [Sun, 25 Sep 2016 15:06:10 +0000 (11:06 -0400)] 
Performance: Only dereference commit index once

The commit fast path should not dereference the commit counter index
repeatedly for performance reasons.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: Mark channel and buffer event disabled check unlikely
Mathieu Desnoyers [Sun, 25 Sep 2016 15:01:29 +0000 (11:01 -0400)] 
Performance: Mark channel and buffer event disabled check unlikely

Channel and buffer are typically enabled when tracing, else the probes
would not be connected. Ensure the compiler optimizes for the right
usual case.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: Relax atomicity constraints for crash handling
Mathieu Desnoyers [Sun, 25 Sep 2016 15:00:08 +0000 (11:00 -0400)] 
Performance: Relax atomicity constraints for crash handling

Use a store rather than a cmpxchg() for the update of the
sequential commit counter. This speeds up commit. The downside
is that short race windows between the if() check to see if the
counter is larger than the new value and the update could result
in the counter going backwards, in unlikely preemption or signal
delivery scenarios.

Accept that we may lose a few events in a crash dump for the
benefit of tracing speed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: mark ring buffer do_copy callers always inline
Mathieu Desnoyers [Sun, 25 Sep 2016 14:46:44 +0000 (10:46 -0400)] 
Performance: mark ring buffer do_copy callers always inline

The underlying copy operation is more efficient if the size is a
constant, which only happens if this function is inlined in the caller.
Otherwise, we end up calling memcpy for each field.

Force inlining for performance reasons for:
  - lib_ring_buffer_do_strcpy,
  - lib_ring_buffer_do_strcpy_from_user_inatomic,
  - lib_ring_buffer_copy_from_user_inatomic.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: mark lib_ring_buffer_write always inline
Mathieu Desnoyers [Sun, 25 Sep 2016 14:43:22 +0000 (10:43 -0400)] 
Performance: mark lib_ring_buffer_write always inline

The underlying copy operation is more efficient if the size is a
constant, which only happens if this function is inlined in the caller.
Otherwise, we end up calling memcpy for each field.

Force inlining for performance reasons.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoKconfig: select TRACEPOINTS when built-in
Mathieu Desnoyers [Tue, 20 Sep 2016 14:29:33 +0000 (10:29 -0400)] 
Kconfig: select TRACEPOINTS when built-in

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: disable event counting by default
Mathieu Desnoyers [Fri, 9 Sep 2016 21:01:18 +0000 (17:01 -0400)] 
Performance: disable event counting by default

Performance improvement changelog from lttng-ust, ported back to
lttng-modules:

Disable event counting in the ring buffer, which can count the number of
events produced per ring-buffer, as well as the number of events
overwritten in overwrite mode.

This feature is currently unused anyway: it is not saved in the ring
buffer header, nor made available to lttng-tools.

This saves 70 ns/event in lttng-ust on the ARM32 Cubietruck.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: handle large number of pages or subbuffers per buffer
Mathieu Desnoyers [Thu, 1 Sep 2016 22:08:15 +0000 (18:08 -0400)] 
Fix: handle large number of pages or subbuffers per buffer

Do no trigger kernel console warnings when we try to allocate too many
pages, or a too large kmalloc area for page array (within a subbuffer),
or a sub-buffer array (within a buffer).

Use vmalloc/vfree for the "pages" local variable used only during
allocation, which is an array of nr_subbuf * nr_pages_per_subbuf
pointers. This ensures we do not limit the overall buffer size due to
kmalloc limitations.

Fixes #1031

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: unregister cpu hotplug notifier on buffer alloc error
Jonathan Rajotte [Thu, 1 Sep 2016 21:52:09 +0000 (17:52 -0400)] 
Fix: unregister cpu hotplug notifier on buffer alloc error

The cpu hotplug notifier needs to be unregistered in the error path of
buffer allocation, else it eventually causes kernel OOPS when the kernel
accesses freed memory of the notifier block.

Fixes #1031

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: sa_family is of type unsigned short
Jérémie Galarneau [Wed, 31 Aug 2016 04:21:14 +0000 (00:21 -0400)] 
Fix: sa_family is of type unsigned short

sa_family is an unsigned short in sockaddr definitions. For instance,
the kernel's unix_getname() function sets addrlen to sizeof(short) as it
only returns the socket's family.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: check for sizeof sa_family to save sa_family in accept and connect
Jérémie Galarneau [Wed, 31 Aug 2016 04:18:29 +0000 (00:18 -0400)] 
Fix: check for sizeof sa_family to save sa_family in accept and connect

The check of addrlen >= sizeof(struct sockaddr) is too restrictive
and causes sa_family to not be saved in the case of AF_UNIX sockets
as the addrlen returned by the syscall may be only sizeof(short).

Individual checks per socket family are performed anyhow in the
switch case, making this safe.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: use printk_once() for wrapper warning messages
Mathieu Desnoyers [Tue, 30 Aug 2016 22:42:10 +0000 (18:42 -0400)] 
Fix: use printk_once() for wrapper warning messages

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: btrfs instrumentation for 4.8 kernel
Mathieu Desnoyers [Tue, 30 Aug 2016 21:32:35 +0000 (17:32 -0400)] 
Fix: btrfs instrumentation for 4.8 kernel

Note: there are missing events.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: update mm_vmscan instrumentation for kernel 4.8
Mathieu Desnoyers [Tue, 30 Aug 2016 21:13:37 +0000 (17:13 -0400)] 
Fix: update mm_vmscan instrumentation for kernel 4.8

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: napi instrumentation for 4.8 kernels
Mathieu Desnoyers [Tue, 30 Aug 2016 21:02:09 +0000 (17:02 -0400)] 
Fix: napi instrumentation for 4.8 kernels

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: update block instrumentation to compile on 4.8 kernels
Mathieu Desnoyers [Tue, 30 Aug 2016 20:59:13 +0000 (16:59 -0400)] 
Fix: update block instrumentation to compile on 4.8 kernels

These 2 upstream Linux commits break the block instrumentation in lttng
modules master:

https://github.com/torvalds/linux/commit/4e1b2d52a80d79296a5d899d73249748dea71a53

https://github.com/torvalds/linux/commit/288dab8a35a0bde426a09870943c8d3ee3a50dab

The errors are :

lttng-modules/probes/../instrumentation/events/lttng-module/block.h:35:13:
error: ‘REQ_DISCARD’ undeclared (first use in this function)

lttng-modules/probes/../instrumentation/events/lttng-module/block.h:41:14:
error: ‘REQ_SECURE’ undeclared (first use in this function)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoCleanup: reuse code in accept() and accept4() instrumentation
Jérémie Galarneau [Mon, 29 Aug 2016 20:02:10 +0000 (16:02 -0400)] 
Cleanup: reuse code in accept() and accept4() instrumentation

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoAdd x86-64 override for accept4 syscall
Jérémie Galarneau [Mon, 29 Aug 2016 20:02:09 +0000 (16:02 -0400)] 
Add x86-64 override for accept4 syscall

This patch adds an instrumentation override for the accept4() syscall
which is almost identical to accept(), except for an additional
"flags" parameter.

A follow-up patch refactors both overrides to minimize code
duplication as is done for the select/pselect6 overrides.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: timer wrapper: support kernels >= 4.8
Mathieu Desnoyers [Thu, 25 Aug 2016 21:39:47 +0000 (17:39 -0400)] 
Fix: timer wrapper: support kernels >= 4.8

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPerformance: split check deliver fast/slow paths
Mathieu Desnoyers [Sat, 16 Jul 2016 14:07:55 +0000 (10:07 -0400)] 
Performance: split check deliver fast/slow paths

Performance improvement changelog from lttng-ust, ported back to
lttng-modules:

On ARMv7l (Cubietruck), the compiler generates a function call for each
lib_ring_buffer_check_deliver, even though it typically only do an
unlikely check. Split it into an inline fast path, and a function call
for the slow path. This brings a performance gain of about 500ns/event
on the Cubietruck.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: x86-64 accept instrumentation
Mathieu Desnoyers [Fri, 19 Aug 2016 14:58:26 +0000 (10:58 -0400)] 
Fix: x86-64 accept instrumentation

The ipv4/ipv6 addr are output parameters.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: Add support for 4.6.4-rt8 kernel
Michael Jeanson [Fri, 29 Jul 2016 14:52:47 +0000 (10:52 -0400)] 
Fix: Add support for 4.6.4-rt8 kernel

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: update scsi instrumentation for 4.7+ kernels
Michael Jeanson [Thu, 28 Jul 2016 16:12:37 +0000 (12:12 -0400)] 
Fix: update scsi instrumentation for 4.7+ kernels

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: Use fs_initcall instead of rootfs_initcall
Michael Jeanson [Thu, 28 Jul 2016 16:12:11 +0000 (12:12 -0400)] 
Fix: Use fs_initcall instead of rootfs_initcall

The rootfs_initcall for drivers built as modules was only introduced in
kernel 3.14 by commit b46d0c46ccaa366a5bb8ac709fdf2bcaa76221fd. Use
fs_initcall instead which comes just before and exists in older kernels.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: Add kernel configuration for lttng clock plugin
Anders Wallin [Fri, 22 Jul 2016 14:10:47 +0000 (16:10 +0200)] 
Fix: Add kernel configuration for lttng clock plugin

Only one lttng clock plugin can be used when building the lttng-modules
in the kernel. To make it possible to use a custom clock plugin it must
be possible to unconfigure the test clock plugin

Signed-off-by: Anders Wallin <wallinux@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: the clock plugin must be initiated before first use of the clock
Anders Wallin [Fri, 22 Jul 2016 13:56:59 +0000 (15:56 +0200)] 
Fix: the clock plugin must be initiated before first use of the clock

When building lttng inside the kernel the clock plugin must be initated
before the rest of the lttng code. Moved the module_init to
rootfs_initcall. The functionality will not change when built as a
module.

Signed-off-by: Anders Wallin <wallinux@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: tests/Kbuild for older kernels
Mathieu Desnoyers [Fri, 15 Jul 2016 15:29:33 +0000 (11:29 -0400)] 
Fix: tests/Kbuild for older kernels

Older kernels (e.g. 2.6.38.8) don't seem to handle subdirectory in the
same way as recent kernels (e.g. 4.6). As a result, building LTTng
out-of-tree within a kernel modified to have LTTng as a built-in addon
fails with CONFIG_LTTNG=m.

$ make all O=../kernel_builddir
.....
  CC [M]  lttng/probes/lttng-kprobes.o
  CC [M]  lttng/probes/lttng-kretprobes.o
  LD      lttng/tests/built-in.o
  CC [M]  lttng/tests/probes/lttng-test.o
Assembler messages:
Fatal error: can't create lttng/tests/probes/lttng-test.o: No such
file or directory
/media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/scripts/Makefile.build:264:
recipe for target 'lttng/tests/probes/lttng-test.o' failed
make[3]: *** [lttng/tests/probes/lttng-test.o] Error 2
/media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/scripts/Makefile.build:403:
recipe for target 'lttng/tests' failed
make[2]: *** [lttng/tests] Error 2
/media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/Makefile:946:
recipe for target 'lttng' failed
make[1]: *** [lttng] Error 2
make[1]: Leaving directory
'/media/awallin/sda1/home/awallin/src/lttng-test/kernel_builddir'
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

$tree ../kernel_builddir/lttng/tests/
../kernel_builddir/lttng/tests/
└── built-in.o

Reported-by: Anders Wallin <anders.wallin@windriver.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoCleanup: __dynamic_len_idx set but not used warning
Mathieu Desnoyers [Fri, 15 Jul 2016 15:25:29 +0000 (11:25 -0400)] 
Cleanup: __dynamic_len_idx set but not used warning

__dynamic_len_idx can be set but not used, which causes gcc to
emit a warning. Mark it as possibly unused.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoCleanup: coding style and comments of net.h
Mathieu Desnoyers [Thu, 14 Jul 2016 15:56:12 +0000 (11:56 -0400)] 
Cleanup: coding style and comments of net.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agonet: Add TCP header data to net_* tracepoints
Geneviève Bastien [Tue, 12 Jul 2016 17:26:14 +0000 (13:26 -0400)] 
net: Add TCP header data to net_* tracepoints

This patch adds the transport header variant field in the network types IPv4
and IPv6 using the corresponding next protocol field in both types. It adds
the detailed fields of the TCP header. Other transport headers are empty.

Example output from babeltrace:

[13:21:04.392017771] (+0.000588730) qemulttng0 net_dev_queue: { cpu_id = 1 },
{ skbaddr = 0xFFFF88003C8390E8, len = 370, name = "ens3",
  network_header_type = ( "_ipv4" : container = 1 ),
  network_header = { ipv4 = { version = 4, ihl = 5, tos = 16, tot_len = 356,
    id = 0xFA2F, frag_off = 16384, ttl = 64,
    protocol = ( "_tcp" : container = 6 ), checksum = 0x173C,
    saddr_padding = { }, saddr = [ [0] = 10, [1] = 0, [2] = 10, [3] = 24 ],
    daddr_padding = { }, daddr = [ [0] = 10, [1] = 0, [2] = 10, [3] = 1 ],
    transport_header = { tcp = { source_port = 22, dest_port = 47500,
      seq = 2784866942, ack_seq = 3750103494, data_offset = 8, reserved = 0,
      flags = 0x11, window_size = 305, checksum = 0x296F, urg_ptr = 0 }
} } } }

[13:21:04.429861105] (+0.037671848) qemulttng0 net_dev_queue: { cpu_id = 1 },
{ skbaddr = 0xFFFF88003DBFC800, len = 86, name = "ens3",
  network_header_type = ( "_ipv6" : container = 2 ),
  network_header = { ipv6 = { version = 6, prio = 0, flow_lbl_padding = { },
    flow_lbl = [ [0] = 0x84, [1] = 0x41, [2] = 0x6F ], payload_len = 32,
    nexthdr = ( "_tcp" : container = 6 ), hop_limit = 64,
    saddr_padding = { }, saddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
      [4] = 0x5054, [5] = 0xFF, [6] = 0xFE12, [7] = 0x3456 ],
    daddr_padding = { }, daddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
      [4] = 0x5054, [5] = 0xFF, [6] = 0xFE22, [7] = 0x3344 ],
    transport_header = { tcp = { source_port = 36972, dest_port = 22,
      seq = 3750103494, ack_seq = 2784866942, data_offset = 0, reserved = 0,
      flags = 0x11, window_size = 256, checksum = 0x39F, urg_ptr = 0 }
} } } }

[13:21:08.195490138] (+3.765629033) qemulttng0 net_if_receive_skb: { cpu_id = 0 },
{ skbaddr = 0xFFFF88003C0B8C00, len = 72, name = "ens3",
  network_header_type = ( "_ipv6" : container = 2 ),
  network_header = { ipv6 = { version = 6, prio = 0, flow_lbl_padding = { },
    flow_lbl = [ [0] = 0x84, [1] = 0xCB, [2] = 0x7F ], payload_len = 32,
    nexthdr = ( "_unknown" : container = 58 ), hop_limit = 255,
    saddr_padding = { }, saddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
      [4] = 0x40C, [5] = 0xA9FF, [6] = 0xFEB5, [7] = 0xA75B ],
    daddr_padding = { }, daddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
      [4] = 0x5054, [5] = 0xFF, [6] = 0xFE12, [7] = 0x3456 ],
    transport_header = { unknown = { }
} } } }

Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agonet: Add IPv4/IPv6 header data to net_* tracepoints
Geneviève Bastien [Mon, 11 Jul 2016 13:34:02 +0000 (09:34 -0400)] 
net: Add IPv4/IPv6 header data to net_* tracepoints

This patch adds an enum field for the type of network header and a variant
field for the details of IPv4 and IPv6 headers. Any other network header is
empty.

Example babeltrace output:

[16:04:07.443810277] (+0.110633000) host0 net_dev_queue: { cpu_id = 0 },
{ skbaddr = 0xFFFF88003D9F4B00, len = 1462, name = "ens3",
  network_header_type = ( "_ipv4" : container = 1 ),
  network_header = { ipv4 = { version = 4, ihl = 5, tos = 0, tot_len = 1448,
    id = 0x0, frag_off = 16384, ttl = 64, protocol = 6, checksum = 0xB04,
    saddr_padding = { }, saddr = [ [0] = 10, [1] = 0, [2] = 10, [3] = 24 ],
    daddr_padding = { }, daddr = [ [0] = 10, [1] = 0, [2] = 12, [3] = 42 ] }
} }
[16:04:10.452192462] (+0.000283214) host0 net_if_receive_skb: { cpu_id = 0 },
{ skbaddr = 0xFFFF88003D9F4900, len = 118, name = "ens3",
  network_header_type = ( "_ipv6" : container = 2 ),
  network_header = { ipv6 = { version = 6, prio = 0, flow_lbl_padding = { },
    flow_lbl = [ [0] = 0x88, [1] = 0x41, [2] = 0x6F ], payload_len = 64,
    nexthdr = 58, hop_limit = 64, saddr_padding = { },
    saddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0, [4] = 0x5054,
              [5] = 0xFF, [6] = 0xFE12, [7] = 0x3456 ],
    daddr_padding = { },
    daddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0, [4] = 0x40C,
              [5] = 0xA9FF, [6] = 0xFEB5, [7] = 0xA75B ] }
} }

Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: endianness for the container type of enum
Geneviève Bastien [Tue, 12 Jul 2016 16:21:51 +0000 (12:21 -0400)] 
Fix: endianness for the container type of enum

If the endianness is specified for an enumeration, it should be written
in the metadata like for any other integer type.

Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.046116 seconds and 4 git commands to generate.