]> git.lttng.org Git - lttng-modules.git/log
lttng-modules.git
2 days agoFix: migratepages removed from compaction_migratepages in SLE15 SP5
Kienan Stewart [Fri, 24 Jan 2025 20:16:33 +0000 (20:16 +0000)] 
Fix: migratepages removed from compaction_migratepages in SLE15 SP5

See upstream SUSE commit:

    commit fefdc7d1ef5da10f35c8639660eaf2bf1ed40d3f
    Author: Mel Gorman <mgorman@suse.de>
    Date:   Fri Dec 2 17:36:26 2022 +0000

        Delete patches.rt/locking-lockdep-Provide-lockdep_assert-_once-helpers.patch.
        Refresh patches.rt/powerpc-Add-support-for-lazy-preemption.patch.

        suse-commit: 9b6a19f03339b75aa60ccec7d10efe8d54e362d6

Change-Id: I8525fd3f91d6c1f1ca9d48ffa638af4e31656032
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 days agoFix: block request field `rq_disk` removed in SLE15 SP5
Kienan Stewart [Fri, 24 Jan 2025 20:06:13 +0000 (20:06 +0000)] 
Fix: block request field `rq_disk` removed in SLE15 SP5

See upstream SUSE commit:

    commit 7bee263be47b123a65778a2072a55d8a6575a9d1
    Author: Hannes Reinecke <hare@suse.de>
    Date:   Tue Nov 22 10:27:33 2022 +0100

        block: remove the ->rq_disk field in struct request
        (jsc#PED-1183).

        suse-commit: 0dce100255e42207b5535eafd10612bf96a4014e

Change-Id: Ibb2fb5ae2e40fb012e8545574554bb72ba17d5e6
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 days agoFix: REQ_OP_WRITE_SAME removed in SLE15 SP5
Kienan Stewart [Fri, 24 Jan 2025 19:58:47 +0000 (19:58 +0000)] 
Fix: REQ_OP_WRITE_SAME removed in SLE15 SP5

See upstream SUSE commit:

    commit f9d378fde421f331e9f1f18f3b2cbdaf9fcd0a1a
    Author: Hannes Reinecke <hare@suse.de>
    Date:   Sat Nov 26 13:51:49 2022 +0100

        - block: remove genhd.h (jsc#PED-1183).
        - Refresh
          patches.suse/0006-nvdimm-blk-Delete-the-block-aperture-window-driver.patch.
        - Refresh
          patches.suse/0007-PM-hibernate-encrypt-hidden-area.patch.
        - Refresh patches.suse/target-add-rbd-backend.patch.

        suse-commit: dd0982ae4edd5e7142e6ed1676269d54ac51d7df

Change-Id: I72e3af82a5580dc28415c6c8677097e85ab5f926
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 days agoFix: genhd.h removed in SLE15 SP5
Kienan Stewart [Fri, 24 Jan 2025 19:47:09 +0000 (19:47 +0000)] 
Fix: genhd.h removed in SLE15 SP5

See upstream SUSE commit:

    commit f9d378fde421f331e9f1f18f3b2cbdaf9fcd0a1a
    Author: Hannes Reinecke <hare@suse.de>
    Date:   Sat Nov 26 13:51:49 2022 +0100

        - block: remove genhd.h (jsc#PED-1183).
        - Refresh
          patches.suse/0006-nvdimm-blk-Delete-the-block-aperture-window-driver.patch.
        - Refresh
          patches.suse/0007-PM-hibernate-encrypt-hidden-area.patch.
        - Refresh patches.suse/target-add-rbd-backend.patch.

        suse-commit: dd0982ae4edd5e7142e6ed1676269d54ac51d7df

Change-Id: I4b2092fc4547d2515724a6065e4656eb33994c00
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 days agoFix: Missing scsi/scsi_request.h with SLE15 SP5
Kienan Stewart [Fri, 24 Jan 2025 16:47:23 +0000 (16:47 +0000)] 
Fix: Missing scsi/scsi_request.h with SLE15 SP5

See SUSE commit:

    commit 65b6ebae4e3566ad74e016acad23007c5c01a062
    Author: Hannes Reinecke <hare@suse.de>
    Date:   Mon Dec 12 13:37:58 2022 +0100

        - scsi: core: Remove <scsi/scsi_request.h> (jsc#PED-1559).
        - Refresh patches.suse/cdrom-add-poll_event_interruptible.patch.

         suse-commit: 5a0411a622d3e14b4e89f106c5ae05e9f97fcfb6

Change-Id: Iad52c94ba17660fff8cc85569a18ee859e2b085a
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 days agoFix: powerpc builds with linux v6.13
Kienan Stewart [Mon, 27 Jan 2025 16:48:32 +0000 (16:48 +0000)] 
Fix: powerpc builds with linux v6.13

The crtsavres.o object for powerpc is missing the $(objtree) prefix.
This can be worked-around by setting MO=$KERNELDIR and building in the
kernel tree as before this version.

See upstream commit:

    commit 214c0eea43b2ea66bcd6467ea57e47ce8874191b
    Author: Masahiro Yamada <masahiroy@kernel.org>
    Date:   Sun Nov 10 10:34:30 2024 +0900

        kbuild: add $(objtree)/ prefix to some in-kernel build artifacts

        $(objtree) refers to the top of the output directory of kernel builds.

        This commit adds the explicit $(objtree)/ prefix to build artifacts
        needed for building external modules.

        This change has no immediate impact, as the top-level Makefile
        currently defines:

          objtree         := .

        This commit prepares for supporting the building of external modules
        in a different directory.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Change-Id: I11f7ee1e7e5634e992953798e9ecef6b2558ff79
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 days agolttng-modules fix for RHEL 9.5 kernels
Martin Hicks [Wed, 15 Jan 2025 14:23:00 +0000 (09:23 -0500)] 
lttng-modules fix for RHEL 9.5 kernels

This fixes the asoc_snd_*, kfree_skb and udp related tracepoints for the
RHEL 9.5 distro kernel.

In all cases they've updated to the format of newer kernels.

Signed-off-by: Martin Hicks <martin@sr-research.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 days agoFix: sched_stat_runtime changed in Linux 6.6.66
Kienan Stewart [Wed, 18 Dec 2024 14:35:36 +0000 (14:35 +0000)] 
Fix: sched_stat_runtime changed in Linux 6.6.66

The following commit has been backported into the 6.6.y branch.

See upstream commit:

    commit 5fe6ec8f6ab549b6422e41551abb51802bd48bc7
    Author: Peter Zijlstra <peterz@infradead.org>
    Date:   Mon Nov 6 13:41:43 2023 +0100

        sched: Remove vruntime from trace_sched_stat_runtime()

        Tracing the runtime delta makes sense, observer can sum over time.
        Tracing the absolute vruntime makes less sense, inconsistent:
        absolute-vs-delta, but also vruntime delta can be computed from
        runtime delta.

        Removing the vruntime thing also makes the two tracepoint sites
        identical, allowing to unify the code in a later patch.

Change-Id: I74acf0b8340c371e8411116e07e5c97b10f9c756
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 days agofix: include linux/fs.h for 'struct file' definition (v4.5)
Michael Jeanson [Mon, 16 Dec 2024 20:24:02 +0000 (15:24 -0500)] 
fix: include linux/fs.h for 'struct file' definition (v4.5)

Change-Id: Ia97ff818f5555d54142e632f5e8eaef3430e3d03
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 days agofix: add missing check for __must_check 'lttng_file_ref_put()' (v6.13)
Michael Jeanson [Mon, 16 Dec 2024 20:02:23 +0000 (15:02 -0500)] 
fix: add missing check for __must_check 'lttng_file_ref_put()' (v6.13)

Add a missing return code check to a call to 'lttng_file_ref_put()'
which is marked as 'must_check', otherwise it results in a build
failure when using -Werror.

Change-Id: Ib50ec669ffc0fe87a367b25b788518d148f7a85e
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 weeks agoFix: uprobe consumer handler signature changed in Linux 6.13.0-rc1
Kienan Stewart [Mon, 2 Dec 2024 18:33:23 +0000 (18:33 +0000)] 
Fix: uprobe consumer handler signature changed in Linux 6.13.0-rc1

See upstream commit: da09a9e0c3eab164af950be44ee6bdea8527c3e5

    commit da09a9e0c3eab164af950be44ee6bdea8527c3e5
    Author: Jiri Olsa <jolsa@kernel.org>
    Date:   Fri Oct 18 22:22:51 2024 +0200

        uprobe: Add data pointer to consumer handlers

        Adding data pointer to both entry and exit consumer handlers and all
        its users. The functionality itself is coming in following change.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20241018202252.693462-2-jolsa@kernel.org
Change-Id: I41e1a11a71c1c8a9bda461d96e5d1f9cc20e4df8
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 weeks agoFix: lookup_fdget_rcu removed in Linux 6.13.0-rc1
Kienan Stewart [Mon, 2 Dec 2024 16:15:40 +0000 (16:15 +0000)] 
Fix: lookup_fdget_rcu removed in Linux 6.13.0-rc1

See upstream commit 8fd3395ec9051a52828fcca2328cb50a69dea8ef:

    commit 8fd3395ec9051a52828fcca2328cb50a69dea8ef
    Author: Al Viro <viro@zeniv.linux.org.uk>
    Date:   Wed Jul 31 11:49:04 2024 -0400

        get rid of ...lookup...fdget_rcu() family

        Once upon a time, predecessors of those used to do file lookup
        without bumping a refcount, provided that caller held rcu_read_lock()
        across the lookup and whatever it wanted to read from the struct
        file found.  When struct file allocation switched to SLAB_TYPESAFE_BY_RCU,
        that stopped being feasible and these primitives started to bump the
        file refcount for lookup result, requiring the caller to call fput()
        afterwards.

        But that turned them pointless - e.g.
                rcu_read_lock();
                file = lookup_fdget_rcu(fd);
                rcu_read_unlock();
        is equivalent to
                file = fget_raw(fd);
        and all callers of lookup_fdget_rcu() are of that form.  Similarly,
        task_lookup_fdget_rcu() calls can be replaced with calling fget_task().
        task_lookup_next_fdget_rcu() doesn't have direct counterparts, but
        its callers would be happier if we replaced it with an analogue that
        deals with RCU internally.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Change-Id: I98f1c617e8bd7ad9db7a9af2a1fa76c5eb26e8b8
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 weeks agoFix: f_count replaced with f_ref in Linux 6.13.0-rc1
Kienan Stewart [Mon, 2 Dec 2024 16:02:31 +0000 (16:02 +0000)] 
Fix: f_count replaced with f_ref in Linux 6.13.0-rc1

See upstream commit 90ee6ed776c06435a3fe79c7f5344761f52e1760:

    commit 90ee6ed776c06435a3fe79c7f5344761f52e1760
    Author: Christian Brauner <brauner@kernel.org>
    Date:   Mon Oct 7 16:23:59 2024 +0200

        fs: port files to file_ref

        Port files to rely on file_ref reference to improve scaling and gain
        overflow protection.

        - We continue to WARN during get_file() in case a file that is already
          marked dead is revived as get_file() is only valid if the caller
          already holds a reference to the file. This hasn't changed just the
          check changes.

        - The semantics for epoll and ttm's dmabuf usage have changed. Both
          epoll and ttm synchronize with __fput() to prevent the underlying file
          from beeing freed.

Change-Id: I9f376af50835f15f74ff7fc82bdb752e09f77222
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 months agofix: mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked() (v5.15.171)
Michael Jeanson [Tue, 12 Nov 2024 16:19:23 +0000 (11:19 -0500)] 
fix: mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked() (v5.15.171)

See upstream backported commit:

  commit 28e7a507196fefd119e7ca2286840f1a9aad5e8a
  Author: Wonhyuk Yang <vvghjk1234@gmail.com>
  Date:   Thu May 19 14:08:54 2022 -0700

    mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked()

    [ Upstream commit 10e0f7530205799e7e971aba699a7cb3a47456de ]

    Currently, trace point mm_page_alloc_zone_locked() doesn't show correct
    information.

    First, when alloc_flag has ALLOC_HARDER/ALLOC_CMA, page can be allocated
    from MIGRATE_HIGHATOMIC/MIGRATE_CMA.  Nevertheless, tracepoint use
    requested migration type not MIGRATE_HIGHATOMIC and MIGRATE_CMA.

    Second, after commit 44042b4498728 ("mm/page_alloc: allow high-order pages
    to be stored on the per-cpu lists") percpu-list can store high order
    pages.  But trace point determine whether it is a refiil of percpu-list by
    comparing requested order and 0.

    To handle these problems, make mm_page_alloc_zone_locked() only be called
    by __rmqueue_smallest with correct migration type.  With a new argument
    called percpu_refill, it can show roughly whether it is a refill of
    percpu-list.

Link: https://lkml.kernel.org/r/20220512025307.57924-1-vvghjk1234@gmail.com
Change-Id: Ib76feb79d95e9f93c84c3aa1b946e57ac2e2666a
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 months agoFix: uprobes: make uprobe_register() return struct uprobe * (v6.12)
Michael Jeanson [Thu, 17 Oct 2024 15:56:02 +0000 (11:56 -0400)] 
Fix: uprobes: make uprobe_register() return struct uprobe * (v6.12)

See upstream commits :

  commit 3c83a9ad0295eb63bdeb81d821b8c3b9417fbcac
  Author: Oleg Nesterov <oleg@redhat.com>
  Date:   Thu Aug 1 15:27:34 2024 +0200

    uprobes: make uprobe_register() return struct uprobe *

    This way uprobe_unregister() and uprobe_apply() can use "struct uprobe *"
    rather than inode + offset. This simplifies the code and allows to avoid
    the unnecessary find_uprobe() + put_uprobe() in these functions.

    TODO: uprobe_unregister() still needs get_uprobe/put_uprobe to ensure that
    this uprobe can't be freed before up_write(&uprobe->register_rwsem).

  commit 04b01625da130c7521b768996cd5e48052198b97
  Author: Peter Zijlstra <peterz@infradead.org>
  Date:   Tue Sep 3 10:46:00 2024 -0700

    perf/uprobe: split uprobe_unregister()

    With uprobe_unregister() having grown a synchronize_srcu(), it becomes
    fairly slow to call. Esp. since both users of this API call it in a
    loop.

    Peel off the sync_srcu() and do it once, after the loop.

    We also need to add uprobe_unregister_sync() into uprobe_register()'s
    error handling path, as we need to be careful about returning to the
    caller before we have a guarantee that partially attached consumer won't
    be called anymore. This is an unlikely slow path and this should be
    totally fine to be slow in the case of a failed attach.

  commit e04332ebc8ac128fa551e83f1161ab1c094d13a9
  Author: Oleg Nesterov <oleg@redhat.com>
  Date:   Thu Aug 1 15:27:28 2024 +0200

    uprobes: kill uprobe_register_refctr()

    It doesn't make any sense to have 2 versions of _register(). Note that
    trace_uprobe_enable(), the only user of uprobe_register(), doesn't need
    to check tu->ref_ctr_offset to decide which one should be used, it could
    safely pass ref_ctr_offset == 0 to uprobe_register_refctr().

    Add this argument to uprobe_register(), update the callers, and kill
    uprobe_register_refctr().

Change-Id: I8d1f9a5db1f19c2bc2029709ae36f82e86f6fe58
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 months agoFix: silence 'non-consumed' message for non-started sessions
Michael Jeanson [Mon, 28 Oct 2024 20:02:59 +0000 (16:02 -0400)] 
Fix: silence 'non-consumed' message for non-started sessions

Destroying a session with at least one enabled event and which has never
been started will currently result in an error message in the kernel log
about 'non-consumed data' for each of the per-cpu buffer. This happens
because a packet header is created in the buffer but never consumed if
the session is not started.

Add a check in the buffer cleanup code to avoid printing 'non-consumed
data' errors for buffers associated with a session taht was never
started.

Change-Id: I1358e1ae49d03544a961515b97b115a488434e27
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 months agofix: writeback: Refine the show_inode_state() macro definition (v6.12)
Michael Jeanson [Thu, 17 Oct 2024 20:59:07 +0000 (16:59 -0400)] 
fix: writeback: Refine the show_inode_state() macro definition (v6.12)

See upstream commit :

  commit 459ca85ae1feff78d1518344df88bb79a092780c
  Author: Julian Sun <sunjunchao2870@gmail.com>
  Date:   Wed Aug 28 16:13:59 2024 +0800

    writeback: Refine the show_inode_state() macro definition

    Currently, the show_inode_state() macro only prints
    part of the state of inode->i_state. Let’s improve it
    to display more of its state.

Change-Id: Idaebd56f5775205f8a5c76e117c5ab65f7f1754b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: scsi: sd: Atomic write support added in 6.11-rc1
Kienan Stewart [Mon, 29 Jul 2024 14:23:02 +0000 (14:23 +0000)] 
Fix: scsi: sd: Atomic write support added in 6.11-rc1

See upstream commit:

    commit bf4ae8f2e6407a779c0368eb0f3e047a8333be17
    Author: John Garry <john.g.garry@oracle.com>
    Date:   Thu Jun 20 12:53:57 2024 +0000

        scsi: sd: Atomic write support

        Support is divided into two main areas:
        - reading VPD pages and setting sdev request_queue limits
        - support WRITE ATOMIC (16) command and tracing

        The relevant block limits VPD page need to be read to allow the block layer
        request_queue atomic write limits to be set. These VPD page limits are
        described in sbc4r22 section 6.6.4 - Block limits VPD page.

        There are five limits of interest:
        - MAXIMUM ATOMIC TRANSFER LENGTH
        - ATOMIC ALIGNMENT
        - ATOMIC TRANSFER LENGTH GRANULARITY
        - MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY
        - MAXIMUM ATOMIC BOUNDARY SIZE

        MAXIMUM ATOMIC TRANSFER LENGTH is the maximum length for a WRITE ATOMIC
        (16) command. It will not be greater than the device MAXIMUM TRANSFER
        LENGTH.

        ATOMIC ALIGNMENT and ATOMIC TRANSFER LENGTH GRANULARITY are the minimum
        alignment and length values for an atomic write in terms of logical blocks.

        Unlike NVMe, SCSI does not specify an LBA space boundary, but does specify
        a per-IO boundary granularity. The maximum boundary size is specified in
        MAXIMUM ATOMIC BOUNDARY SIZE. When used, this boundary value is set in the
        WRITE ATOMIC (16) ATOMIC BOUNDARY field - layout for the WRITE_ATOMIC_16
        command can be found in sbc4r22 section 5.48. This boundary value is the
        granularity size at which the device may atomically write the data. A value
        of zero in WRITE ATOMIC (16) ATOMIC BOUNDARY field means that all data must
        be atomically written together.

        MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY is the maximum atomic write
        length if a non-zero boundary value is set.

        For atomic write support, the WRITE ATOMIC (16) boundary is not of much
        interest, as the block layer expects each request submitted to be executed
        be atomically written together.

        MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY is the maximum atomic write
        length if a non-zero boundary value is set.

        For atomic write support, the WRITE ATOMIC (16) boundary is not of much
        interest, as the block layer expects each request submitted to be executed
        atomically. However, the SCSI spec does leave itself open to a quirky
        scenario where MAXIMUM ATOMIC TRANSFER LENGTH is zero, yet MAXIMUM ATOMIC
        TRANSFER LENGTH WITH BOUNDARY and MAXIMUM ATOMIC BOUNDARY SIZE are both
        non-zero. This case will be supported.

        To set the block layer request_queue atomic write capabilities, sanitize
        the VPD page limits and set limits as follows:
        - atomic_write_unit_min is derived from granularity and alignment values.
          If no granularity value is not set, use physical block size
        - atomic_write_unit_max is derived from MAXIMUM ATOMIC TRANSFER LENGTH. In
          the scenario where MAXIMUM ATOMIC TRANSFER LENGTH is zero and boundary
          limits are non-zero, use MAXIMUM ATOMIC BOUNDARY SIZE for
          atomic_write_unit_max. New flag scsi_disk.use_atomic_write_boundary is
          set for this scenario.
        - atomic_write_boundary_bytes is set to zero always

        SCSI also supports a WRITE ATOMIC (32) command, which is for type 2
        protection enabled. This is not going to be supported now, so check for
        T10_PI_TYPE2_PROTECTION when setting any request_queue limits.

        To handle an atomic write request, add support for WRITE ATOMIC (16)
        command in handler sd_setup_atomic_cmnd(). Flag use_atomic_write_boundary
        is checked here for encoding ATOMIC BOUNDARY field.

        Trace info is also added for WRITE_ATOMIC_16 command.

Change-Id: Ie072002fe2184615c72531ac081a324ef18cfb03
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: block_start removed from btrfs_get_extent in 6.11-rc1
Kienan Stewart [Mon, 29 Jul 2024 14:14:24 +0000 (14:14 +0000)] 
Fix: block_start removed from btrfs_get_extent in 6.11-rc1

See upstream commit:

    commit c77a8c61002e91d859e118008fd495efbe1d9373
    Author: Qu Wenruo <wqu@suse.com>
    Date:   Tue Apr 30 07:53:06 2024 +0930

        btrfs: remove extent_map::block_start member

        The member extent_map::block_start can be calculated from
        extent_map::disk_bytenr + extent_map::offset for regular extents.
        And otherwise just extent_map::disk_bytenr.

        And this is already validated by the validate_extent_map().  Now we can
        remove the member.

        However there is a special case in btrfs_create_dio_extent() where we
        for NOCOW/PREALLOC ordered extents cannot directly use the resulting
        btrfs_file_extent, as btrfs_split_ordered_extent() cannot handle them
        yet.

        So for that call site, we pass file_extent->disk_bytenr +
        file_extent->num_bytes as disk_bytenr for the ordered extent, and 0 for
        offset.

Change-Id: I2e3245bb0d1f5263e902659aa05848d5e231909b
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: block_len removed frmo btrfs_get_extent in 6.11-rc1
Kienan Stewart [Mon, 29 Jul 2024 14:12:47 +0000 (14:12 +0000)] 
Fix: block_len removed frmo btrfs_get_extent in 6.11-rc1

See upstream commit:

    commit e28b851ed9b232c3b84cb8d0fedbdfa8ca881386
    Author: Qu Wenruo <wqu@suse.com>
    Date:   Tue Apr 30 07:53:05 2024 +0930

        btrfs: remove extent_map::block_len member

        The extent_map::block_len is either extent_map::len (non-compressed
        extent) or extent_map::disk_num_bytes (compressed extent).

        Since we already have sanity checks to do the cross-checks between the
        new and old members, we can drop the old extent_map::block_len now.

        For most call sites, they can manually select extent_map::len or
        extent_map::disk_num_bytes, since most if not all of them have checked
        if the extent is compressed.

Change-Id: Ib03fc685b4e876bf4e53afdd28ca9826342a0e4e
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: orig_start removed from btrfs_get_extent in 6.11-rc1
Kienan Stewart [Mon, 29 Jul 2024 14:11:36 +0000 (14:11 +0000)] 
Fix: orig_start removed from btrfs_get_extent in 6.11-rc1

See upstream commit:

    commit 4aa7b5d1784f510c0f42afc1d74efb41947221d7
    Author: Qu Wenruo <wqu@suse.com>
    Date:   Tue Apr 30 07:53:04 2024 +0930

        btrfs: remove extent_map::orig_start member

        Since we have extent_map::offset, the old extent_map::orig_start is just
        extent_map::start - extent_map::offset for non-hole/inline extents.

        And since the new extent_map::offset is already verified by
        validate_extent_map() while the old orig_start is not, let's just remove
        the old member from all call sites.

Change-Id: I025a30d49b3e3ddc37d7846acc191ebbdf2ff19e
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: ext4_da_reserve_space changed in 6.11-rc1
Kienan Stewart [Mon, 29 Jul 2024 14:08:32 +0000 (14:08 +0000)] 
Fix: ext4_da_reserve_space changed in 6.11-rc1

See upstream commit:

    commit 0d66b23d79c750276f791411d81a524549a64852
    Author: Zhang Yi <yi.zhang@huawei.com>
    Date:   Fri May 17 20:40:02 2024 +0800

        ext4: make ext4_da_reserve_space() reserve multi-clusters

        Add 'nr_resv' parameter to ext4_da_reserve_space(), which indicates the
        number of clusters wants to reserve, make it reserve multiple clusters
        at a time.

Change-Id: Ib1ce8c3023d53a6d22ec444a435fdb3c871f64c5
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: kfree_skb changed in 6.11-rc1
Kienan Stewart [Mon, 29 Jul 2024 14:01:18 +0000 (14:01 +0000)] 
Fix: kfree_skb changed in 6.11-rc1

See upstream commit:

    commit c53795d48ee8f385c6a9e394651e7ee914baaeba
    Author: Yan Zhai <yan@cloudflare.com>
    Date:   Mon Jun 17 11:09:04 2024 -0700

        net: add rx_sk to trace_kfree_skb

        skb does not include enough information to find out receiving
        sockets/services and netns/containers on packet drops. In theory
        skb->dev tells about netns, but it can get cleared/reused, e.g. by TCP
        stack for OOO packet lookup. Similarly, skb->sk often identifies a local
        sender, and tells nothing about a receiver.

        Allow passing an extra receiving socket to the tracepoint to improve
        the visibility on receiving drops.

Change-Id: I33c8ce1a48006456f198ab1592f733b55be01016
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoIntroduce extension points for trace hit counters
Mathieu Desnoyers [Tue, 23 Jul 2024 19:20:51 +0000 (15:20 -0400)] 
Introduce extension points for trace hit counters

Introduce two extension points for trace hit counters:

1) Future "actions" to perform other than "increment",

2) Future dimension indexing schemes (keys) other than tokens.

Change the layout of struct lttng_kernel_abi_counter_key_dimension
by adding a "key_type" field. A new struct lttng_kernel_abi_counter_key_dimension_tokens
inherits from struct lttng_kernel_abi_counter_key_dimension, and contains
the uint32_t nr_key_tokens field. The only currently supported key_type
is LTTNG_KERNEL_ABI_KEY_TYPE_TOKENS = 0.

Change the layout of struct lttng_kernel_abi_counter_event by adding an
"action" field. The only currently supported action is
LTTNG_KERNEL_ABI_COUNTER_ACTION_INCREMENT = 0.

Change the struct lttng_kernel_abi_key_token_string so it inherits from
struct lttng_kernel_abi_key_token. The "len" field of
struct lttng_kernel_abi_key_token now includes the length of the entire
child structure.

Remove struct lttng_kernel_abi_counter_key: it was previously expecting
all key dimensions to have the same size. But because each dimension can
be of a different type, each may have its own distinct size.

Change the newly introduced API between probe providers to change the
"event_counter_add" callback into a "counter_hit" callback, which takes
one less argument (no integer value), but takes additional stack_data,
probe_ctx, and event_counter_ctx arguments for future use.

Change-Id: I4de86a9fac75ce759f58b545dffa2f99c59f5688
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: event notifier: set eval_capture to false for kprobe, kretprobe and uprobe
Mathieu Desnoyers [Fri, 26 Jul 2024 19:39:58 +0000 (15:39 -0400)] 
Fix: event notifier: set eval_capture to false for kprobe, kretprobe and uprobe

Trying to capture fields for kprobe, kretprobe, uprobe, event
notifications will end up dereferencing NULL pointers. Prevent execution
of capture code in those cases.

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

6 months agoImplement REUSE 3.0 with SPDX identifiers
Michael Jeanson [Tue, 18 Jun 2024 18:35:38 +0000 (14:35 -0400)] 
Implement REUSE 3.0 with SPDX identifiers

Implement the full REUSE spec [1] to help with copyright and licensing
audits and compliance. This will reduce a lot of manual work for the
licensing audit required in Debian on each update and also allow using
automated tools.

For files that lacked copyright and licensing information, I used the
following guidelines. If a clear author could be determined from the git
history use it, otherwise use 'EfficiOS Inc.'. For code use
'GPL-2.0-only OR LGPL-2.1-only' unless otherwise stated, for
documentation 'CC-BY-SA-4.0' and for data files 'CC0-1.0'.

Freeform text files were converted to Markdown to allow licensing
comments.

Running the reuse tool on the repo is now succesful:

  $ reuse lint

  # SUMMARY

  * Bad licenses: 0
  * Deprecated licenses: 0
  * Licenses without file extension: 0
  * Missing licenses: 0
  * Unused licenses: 0
  * Used licenses: CC0-1.0, GPL-2.0-only, CC-BY-SA-4.0, MIT, LGPL-2.1-only
  * Read errors: 0
  * files with copyright information: 358 / 358
  * files with license information: 358 / 358

  Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-)

[1] https://reuse.software/tutorial/

Change-Id: I1755cab24a6fcec7a6c9a2136891418203ec34b8
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agofix: add 'static inline' to lttng_kretprobes_init_event()
Michael Jeanson [Wed, 17 Jul 2024 15:32:31 +0000 (11:32 -0400)] 
fix: add 'static inline' to lttng_kretprobes_init_event()

Add missing 'static inline' to lttng_kretprobes_init_event() placeholder
function when CONFIG_KRETPROBES is not set. Also some minor reformating
to improve readability.

Change-Id: I23cf83dff99f4168ae0f339c2b4911796e0b0273
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agofix: copy_struct_from_user() for non-LTS branches < v4.19
Michael Jeanson [Tue, 16 Jul 2024 21:02:36 +0000 (17:02 -0400)] 
fix: copy_struct_from_user() for non-LTS branches < v4.19

The 'linux/bits.h' was backported to LTS branches but is not available
on non-LTS before v4.19. Use 'asm/byteorder.h' instead to get the
__LITTLE_ENDIAN define which is available on all kernel versions we
support.

Change-Id: Icfe733ab944616b3bd6d0023ad0869eefb830b34
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agofix: copy_struct_from_user() wrapper
Michael Jeanson [Tue, 16 Jul 2024 19:16:18 +0000 (15:16 -0400)] 
fix: copy_struct_from_user() wrapper

* Add 'static inline' to lttng_check_zeroed_user()
* Add missing parenthesis in lttng_check_zeroed_user()
* Add wrapper for aligned_byte_mask()

Change-Id: I92f3bce14ac91e896148d455de2ae0634b4d7972
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 months agoFix: lttng-abi: zero-init counter_conf
Mathieu Desnoyers [Sat, 3 Sep 2022 18:44:49 +0000 (14:44 -0400)] 
Fix: lttng-abi: zero-init counter_conf

Both lttng_abi_copy_user_old_counter_conf and
lttng_abi_copy_user_counter_conf should zero-init the counter_conf
destination argument, else the "dimension->flags" field is uninitialized
before being OR'd with flags.

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

6 months agocounter ABI: Fix too large stack size warning
Mathieu Desnoyers [Fri, 2 Sep 2022 20:44:45 +0000 (16:44 -0400)] 
counter ABI: Fix too large stack size warning

Fix the following warning by splitting lttng_counter_ioctl (which has a
lot of local variables in the switch/case legs) into many sub-functions.

/home/efficios/git/lttng-modules/src/lttng-abi.c: In function â€˜lttng_counter_ioctl’:
/home/efficios/git/lttng-modules/src/lttng-abi.c:1227:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 1227 | }
      | ^

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

6 months ago__lttng_counter_add: skip effect-less code when global_sum_step=0
Mathieu Desnoyers [Fri, 2 Sep 2022 20:19:06 +0000 (16:19 -0400)] 
__lttng_counter_add: skip effect-less code when global_sum_step=0

Skip effect-less code in the common case where global_sum_step=0.
This saves about 1.5ns on x86-64.

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

6 months agoABI: add key_string_len output field in lttng_kernel_abi_counter_map_descriptor
Mathieu Desnoyers [Fri, 8 Apr 2022 16:22:14 +0000 (12:22 -0400)] 
ABI: add key_string_len output field in lttng_kernel_abi_counter_map_descriptor

Tell userspace the size of the key string. Useful to adjust memory
allocation for a retry.

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

6 months agoImplement extensible LTTNG_KERNEL_ABI_COUNTER_EVENT ABI
Mathieu Desnoyers [Thu, 24 Mar 2022 19:03:45 +0000 (15:03 -0400)] 
Implement extensible LTTNG_KERNEL_ABI_COUNTER_EVENT ABI

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

6 months agoImplement extensible LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR
Mathieu Desnoyers [Thu, 24 Mar 2022 18:38:20 +0000 (14:38 -0400)] 
Implement extensible LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR

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

6 months agoImplement extensible counter read, aggregate, clear ioctls
Mathieu Desnoyers [Thu, 24 Mar 2022 17:58:45 +0000 (13:58 -0400)] 
Implement extensible counter read, aggregate, clear ioctls

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

6 months agoImplement counter configuration/dimensions extensible ABI
Mathieu Desnoyers [Thu, 24 Mar 2022 16:21:10 +0000 (12:21 -0400)] 
Implement counter configuration/dimensions extensible ABI

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

6 months agoImplement copy_user_event_param_ext with lttng_copy_struct_from_user
Mathieu Desnoyers [Thu, 24 Mar 2022 15:17:52 +0000 (11:17 -0400)] 
Implement copy_user_event_param_ext with lttng_copy_struct_from_user

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

6 months agoIntroduce wrapper lttng_copy_struct_from_user
Mathieu Desnoyers [Thu, 24 Mar 2022 15:10:06 +0000 (11:10 -0400)] 
Introduce wrapper lttng_copy_struct_from_user

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

6 months agoIntroduce event counter extensible ABI structure layout
Mathieu Desnoyers [Wed, 23 Mar 2022 20:23:45 +0000 (16:23 -0400)] 
Introduce event counter extensible ABI structure layout

Introduce event counter ioctl argument structure with extensible layout
for new ioctls.

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

6 months agoABI refactoring: Rename event counter ABI to "old"
Mathieu Desnoyers [Wed, 23 Mar 2022 18:06:59 +0000 (14:06 -0400)] 
ABI refactoring: Rename event counter ABI to "old"

The counter ioctls exposed in 2.13 for notifications use a fixed-size
array for the number of dimensions.

We aim to replace this by variable length arrays in 2.14 for event
counters, and introduce new ABIs as extensible structures.

Rename the ioctls as follows:

- LTTNG_KERNEL_ABI_COUNTER -> LTTNG_KERNEL_ABI_OLD_COUNTER
- LTTNG_KERNEL_ABI_COUNTER_READ -> LTTNG_KERNEL_ABI_OLD_COUNTER_READ
- LTTNG_KERNEL_ABI_COUNTER_AGGREGATE -> LTTNG_KERNEL_ABI_OLD_COUNTER_AGGREGATE
- LTTNG_KERNEL_ABI_COUNTER_CLEAR -> LTTNG_KERNEL_ABI_OLD_COUNTER_CLEAR

And rename the following structures:

- lttng_kernel_abi_counter_dimension -> lttng_kernel_abi_old_counter_dimension
- lttng_kernel_abi_counter_conf -> lttng_kernel_abi_old_counter_conf
- lttng_kernel_abi_counter_index -> lttng_kernel_abi_old_counter_index
- lttng_kernel_abi_counter_value -> lttng_kernel_abi_old_counter_value
- lttng_kernel_abi_counter_read -> lttng_kernel_abi_old_counter_read
- lttng_kernel_abi_counter_aggregate -> lttng_kernel_abi_old_counter_aggregate
- lttng_kernel_abi_counter_clear -> lttng_kernel_abi_old_counter_clear

Introduce "TODO" comments where the new ABIs should be implemented.

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

6 months agokretprobe: Implement kretprobes with event enablers
Mathieu Desnoyers [Thu, 3 Mar 2022 17:12:44 +0000 (12:12 -0500)] 
kretprobe: Implement kretprobes with event enablers

This enables support for enabling only entry or exit for kretprobes.
This enables event notifier support for kretprobes.

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

6 months agokprobe: Implement kprobes with event enablers
Mathieu Desnoyers [Tue, 1 Mar 2022 17:27:06 +0000 (12:27 -0500)] 
kprobe: Implement kprobes with event enablers

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

6 months agoABI: introduce lttng_kernel_abi_match_check
Mathieu Desnoyers [Tue, 1 Mar 2022 15:16:53 +0000 (10:16 -0500)] 
ABI: introduce lttng_kernel_abi_match_check

Requires introduction of extended event parameters because there are
only 8 bytes of padding left in struct lttng_kernel_abi_event.

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

6 months agokretprobe: implement lttng_kretprobes_match_check
Mathieu Desnoyers [Tue, 1 Mar 2022 15:58:32 +0000 (10:58 -0500)] 
kretprobe: implement lttng_kretprobes_match_check

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

6 months agokprobe: Introduce lttng_kprobes_match_check
Mathieu Desnoyers [Tue, 1 Mar 2022 15:34:37 +0000 (10:34 -0500)] 
kprobe: Introduce lttng_kprobes_match_check

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

6 months agoImplement event notifier kretprobe support
Mathieu Desnoyers [Mon, 28 Feb 2022 20:20:51 +0000 (15:20 -0500)] 
Implement event notifier kretprobe support

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

6 months agoRemove lttng_kernel_event_create warnings
Mathieu Desnoyers [Mon, 28 Feb 2022 20:09:12 +0000 (15:09 -0500)] 
Remove lttng_kernel_event_create warnings

Errors returned by lttng_kernel_event_create are handled by the caller,
and may happen e.g. when a kprobe or kretprobe symbol does not exist.
It should not generate a warning in the kernel console.

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

6 months agokretprobes: implement event counter support
Mathieu Desnoyers [Mon, 28 Feb 2022 19:15:00 +0000 (14:15 -0500)] 
kretprobes: implement event counter support

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

6 months agolttng_abi_create_event_notifier: add missing fallthrough
Mathieu Desnoyers [Mon, 28 Feb 2022 15:40:40 +0000 (10:40 -0500)] 
lttng_abi_create_event_notifier: add missing fallthrough

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

6 months agoImplement events-by-key hash table
Mathieu Desnoyers [Fri, 25 Feb 2022 14:38:52 +0000 (09:38 -0500)] 
Implement events-by-key hash table

Allow re-use of counter index for events with matching key.

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

6 months agoRename lttng_event_notifier_group events_ht to events_name_ht
Mathieu Desnoyers [Fri, 25 Feb 2022 14:44:06 +0000 (09:44 -0500)] 
Rename lttng_event_notifier_group events_ht to events_name_ht

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

6 months agoRename lttng_get_event_ht_from_enabler to lttng_get_events_name_ht_from_enabler
Mathieu Desnoyers [Fri, 25 Feb 2022 14:40:03 +0000 (09:40 -0500)] 
Rename lttng_get_event_ht_from_enabler to lttng_get_events_name_ht_from_enabler

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

6 months agoImplement counter maps (for listing)
Mathieu Desnoyers [Thu, 24 Feb 2022 20:42:56 +0000 (15:42 -0500)] 
Implement counter maps (for listing)

Also wire up LTTNG_KERNEL_ABI_SYSCALL_MASK in lttng_counter_ioctl.

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

6 months agoImplement channel counter creation/destroy
Mathieu Desnoyers [Thu, 24 Feb 2022 19:58:18 +0000 (14:58 -0500)] 
Implement channel counter creation/destroy

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

6 months agoCleanup: remove kprobes/kretprobes/uprobes unused exports
Mathieu Desnoyers [Tue, 22 Feb 2022 16:59:09 +0000 (11:59 -0500)] 
Cleanup: remove kprobes/kretprobes/uprobes unused exports

Can be removed now that those are embedded in the tracer core.

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

6 months agoFix: circular dependency on symbol lttng_id_tracker_lookup
Mathieu Desnoyers [Tue, 22 Feb 2022 16:56:29 +0000 (11:56 -0500)] 
Fix: circular dependency on symbol lttng_id_tracker_lookup

Adding lttng_id_tracker_lookup feature into kprobes, uprobes and
kretprobes introduces a circular dependency between lttng-tracer.ko and
the respective probe modules.

There is no real reason for having the kprobes/uprobes/kretprobes
modules separate from the tracer core, so combine those.

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

6 months agoFix: circular dependency between lttng-events and lib counter
Mathieu Desnoyers [Mon, 21 Feb 2022 21:18:04 +0000 (16:18 -0500)] 
Fix: circular dependency between lttng-events and lib counter

lib counter depends on lttng-events (tracer), not the opposite. Use the
lttng-counter clients callbacks to remove the circular dependency.

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

6 months agoImplement event counter creation
Mathieu Desnoyers [Thu, 10 Feb 2022 21:36:47 +0000 (16:36 -0500)] 
Implement event counter creation

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

6 months agoRename lttng_abi_create_event to lttng_abi_create_event_recorder_enabler
Mathieu Desnoyers [Thu, 10 Feb 2022 20:53:59 +0000 (15:53 -0500)] 
Rename lttng_abi_create_event to lttng_abi_create_event_recorder_enabler

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

6 months agouprobe: implement counter support
Mathieu Desnoyers [Thu, 10 Feb 2022 20:41:58 +0000 (15:41 -0500)] 
uprobe: implement counter support

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

6 months agokretprobes: implement counter support
Mathieu Desnoyers [Thu, 10 Feb 2022 20:40:25 +0000 (15:40 -0500)] 
kretprobes: implement counter support

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

6 months agokprobe: implement counter support
Mathieu Desnoyers [Thu, 10 Feb 2022 20:36:48 +0000 (15:36 -0500)] 
kprobe: implement counter support

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

6 months agoAdd missing counter handling
Mathieu Desnoyers [Thu, 10 Feb 2022 20:30:31 +0000 (15:30 -0500)] 
Add missing counter handling

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

6 months agoabi: introduce session common
Mathieu Desnoyers [Thu, 10 Feb 2022 20:23:57 +0000 (15:23 -0500)] 
abi: introduce session common

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

6 months agoImplement event counter probe
Mathieu Desnoyers [Thu, 10 Feb 2022 19:45:27 +0000 (14:45 -0500)] 
Implement event counter probe

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

6 months agoRemove unused lttng_event_enabler_event_name_match_event
Mathieu Desnoyers [Thu, 10 Feb 2022 19:39:15 +0000 (14:39 -0500)] 
Remove unused lttng_event_enabler_event_name_match_event

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

6 months agoMatch event keys for syscall events
Mathieu Desnoyers [Thu, 10 Feb 2022 19:35:09 +0000 (14:35 -0500)] 
Match event keys for syscall events

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

6 months agoSkip sync of disabled enablers
Mathieu Desnoyers [Thu, 10 Feb 2022 19:25:35 +0000 (14:25 -0500)] 
Skip sync of disabled enablers

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

6 months agoRemove duplicate lookup in lttng_event_enabler_create_tracepoint_events_if_missing
Mathieu Desnoyers [Thu, 10 Feb 2022 19:20:48 +0000 (14:20 -0500)] 
Remove duplicate lookup in lttng_event_enabler_create_tracepoint_events_if_missing

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

6 months agoImplement _lttng_kernel_event_create counter event support
Mathieu Desnoyers [Thu, 10 Feb 2022 19:17:11 +0000 (14:17 -0500)] 
Implement _lttng_kernel_event_create counter event support

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

6 months agolttng_kernel_event_alloc: handler counters
Mathieu Desnoyers [Thu, 10 Feb 2022 18:53:07 +0000 (13:53 -0500)] 
lttng_kernel_event_alloc: handler counters

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

6 months agoRefactor notification error counters
Mathieu Desnoyers [Thu, 10 Feb 2022 17:52:54 +0000 (12:52 -0500)] 
Refactor notification error counters

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

6 months agoAdd counter case in lttng_kernel_event_id_available
Mathieu Desnoyers [Wed, 2 Feb 2022 20:37:03 +0000 (15:37 -0500)] 
Add counter case in lttng_kernel_event_id_available

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

6 months agoImplement event counters
Mathieu Desnoyers [Thu, 27 Jan 2022 21:09:14 +0000 (16:09 -0500)] 
Implement event counters

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

6 months agoAdd channel counter structures to internal header
Mathieu Desnoyers [Wed, 2 Feb 2022 20:23:02 +0000 (15:23 -0500)] 
Add channel counter structures to internal header

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

6 months agoWire up LTTNG_KERNEL_EVENT_TYPE_COUNTER
Mathieu Desnoyers [Thu, 27 Jan 2022 20:58:08 +0000 (15:58 -0500)] 
Wire up LTTNG_KERNEL_EVENT_TYPE_COUNTER

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

6 months agoRefactor _lttng_event_destroy duplicated code
Mathieu Desnoyers [Thu, 27 Jan 2022 20:53:01 +0000 (15:53 -0500)] 
Refactor _lttng_event_destroy duplicated code

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

6 months agostruct lttng_kernel_event_session_common_private: remove unused ctx field
Mathieu Desnoyers [Thu, 27 Jan 2022 19:44:26 +0000 (14:44 -0500)] 
struct lttng_kernel_event_session_common_private: remove unused ctx field

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

6 months agoRename struct lttng_kernel_session_private events_ht field to events_name_ht
Mathieu Desnoyers [Thu, 27 Jan 2022 19:27:47 +0000 (14:27 -0500)] 
Rename struct lttng_kernel_session_private events_ht field to events_name_ht

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

6 months agoRename struct lttng_metadata_stream list field to node
Mathieu Desnoyers [Thu, 27 Jan 2022 19:24:10 +0000 (14:24 -0500)] 
Rename struct lttng_metadata_stream list field to node

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

6 months agoRename struct lttng_kernel_session_private list field to node
Mathieu Desnoyers [Thu, 27 Jan 2022 19:21:52 +0000 (14:21 -0500)] 
Rename struct lttng_kernel_session_private list field to node

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

6 months agoReorder struct lttng_kernel_session_private fields
Mathieu Desnoyers [Thu, 27 Jan 2022 19:19:09 +0000 (14:19 -0500)] 
Reorder struct lttng_kernel_session_private fields

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

6 months agoRename session events field to events_head
Mathieu Desnoyers [Thu, 27 Jan 2022 19:17:28 +0000 (14:17 -0500)] 
Rename session events field to events_head

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

6 months agoRename session chan field to chan_head
Mathieu Desnoyers [Thu, 27 Jan 2022 19:14:54 +0000 (14:14 -0500)] 
Rename session chan field to chan_head

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

6 months agoIntroduce struct lttng_event_counter_enabler
Mathieu Desnoyers [Thu, 27 Jan 2022 19:09:51 +0000 (14:09 -0500)] 
Introduce struct lttng_event_counter_enabler

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

6 months agoIntroduce struct lttng_kernel_event_counter_private
Mathieu Desnoyers [Thu, 27 Jan 2022 19:05:35 +0000 (14:05 -0500)] 
Introduce struct lttng_kernel_event_counter_private

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

6 months agoMove counter key structures to beginning of events-internal.h
Mathieu Desnoyers [Thu, 27 Jan 2022 19:08:23 +0000 (14:08 -0500)] 
Move counter key structures to beginning of events-internal.h

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

6 months agoIntroduce struct lttng_kernel_channel_counter and struct lttng_kernel_channel_counter_ops
Mathieu Desnoyers [Thu, 27 Jan 2022 19:03:49 +0000 (14:03 -0500)] 
Introduce struct lttng_kernel_channel_counter and struct lttng_kernel_channel_counter_ops

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

6 months agoIntroduce struct lttng_kernel_event_counter
Mathieu Desnoyers [Thu, 27 Jan 2022 19:03:14 +0000 (14:03 -0500)] 
Introduce struct lttng_kernel_event_counter

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

6 months agoIntroduce struct lttng_kernel_event_session_common_private
Mathieu Desnoyers [Mon, 10 Jan 2022 21:31:34 +0000 (16:31 -0500)] 
Introduce struct lttng_kernel_event_session_common_private

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

6 months agoIntroduce struct lttng_event_enabler_session_common
Mathieu Desnoyers [Mon, 10 Jan 2022 21:19:27 +0000 (16:19 -0500)] 
Introduce struct lttng_event_enabler_session_common

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

6 months agoTrace hit counters: introduce counter private data structures
Mathieu Desnoyers [Mon, 10 Jan 2022 19:48:59 +0000 (14:48 -0500)] 
Trace hit counters: introduce counter private data structures

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

6 months agoTrace hit counters: ABI
Mathieu Desnoyers [Mon, 10 Jan 2022 19:34:13 +0000 (14:34 -0500)] 
Trace hit counters: ABI

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

6 months agoFix: libcounter: __lttng_counter_add global sum step alloc vs sync mixup
Mathieu Desnoyers [Fri, 2 Sep 2022 20:13:46 +0000 (16:13 -0400)] 
Fix: libcounter: __lttng_counter_add global sum step alloc vs sync mixup

The global sum step needs to be handled on per-cpu allocated counters,
not per-cpu sync.

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

6 months agoFix: lttng_abi_validate_event_param: use kretprobe enum
Mathieu Desnoyers [Mon, 28 Feb 2022 15:40:03 +0000 (10:40 -0500)] 
Fix: lttng_abi_validate_event_param: use kretprobe enum

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

6 months agokvm instrumentation: Fix kvm_mmio event NULL pointer dereference
Mathieu Desnoyers [Thu, 4 Jul 2024 15:22:23 +0000 (11:22 -0400)] 
kvm instrumentation: Fix kvm_mmio event NULL pointer dereference

Upstream Linux commit e39d200fa5bf ("KVM: Fix stack-out-of-bounds read
in write_mmio") introduce a NULL pointer check within TP_fast_assign().

lttng-modules commit 33630522da97 ("Update kvm instrumentation for 4.15")
introduce use of:

  ctf_sequence_hex(unsigned char, val, val, u32, len)

without the required NULL pointer check, which can trigger NULL pointer
dereference in case of unsatisfied MMIO read.

Add the missing NULL pointer check. Record a sequence of length 0 in the
trace when the val pointer is NULL.

Reported-by: Fahad Arslan <fahad.arslan@siemens.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I51a171a56af96e2cf68dba73f7eb473dd6c0ba0e

6 months agokvm instrumentation: Cleanup: Eliminate code duplication
Mathieu Desnoyers [Thu, 4 Jul 2024 15:15:24 +0000 (11:15 -0400)] 
kvm instrumentation: Cleanup: Eliminate code duplication

Commit 0badc02f82b38 ("Fix: adjust SLE version ranges to build with SP2
and SP3") introduced code duplication. Modify the version match logic to
remove duplicated code.

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

7 months agoFix: Build on CentOS 9 Stream 2024-06
Kienan Stewart [Thu, 20 Jun 2024 15:15:59 +0000 (11:15 -0400)] 
Fix: Build on CentOS 9 Stream 2024-06

Change-Id: I445d2df9d49930e28e57b6a7d075a9f68e914bad
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 months agofix: file: Rename fcheck lookup_fd_rcu (v5.10.220)
Michael Jeanson [Tue, 25 Jun 2024 18:15:39 +0000 (14:15 -0400)] 
fix: file: Rename fcheck lookup_fd_rcu (v5.10.220)

See upstream backported commit:

  commit c4716bb296504cbc64aeefb370df44e821214c44
  Author: Eric W. Biederman <ebiederm@xmission.com>
  Date:   Fri Nov 20 17:14:27 2020 -0600

    file: Rename fcheck lookup_fd_rcu

    [ Upstream commit 460b4f812a9d473d4b39d87d37844f9fc30a9eb3 ]

    Also remove the confusing comment about checking if a fd exists.  I
    could not find one instance in the entire kernel that still matches
    the description or the reason for the name fcheck.

    The need for better names became apparent in the last round of
    discussion of this set of changes[1].

    [1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbRPqyQ@mail.gmail.com
Link: https://lkml.kernel.org/r/20201120231441.29911-10-ebiederm@xmission.com
Change-Id: Ib880bd8feef1c5d75d2a018cd93a1d464485ab7b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.051278 seconds and 4 git commands to generate.