Drop 'linux/percpu-defs.h' wrapper
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 18 Nov 2022 17:25:25 +0000 (12:25 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 23 Nov 2022 20:02:42 +0000 (15:02 -0500)
Change-Id: Ie9fb775602f78fc205d0b2a3b9adeb2874eab8fc
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/ringbuffer/frontend_api.h
include/wrapper/percpu-defs.h [deleted file]
include/wrapper/trace-clock.h
src/lib/ringbuffer/ring_buffer_frontend.c

index 41e3958c140ff39752d66e67f2440f5d59a57c2d..b473a61b60407859366fd7965a2e548f23357a70 100644 (file)
@@ -14,7 +14,7 @@
 #define _LIB_RING_BUFFER_FRONTEND_API_H
 
 #include <ringbuffer/frontend.h>
-#include <wrapper/percpu-defs.h>
+#include <linux/percpu-defs.h>
 #include <linux/errno.h>
 #include <linux/prefetch.h>
 
@@ -58,7 +58,7 @@ static inline
 void lib_ring_buffer_put_cpu(const struct lttng_kernel_ring_buffer_config *config)
 {
        barrier();
-       (*lttng_this_cpu_ptr(&lib_ring_buffer_nesting))--;
+       (*this_cpu_ptr(&lib_ring_buffer_nesting))--;
        rcu_read_unlock_sched_notrace();
 }
 
diff --git a/include/wrapper/percpu-defs.h b/include/wrapper/percpu-defs.h
deleted file mode 100644 (file)
index 7a050cc..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/percpu-defs.h
- *
- * wrapper around linux/percpu-defs.h.
- *
- * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_PERCPU_DEFS_H
-#define _LTTNG_WRAPPER_PERCPU_DEFS_H
-
-#include <lttng/kernel-version.h>
-
-#if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)
-
-#include <linux/percpu-defs.h>
-
-#define lttng_this_cpu_ptr(ptr)                this_cpu_ptr(ptr)
-
-#else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */
-
-#include <linux/percpu.h>
-
-#define lttng_this_cpu_ptr(ptr)                (&__get_cpu_var(*(ptr)))
-
-#endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */
-
-#endif /* _LTTNG_WRAPPER_PERCPU_DEFS_H */
index e3738263bd8442b0d901822d719271928a284113..69dcc8003790a5ca9bb1486955237e20971cab35 100644 (file)
 #include <linux/time.h>
 #include <linux/hrtimer.h>
 #include <linux/percpu.h>
+#include <linux/percpu-defs.h>
+
 #include <lttng/kernel-version.h>
 #include <asm/local.h>
 #include <lttng/kernel-version.h>
 #include <lttng/clock.h>
 #include <wrapper/compiler.h>
-#include <wrapper/percpu-defs.h>
 #include <wrapper/random.h>
 #include <blacklist/timekeeping.h>
 
@@ -71,7 +72,7 @@ static inline u64 trace_clock_monotonic_wrapper(void)
 
        /* Use fast nmi-safe monotonic clock provided by the Linux kernel. */
        preempt_disable();
-       last_tsc_ptr = lttng_this_cpu_ptr(&lttng_last_tsc);
+       last_tsc_ptr = this_cpu_ptr(&lttng_last_tsc);
        last = *last_tsc_ptr;
        /*
         * Read "last" before "now". It is not strictly required, but it ensures
index e12c70263ea1942b03509dd27320a87f18a3312d..5316b7ff407196115726c2e33530978e17111b08 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/percpu.h>
+#include <linux/percpu-defs.h>
 #include <asm/cacheflush.h>
 
 #include <ringbuffer/config.h>
@@ -50,7 +51,6 @@
 #include <ringbuffer/nohz.h>
 #include <wrapper/cpu.h>
 #include <wrapper/kref.h>
-#include <wrapper/percpu-defs.h>
 #include <wrapper/timer.h>
 #include <wrapper/vmalloc.h>
 
@@ -652,16 +652,16 @@ static int notrace ring_buffer_tick_nohz_callback(struct notifier_block *nb,
                raw_spin_unlock(&buf->raw_tick_nohz_spinlock);
                break;
        case TICK_NOHZ_STOP:
-               spin_lock(lttng_this_cpu_ptr(&ring_buffer_nohz_lock));
+               spin_lock(this_cpu_ptr(&ring_buffer_nohz_lock));
                lib_ring_buffer_stop_switch_timer(buf);
                lib_ring_buffer_stop_read_timer(buf);
-               spin_unlock(lttng_this_cpu_ptr(&ring_buffer_nohz_lock));
+               spin_unlock(this_cpu_ptr(&ring_buffer_nohz_lock));
                break;
        case TICK_NOHZ_RESTART:
-               spin_lock(lttng_this_cpu_ptr(&ring_buffer_nohz_lock));
+               spin_lock(this_cpu_ptr(&ring_buffer_nohz_lock));
                lib_ring_buffer_start_read_timer(buf);
                lib_ring_buffer_start_switch_timer(buf);
-               spin_unlock(lttng_this_cpu_ptr(&ring_buffer_nohz_lock));
+               spin_unlock(this_cpu_ptr(&ring_buffer_nohz_lock));
                break;
        }
 
This page took 0.032301 seconds and 4 git commands to generate.