From: Michael Jeanson Date: Fri, 18 Nov 2022 17:25:25 +0000 (-0500) Subject: Drop 'linux/percpu-defs.h' wrapper X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fe5e935d446a2ad372867d65560c5abe3d6ba655;p=lttng-modules.git Drop 'linux/percpu-defs.h' wrapper Change-Id: Ie9fb775602f78fc205d0b2a3b9adeb2874eab8fc Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ringbuffer/frontend_api.h b/include/ringbuffer/frontend_api.h index 41e3958c..b473a61b 100644 --- a/include/ringbuffer/frontend_api.h +++ b/include/ringbuffer/frontend_api.h @@ -14,7 +14,7 @@ #define _LIB_RING_BUFFER_FRONTEND_API_H #include -#include +#include #include #include @@ -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 index 7a050cc0..00000000 --- a/include/wrapper/percpu-defs.h +++ /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 - */ - -#ifndef _LTTNG_WRAPPER_PERCPU_DEFS_H -#define _LTTNG_WRAPPER_PERCPU_DEFS_H - -#include - -#if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) - -#include - -#define lttng_this_cpu_ptr(ptr) this_cpu_ptr(ptr) - -#else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ - -#include - -#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 */ diff --git a/include/wrapper/trace-clock.h b/include/wrapper/trace-clock.h index e3738263..69dcc800 100644 --- a/include/wrapper/trace-clock.h +++ b/include/wrapper/trace-clock.h @@ -20,12 +20,13 @@ #include #include #include +#include + #include #include #include #include #include -#include #include #include @@ -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(<tng_last_tsc); + last_tsc_ptr = this_cpu_ptr(<tng_last_tsc); last = *last_tsc_ptr; /* * Read "last" before "now". It is not strictly required, but it ensures diff --git a/src/lib/ringbuffer/ring_buffer_frontend.c b/src/lib/ringbuffer/ring_buffer_frontend.c index e12c7026..5316b7ff 100644 --- a/src/lib/ringbuffer/ring_buffer_frontend.c +++ b/src/lib/ringbuffer/ring_buffer_frontend.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,6 @@ #include #include #include -#include #include #include @@ -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; }