[lttng-dev] [RFC PATCH lttng-modules v2 09/30] Drop spinlock.h wrapper

Michael Jeanson mjeanson at efficios.com
Thu Nov 8 16:45:14 EST 2018


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 lib/ringbuffer/frontend_types.h |  1 -
 lttng-statedump-impl.c          |  5 ++---
 wrapper/spinlock.h              | 34 ---------------------------------
 3 files changed, 2 insertions(+), 38 deletions(-)
 delete mode 100644 wrapper/spinlock.h

diff --git a/lib/ringbuffer/frontend_types.h b/lib/ringbuffer/frontend_types.h
index 2b0c932..837a926 100644
--- a/lib/ringbuffer/frontend_types.h
+++ b/lib/ringbuffer/frontend_types.h
@@ -15,7 +15,6 @@
 #include <linux/kref.h>
 #include <wrapper/ringbuffer/config.h>
 #include <wrapper/ringbuffer/backend_types.h>
-#include <wrapper/spinlock.h>
 #include <lib/prio_heap/lttng_prio_heap.h>	/* For per-CPU read-side iterator */
 #include <lttng-cpuhotplug.h>
 
diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
index 6d91a2c..8ce50c0 100644
--- a/lttng-statedump-impl.c
+++ b/lttng-statedump-impl.c
@@ -37,7 +37,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/irqdesc.h>
-#include <wrapper/spinlock.h>
 #include <wrapper/fdtable.h>
 #include <wrapper/irq.h>
 #include <wrapper/tracepoint.h>
@@ -373,12 +372,12 @@ int lttng_list_interrupts(struct lttng_session *session)
 			irq_desc_get_chip(desc)->name ? : "unnamed_irq_chip";
 
 		local_irq_save(flags);
-		wrapper_desc_spin_lock(&desc->lock);
+		raw_spin_lock(&desc->lock);
 		for (action = desc->action; action; action = action->next) {
 			trace_lttng_statedump_interrupt(session,
 				irq, irq_chip_name, action);
 		}
-		wrapper_desc_spin_unlock(&desc->lock);
+		raw_spin_unlock(&desc->lock);
 		local_irq_restore(flags);
 	}
 	return 0;
diff --git a/wrapper/spinlock.h b/wrapper/spinlock.h
deleted file mode 100644
index b3570d4..0000000
--- a/wrapper/spinlock.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
- *
- * wrapper/spinlock.h
- *
- * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_SPINLOCK_H
-#define _LTTNG_WRAPPER_SPINLOCK_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
-
-#include <linux/string.h>
-
-#define raw_spin_lock_init(lock)					\
-	do {								\
-		raw_spinlock_t __lock = __RAW_SPIN_LOCK_UNLOCKED;	\
-		memcpy(lock, &__lock, sizeof(lock));			\
-	} while (0)
-
-#define raw_spin_is_locked(lock)	__raw_spin_is_locked(lock)
-
-#define wrapper_desc_spin_lock(lock)	spin_lock(lock)
-#define wrapper_desc_spin_unlock(lock)	spin_unlock(lock)
-
-#else
-
-#define wrapper_desc_spin_lock(lock)	raw_spin_lock(lock)
-#define wrapper_desc_spin_unlock(lock)	raw_spin_unlock(lock)
-
-#endif
-#endif /* _LTTNG_WRAPPER_SPINLOCK_H */
-- 
2.17.1



More information about the lttng-dev mailing list