- Update to version 2.13.1.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:lttng/lttng-modules?expand=0&rev=56
This commit is contained in:
Alexei Sorokin
2022-01-19 12:30:53 +00:00
committed by Git OBS Bridge
parent b24168455b
commit fb813e275c
7 changed files with 24 additions and 353 deletions

View File

@@ -1,334 +0,0 @@
--- /dev/null
+++ b/include/wrapper/cpu.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/cpu.h
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_CPU_H
+#define _LTTNG_WRAPPER_CPU_H
+
+#include <linux/cpu.h>
+#include <lttng/kernel-version.h>
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0))
+
+static inline
+void lttng_cpus_read_lock(void)
+{
+ cpus_read_lock();
+}
+
+static inline
+void lttng_cpus_read_unlock(void)
+{
+ cpus_read_unlock();
+}
+
+#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */
+
+static inline
+void lttng_cpus_read_lock(void)
+{
+ get_online_cpus();
+}
+
+static inline
+void lttng_cpus_read_unlock(void)
+{
+ put_online_cpus();
+}
+
+#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */
+
+#endif /* _LTTNG_WRAPPER_CPU_H */
diff --git a/src/lib/ringbuffer/ring_buffer_backend.c b/src/lib/ringbuffer/ring_buffer_backend.c
index 26efb2bc..9a339be0 100644
--- a/src/lib/ringbuffer/ring_buffer_backend.c
+++ b/src/lib/ringbuffer/ring_buffer_backend.c
@@ -12,10 +12,10 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
-#include <linux/cpu.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
+#include <wrapper/cpu.h>
#include <wrapper/mm.h>
#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
#include <ringbuffer/config.h>
@@ -445,14 +445,14 @@ int channel_backend_init(struct channel_backend *chanb,
chanb->cpu_hp_notifier.priority = 5;
register_hotcpu_notifier(&chanb->cpu_hp_notifier);
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_online_cpu(i) {
ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
chanb, i);
if (ret)
goto free_bufs; /* cpu hotplug locked */
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
#else
for_each_possible_cpu(i) {
ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
@@ -485,7 +485,7 @@ free_bufs:
*/
#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
#ifdef CONFIG_HOTPLUG_CPU
- put_online_cpus();
+ lttng_cpus_read_unlock();
unregister_hotcpu_notifier(&chanb->cpu_hp_notifier);
#endif
#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
diff --git a/src/lib/ringbuffer/ring_buffer_frontend.c b/src/lib/ringbuffer/ring_buffer_frontend.c
index e9056118..87a575d0 100644
--- a/src/lib/ringbuffer/ring_buffer_frontend.c
+++ b/src/lib/ringbuffer/ring_buffer_frontend.c
@@ -48,6 +48,7 @@
#include <ringbuffer/iterator.h>
#include <ringbuffer/nohz.h>
#include <wrapper/atomic.h>
+#include <wrapper/cpu.h>
#include <wrapper/kref.h>
#include <wrapper/percpu-defs.h>
#include <wrapper/timer.h>
@@ -724,7 +725,7 @@ static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel
int cpu;
#ifdef CONFIG_HOTPLUG_CPU
- get_online_cpus();
+ lttng_cpus_read_lock();
chan->cpu_hp_enable = 0;
for_each_online_cpu(cpu) {
struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
@@ -732,7 +733,7 @@ static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel
lib_ring_buffer_stop_switch_timer(buf);
lib_ring_buffer_stop_read_timer(buf);
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
unregister_cpu_notifier(&chan->cpu_hp_notifier);
#else
for_each_possible_cpu(cpu) {
@@ -772,14 +773,14 @@ void lib_ring_buffer_set_quiescent_channel(struct lttng_kernel_ring_buffer_chann
const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_channel_cpu(cpu, chan) {
struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
cpu);
lib_ring_buffer_set_quiescent(buf);
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
} else {
struct lttng_kernel_ring_buffer *buf = chan->backend.buf;
@@ -794,14 +795,14 @@ void lib_ring_buffer_clear_quiescent_channel(struct lttng_kernel_ring_buffer_cha
const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_channel_cpu(cpu, chan) {
struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
cpu);
lib_ring_buffer_clear_quiescent(buf);
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
} else {
struct lttng_kernel_ring_buffer *buf = chan->backend.buf;
@@ -899,7 +900,7 @@ struct lttng_kernel_ring_buffer_channel *channel_create(const struct lttng_kerne
chan->cpu_hp_notifier.priority = 6;
register_cpu_notifier(&chan->cpu_hp_notifier);
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_online_cpu(cpu) {
struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
cpu);
@@ -909,7 +910,7 @@ struct lttng_kernel_ring_buffer_channel *channel_create(const struct lttng_kerne
spin_unlock(&per_cpu(ring_buffer_nohz_lock, cpu));
}
chan->cpu_hp_enable = 1;
- put_online_cpus();
+ lttng_cpus_read_unlock();
#else
for_each_possible_cpu(cpu) {
struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
diff --git a/src/lib/ringbuffer/ring_buffer_iterator.c b/src/lib/ringbuffer/ring_buffer_iterator.c
index 25839af6..60c95ca6 100644
--- a/src/lib/ringbuffer/ring_buffer_iterator.c
+++ b/src/lib/ringbuffer/ring_buffer_iterator.c
@@ -10,6 +10,7 @@
*/
#include <ringbuffer/iterator.h>
+#include <wrapper/cpu.h>
#include <wrapper/file.h>
#include <wrapper/uaccess.h>
#include <linux/jiffies.h>
@@ -440,13 +441,13 @@ int channel_iterator_init(struct lttng_kernel_ring_buffer_channel *chan)
chan->hp_iter_notifier.priority = 10;
register_cpu_notifier(&chan->hp_iter_notifier);
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_online_cpu(cpu) {
buf = per_cpu_ptr(chan->backend.buf, cpu);
lib_ring_buffer_iterator_init(chan, buf);
}
chan->hp_iter_enable = 1;
- put_online_cpus();
+ lttng_cpus_read_unlock();
#else
for_each_possible_cpu(cpu) {
buf = per_cpu_ptr(chan->backend.buf, cpu);
@@ -519,7 +520,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan)
CHAN_WARN_ON(chan, config->output != RING_BUFFER_ITERATOR);
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
- get_online_cpus();
+ lttng_cpus_read_lock();
/* Allow CPU hotplug to keep track of opened reader */
chan->iter.read_open = 1;
for_each_channel_cpu(cpu, chan) {
@@ -529,7 +530,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan)
goto error;
buf->iter.read_open = 1;
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
} else {
buf = channel_get_ring_buffer(config, chan, 0);
ret = lib_ring_buffer_iterator_open(buf);
@@ -538,7 +539,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan)
error:
/* Error should always happen on CPU 0, hence no close is required. */
CHAN_WARN_ON(chan, cpu != 0);
- put_online_cpus();
+ lttng_cpus_read_unlock();
return ret;
}
EXPORT_SYMBOL_GPL(channel_iterator_open);
@@ -550,7 +551,7 @@ void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan)
int cpu;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_channel_cpu(cpu, chan) {
buf = channel_get_ring_buffer(config, chan, cpu);
if (buf->iter.read_open) {
@@ -559,7 +560,7 @@ void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan)
}
}
chan->iter.read_open = 0;
- put_online_cpus();
+ lttng_cpus_read_unlock();
} else {
buf = channel_get_ring_buffer(config, chan, 0);
lib_ring_buffer_iterator_release(buf);
diff --git a/src/lttng-context-perf-counters.c b/src/lttng-context-perf-counters.c
index b0227d47..372f05e0 100644
--- a/src/lttng-context-perf-counters.c
+++ b/src/lttng-context-perf-counters.c
@@ -16,6 +16,7 @@
#include <lttng/events.h>
#include <lttng/events-internal.h>
#include <ringbuffer/frontend_types.h>
+#include <wrapper/cpu.h>
#include <wrapper/vmalloc.h>
#include <wrapper/perf.h>
#include <lttng/tracer.h>
@@ -97,10 +98,10 @@ void lttng_destroy_perf_counter_ctx_field(void *priv)
{
int cpu;
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_online_cpu(cpu)
perf_event_release_kernel(events[cpu]);
- put_online_cpus();
+ lttng_cpus_read_unlock();
#ifdef CONFIG_HOTPLUG_CPU
unregister_cpu_notifier(&perf_field->nb);
#endif
@@ -304,7 +305,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
perf_field->nb.priority = 0;
register_cpu_notifier(&perf_field->nb);
#endif
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_online_cpu(cpu) {
events[cpu] = wrapper_perf_event_create_kernel_counter(attr,
cpu, NULL, overflow_callback);
@@ -317,7 +318,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
goto counter_busy;
}
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
perf_field->hp_enable = 1;
}
#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
@@ -351,7 +352,7 @@ counter_error:
if (events[cpu] && !IS_ERR(events[cpu]))
perf_event_release_kernel(events[cpu]);
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
#ifdef CONFIG_HOTPLUG_CPU
unregister_cpu_notifier(&perf_field->nb);
#endif
diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c
index 4dfbca0b..2b42783a 100644
--- a/src/lttng-statedump-impl.c
+++ b/src/lttng-statedump-impl.c
@@ -23,7 +23,6 @@
#include <linux/file.h>
#include <linux/interrupt.h>
#include <linux/irqnr.h>
-#include <linux/cpu.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <linux/mm.h>
@@ -34,6 +33,7 @@
#include <lttng/events.h>
#include <lttng/tracer.h>
+#include <wrapper/cpu.h>
#include <wrapper/irqdesc.h>
#include <wrapper/fdtable.h>
#include <wrapper/namespace.h>
@@ -770,7 +770,7 @@ int do_lttng_statedump(struct lttng_kernel_session *session)
* is to guarantee that each CPU has been in a state where is was in
* syscall mode (i.e. not in a trap, an IRQ or a soft IRQ).
*/
- get_online_cpus();
+ lttng_cpus_read_lock();
atomic_set(&kernel_threads_to_run, num_online_cpus());
for_each_online_cpu(cpu) {
INIT_DELAYED_WORK(&cpu_work[cpu], lttng_statedump_work_func);
@@ -778,7 +778,7 @@ int do_lttng_statedump(struct lttng_kernel_session *session)
}
/* Wait for all threads to run */
__wait_event(statedump_wq, (atomic_read(&kernel_threads_to_run) == 0));
- put_online_cpus();
+ lttng_cpus_read_unlock();
/* Our work is done */
trace_lttng_statedump_end(session);
return 0;

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ebf2b3cd128b3a1c8afaea1e98d5a6f7f0676fd524fcf72361c34d9dc603356
size 342499

View File

@@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEKgtO2RXy0/pF9bFiFygKl4EYas8FAmEIWW8ACgkQFygKl4EY
as836wf/WlCFDFrLJiH1FOrJIiSwFsbNW7fTMOKNd9O/+/FOZ9ccMrMUJiC5ZYVb
g0+d92a9jurrnErluulk5hsD5s8wDmMbeWgZRybUdqzdN7SWnJTTAQC/Ui9rb/NS
3oUIooQN0lrgu/ozXPoGs0cuPqhQmvurTWNcRZgtuzs7XVmE3TiXKfQ8WWAWsk/V
qdV+XyHmt9PVSjcWTbCnYFciyTIs5OeydhWzeF93gVjIFgs2/zJt7bvH1g2Qm42H
VpD1g5PP796vz+Ukhv7hAlE/eNoOOqAa/N8Fwo12QN8xl7XoJhk3v7/SS2BpdX+O
i2XO0pP44uyuoDgo0wMmwONZwFb2aw==
=vUT2
-----END PGP SIGNATURE-----

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a7c86d91c9bbe66d27f025aa04b8cfc6d7785ed2fc7ef774930800ee44d7f343
size 342922

View File

@@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEKgtO2RXy0/pF9bFiFygKl4EYas8FAmHV6O8ACgkQFygKl4EY
as84Owf/W2JrzrmU9La5KZJHAwvnoVNMI+E4lJIZunwrxImyGle5l0XFfKaiaakq
Xu6f696sK6jm1mcnjlJSCpSm9xjAaP/cBYB/62iEgvmhAxPThbaqPtGGIWvWW01o
gj3LXQLwrQrnQsDU0w5JfSQXvvWN2zHdqGgkl5nkcy6Tvnbt/31tFlWRFhffHhpW
jHBs1Wv0wj2oRgYKgt/2RUkeYnuyiDKBNIsaleWwOS/UVBht2CtY6MtEr6Bq0V6g
j4VVpeqOaA0uLNORU7Kmf+xfWAzEDF4B8RNH4K5iA8402qMery0bG6Pll/8tgqKs
UDbm4GmnTRJs40iCXsLooRgqfnL5TQ==
=eHyL
-----END PGP SIGNATURE-----

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat Jan 15 13:16:03 UTC 2022 - Alexei Sorokin <sor.alexei@meowr.ru>
- Update to version 2.13.1:
* See https://git.lttng.org/?p=lttng-modules.git;a=shortlog;h=refs/tags/v2.13.1
- Drop lttng-modules-2.13.0-linux-5.15.patch: merged upstream.
-------------------------------------------------------------------
Sat Nov 27 18:07:31 UTC 2021 - Alexei Sorokin <sor.alexei@meowr.ru>

View File

@@ -1,7 +1,7 @@
#
# spec file for package lttng-modules
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: lttng-modules
Version: 2.13.0
Version: 2.13.1
Release: 0
Summary: Licensing information for package lttng-modules
License: GPL-2.0-only AND LGPL-2.1-only AND MIT
@@ -28,8 +28,6 @@ Source1: https://lttng.org/files/lttng-modules/%{name}-%{version}.tar.bz2
Source2: %{name}.keyring
Source3: %{name}-preamble
Source4: Module.supported
# PATCH-FIX-UPSTREAM lttng-modules-2.13.0-linux-5.15.patch mjeanson@efficios.com -- Linux 5.15 compatibility (commit ffcc8734).
Patch0: lttng-modules-2.13.0-linux-5.15.patch
BuildRequires: %{kernel_module_package_buildreqs}
ExclusiveArch: %ix86 x86_64 armv7l aarch64 riscv64 ppc64 ppc64le
@@ -39,7 +37,7 @@ This package provides licensing documentation for the lttng kmp packages.
%kernel_module_package -p %{name}-preamble -x ec2 xen xenpae vmi um
%prep
%autosetup -p1
%setup -q
set -- *
mkdir source obj