Drop 'asm/barrier.h' wrapper
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 18 Nov 2022 16:47:53 +0000 (11:47 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 23 Nov 2022 20:02:38 +0000 (15:02 -0500)
Change-Id: I2901758329083bceabcf2cb6f4a3ffae7fa87df7
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/wrapper/barrier.h [deleted file]
src/lttng-abi.c
src/lttng-event-notifier-notification.c

diff --git a/include/wrapper/barrier.h b/include/wrapper/barrier.h
deleted file mode 100644 (file)
index 9d47ad7..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only
- *
- * wrapper/barrier.h
- *
- * wrapper around asm/barrier.h.
- *
- * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_BARRIER_H
-#define _LTTNG_WRAPPER_BARRIER_H
-
-#include <lttng/kernel-version.h>
-#if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)
-#include <asm/barrier.h>
-#else
-#include <asm/system.h>
-#endif
-
-#if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)
-
-#define lttng_smp_store_release(x, v) smp_store_release(x, v)
-#define lttng_smp_load_acquire(x) smp_load_acquire(x)
-
-#else
-
-/*
- * Acquire-release semantics act as a one-way permeable barrier when
- * pairing a store with a release. Use a full memory barrier to emulate
- * the acquire-release semantic with a stronger barrier on older
- * kernels.
- */
-
-#define lttng_smp_store_release(x, v)          \
-       do {                                    \
-               smp_mb();                       \
-               ACCESS_ONCE(*(x)) = (v);        \
-       } while (0)
-
-#define lttng_smp_load_acquire(x)              \
-       ({                                      \
-               __typeof__(*(x)) ___ret;        \
-                                               \
-               ___ret = ACCESS_ONCE(*(x));     \
-               smp_mb();                       \
-               ___ret;                         \
-       })
-
-#endif
-
-#endif /* _LTTNG_WRAPPER_BARRIER_H */
index 59fea6266a840fd53e568c6526f12a60ccb72333..472541a2b89ba5905bd1cdefbd6b2bcd2d50f808 100644 (file)
@@ -23,6 +23,7 @@
  *     - Takes instrumentation source specific arguments.
  */
 
+#include <asm/barrier.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/anon_inodes.h>
@@ -38,7 +39,6 @@
 #include <wrapper/poll.h>
 #include <wrapper/file.h>
 #include <wrapper/kref.h>
-#include <wrapper/barrier.h>
 #include <lttng/string-utils.h>
 #include <lttng/abi.h>
 #include <lttng/abi-old.h>
@@ -2283,7 +2283,7 @@ long lttng_abi_event_notifier_group_create_error_counter(
         * in record_error. Ensures the counter is created and the
         * error_counter_len is set before they are used.
         */
-       lttng_smp_store_release(&event_notifier_group->error_counter, counter);
+       smp_store_release(&event_notifier_group->error_counter, counter);
 
        counter->file = counter_file;
        counter->owner = event_notifier_group->file;
index 7d345acc8be648f7ab3719fbaed7a63b09b908cd..ecbc0676291c4e9f425cdbbb86ad1ea37656c04a 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
  */
 
+#include <asm/barrier.h>
 #include <linux/bug.h>
 
 #include <lttng/lttng-bytecode.h>
@@ -13,7 +14,6 @@
 #include <lttng/event-notifier-notification.h>
 #include <lttng/events-internal.h>
 #include <lttng/probe-user.h>
-#include <wrapper/barrier.h>
 
 /*
  * The capture buffer size needs to be below 1024 bytes to avoid the
@@ -398,11 +398,11 @@ void record_error(struct lttng_kernel_event_notifier *event_notifier)
        int ret;
 
        /*
-        * lttng_smp_load_acquire paired with lttng_smp_store_release orders
-        * creation of the error counter and setting error_counter_len
-        * before the error_counter is used.
+        * smp_load_acquire paired with smp_store_release orders creation of
+        * the error counter and setting error_counter_len before the
+        * error_counter is used.
         */
-       error_counter = lttng_smp_load_acquire(&event_notifier_group->error_counter);
+       error_counter = smp_load_acquire(&event_notifier_group->error_counter);
        /* This group may not have an error counter attached to it. */
        if (!error_counter)
                return;
This page took 0.028895 seconds and 4 git commands to generate.