Clean up remaining headers that are specific to liblockdep but lived in the shared header directory. These are all unused after the liblockdep code was removed in commit 7246f4dcaccc ("tools/lib/lockdep: drop liblockdep"). Note that there are still headers that were originally created for liblockdep, that still have liblockdep references, but they are used by other tools/ code at this point.
Unified · Split
| @@ -1,14 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef _LIBLOCKDEP_DEBUG_LOCKS_H_ | ||
| 3 | #define _LIBLOCKDEP_DEBUG_LOCKS_H_ | ||
| 4 | |||
| 5 | #include <stddef.h> | ||
| 6 | #include <linux/compiler.h> | ||
| 7 | #include <asm/bug.h> | ||
| 8 | |||
| 9 | #define DEBUG_LOCKS_WARN_ON(x) WARN_ON(x) | ||
| 10 | |||
| 11 | extern bool debug_locks; | ||
| 12 | extern bool debug_locks_silent; | ||
| 13 | |||
| 14 | #endif | ||
| @@ -1,12 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef _LIBLOCKDEP_LINUX_HARDIRQ_H_ | ||
| 3 | #define _LIBLOCKDEP_LINUX_HARDIRQ_H_ | ||
| 4 | |||
| 5 | #define SOFTIRQ_BITS 0UL | ||
| 6 | #define HARDIRQ_BITS 0UL | ||
| 7 | #define SOFTIRQ_SHIFT 0UL | ||
| 8 | #define HARDIRQ_SHIFT 0UL | ||
| 9 | #define hardirq_count() 0UL | ||
| 10 | #define softirq_count() 0UL | ||
| 11 | |||
| 12 | #endif | ||
| @@ -1,39 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef _LIBLOCKDEP_LINUX_TRACE_IRQFLAGS_H_ | ||
| 3 | #define _LIBLOCKDEP_LINUX_TRACE_IRQFLAGS_H_ | ||
| 4 | |||
| 5 | # define lockdep_hardirq_context() 0 | ||
| 6 | # define lockdep_softirq_context(p) 0 | ||
| 7 | # define lockdep_hardirqs_enabled() 0 | ||
| 8 | # define lockdep_softirqs_enabled(p) 0 | ||
| 9 | # define lockdep_hardirq_enter() do { } while (0) | ||
| 10 | # define lockdep_hardirq_exit() do { } while (0) | ||
| 11 | # define lockdep_softirq_enter() do { } while (0) | ||
| 12 | # define lockdep_softirq_exit() do { } while (0) | ||
| 13 | # define INIT_TRACE_IRQFLAGS | ||
| 14 | |||
| 15 | # define stop_critical_timings() do { } while (0) | ||
| 16 | # define start_critical_timings() do { } while (0) | ||
| 17 | |||
| 18 | #define raw_local_irq_disable() do { } while (0) | ||
| 19 | #define raw_local_irq_enable() do { } while (0) | ||
| 20 | #define raw_local_irq_save(flags) ((flags) = 0) | ||
| 21 | #define raw_local_irq_restore(flags) ((void)(flags)) | ||
| 22 | #define raw_local_save_flags(flags) ((flags) = 0) | ||
| 23 | #define raw_irqs_disabled_flags(flags) ((void)(flags)) | ||
| 24 | #define raw_irqs_disabled() 0 | ||
| 25 | #define raw_safe_halt() | ||
| 26 | |||
| 27 | #define local_irq_enable() do { } while (0) | ||
| 28 | #define local_irq_disable() do { } while (0) | ||
| 29 | #define local_irq_save(flags) ((flags) = 0) | ||
| 30 | #define local_irq_restore(flags) ((void)(flags)) | ||
| 31 | #define local_save_flags(flags) ((flags) = 0) | ||
| 32 | #define irqs_disabled() (1) | ||
| 33 | #define irqs_disabled_flags(flags) ((void)(flags), 0) | ||
| 34 | #define safe_halt() do { } while (0) | ||
| 35 | |||
| 36 | #define trace_lock_release(x, y) | ||
| 37 | #define trace_lock_acquire(a, b, c, d, e, f, g) | ||
| 38 | |||
| 39 | #endif | ||
| @@ -1,72 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef _LIBLOCKDEP_LOCKDEP_H_ | ||
| 3 | #define _LIBLOCKDEP_LOCKDEP_H_ | ||
| 4 | |||
| 5 | #include <sys/prctl.h> | ||
| 6 | #include <sys/syscall.h> | ||
| 7 | #include <string.h> | ||
| 8 | #include <limits.h> | ||
| 9 | #include <linux/utsname.h> | ||
| 10 | #include <linux/compiler.h> | ||
| 11 | #include <linux/export.h> | ||
| 12 | #include <linux/kern_levels.h> | ||
| 13 | #include <linux/err.h> | ||
| 14 | #include <linux/rcu.h> | ||
| 15 | #include <linux/list.h> | ||
| 16 | #include <linux/hardirq.h> | ||
| 17 | #include <unistd.h> | ||
| 18 | |||
| 19 | #define MAX_LOCK_DEPTH 63UL | ||
| 20 | |||
| 21 | #define asmlinkage | ||
| 22 | #define __visible | ||
| 23 | |||
| 24 | #include "../../../include/linux/lockdep.h" | ||
| 25 | |||
| 26 | struct task_struct { | ||
| 27 | u64 curr_chain_key; | ||
| 28 | int lockdep_depth; | ||
| 29 | unsigned int lockdep_recursion; | ||
| 30 | struct held_lock held_locks[MAX_LOCK_DEPTH]; | ||
| 31 | gfp_t lockdep_reclaim_gfp; | ||
| 32 | int pid; | ||
| 33 | int state; | ||
| 34 | char comm[17]; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define TASK_RUNNING 0 | ||
| 38 | |||
| 39 | extern struct task_struct *__curr(void); | ||
| 40 | |||
| 41 | #define current (__curr()) | ||
| 42 | |||
| 43 | static inline int debug_locks_off(void) | ||
| 44 | { | ||
| 45 | return 1; | ||
| 46 | } | ||
| 47 | |||
| 48 | #define task_pid_nr(tsk) ((tsk)->pid) | ||
| 49 | |||
| 50 | #define KSYM_NAME_LEN 128 | ||
| 51 | #define printk(...) dprintf(STDOUT_FILENO, __VA_ARGS__) | ||
| 52 | #define pr_err(format, ...) fprintf (stderr, format, ## __VA_ARGS__) | ||
| 53 | #define pr_warn pr_err | ||
| 54 | #define pr_cont pr_err | ||
| 55 | |||
| 56 | #define list_del_rcu list_del | ||
| 57 | |||
| 58 | #define atomic_t unsigned long | ||
| 59 | #define atomic_inc(x) ((*(x))++) | ||
| 60 | |||
| 61 | #define print_tainted() "" | ||
| 62 | #define static_obj(x) 1 | ||
| 63 | |||
| 64 | #define debug_show_all_locks() | ||
| 65 | extern void debug_check_no_locks_held(void); | ||
| 66 | |||
| 67 | static __used bool __is_kernel_percpu_address(unsigned long addr, void *can_addr) | ||
| 68 | { | ||
| 69 | return false; | ||
| 70 | } | ||
| 71 | |||
| 72 | #endif | ||
| @@ -1,4 +0,0 @@ | |||
| 1 | #ifndef _TOOLS_INCLUDE_LINUX_PROC_FS_H | ||
| 2 | #define _TOOLS_INCLUDE_LINUX_PROC_FS_H | ||
| 3 | |||
| 4 | #endif /* _TOOLS_INCLUDE_LINUX_PROC_FS_H */ | ||
| @@ -37,6 +37,4 @@ static inline bool arch_spin_is_locked(arch_spinlock_t *mutex) · 36 unmodified lines | |||
| 37 | return true; | 37 | return true; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | #include <linux/lockdep.h> | ||
| 41 | |||
| 42 | #endif | 40 | #endif |
| @@ -1,33 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef _LIBLOCKDEP_LINUX_STACKTRACE_H_ | ||
| 3 | #define _LIBLOCKDEP_LINUX_STACKTRACE_H_ | ||
| 4 | |||
| 5 | #include <execinfo.h> | ||
| 6 | |||
| 7 | struct stack_trace { | ||
| 8 | unsigned int nr_entries, max_entries; | ||
| 9 | unsigned long *entries; | ||
| 10 | int skip; | ||
| 11 | }; | ||
| 12 | |||
| 13 | static inline void print_stack_trace(struct stack_trace *trace, int spaces) | ||
| 14 | { | ||
| 15 | backtrace_symbols_fd((void **)trace->entries, trace->nr_entries, 1); | ||
| 16 | } | ||
| 17 | |||
| 18 | #define save_stack_trace(trace) \ | ||
| 19 | ((trace)->nr_entries = \ | ||
| 20 | backtrace((void **)(trace)->entries, (trace)->max_entries)) | ||
| 21 | |||
| 22 | static inline int dump_stack(void) | ||
| 23 | { | ||
| 24 | void *array[64]; | ||
| 25 | size_t size; | ||
| 26 | |||
| 27 | size = backtrace(array, 64); | ||
| 28 | backtrace_symbols_fd(array, size, 1); | ||
| 29 | |||
| 30 | return 0; | ||
| 31 | } | ||
| 32 | |||
| 33 | #endif | ||