Build fixes for liblockdep
cover Build fixes for liblockdep
In addition to the patch I recently sent for lockdep itself, the following fixes are also needed to make liblockdep build.
Ben.
Bastian Blank (1):
liblockdep: Stub NMI watchdog reset
Ben Hutchings (1):
liblockdep: Stub task_struct::state
tools/include/linux/lockdep.h | 4 ++++ tools/include/linux/nmi.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tools/include/linux/nmi.h
PATCH 1/2 liblockdep: Stub NMI watchdog reset
From: Bastian Blank <[email protected]>
lockdep.c now includes <linux/nmi.h> and requires touch_nmi_watchdog(), so provide those for liblockdep.
Fixes 88f1c87de11a ("locking/lockdep: Avoid triggering hardlockup from ...")
[bwh: Write a longer description]
Signed-off-by Ben Hutchings <[email protected]>
--- tools/include/linux/nmi.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/include/linux/nmi.h
tools/include/linux/nmi.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* linux/include/linux/nmi.h +*/ +#ifndef LINUX_NMI_H +#define LINUX_NMI_H + +static inline void touch_nmi_watchdog (void ) +{ +} + +#endif
PATCH 2/2 liblockdep: Stub task_struct::state
In reply to Ben Hutchingslockdep_print_held_locks() now checks task_struct::state. Define it so that all tasks are assumed to be running, since we have no reasonble way to tell in user-space.
Fixes 8cc05c71ba5f ("locking/lockdep: Move sanity check to inside ...")
Signed-off-by Ben Hutchings <[email protected]>
--- tools/include/linux/lockdep.h | 4 ++++ 1 file changed, 4 insertions(+)
tools/include/linux/lockdep.h +4 -0
@@ -31,12 +31,16 @@ struct task_struct {gfp_t lockdep_reclaim_gfp;int pid;char comm[17 ]; +long state; };extern struct task_struct *__curr (void );#define current (__curr()) +/* lockdep checks task_struct::state == TASK_RUNNING */ +#define TASK_RUNNING 0 +static inline int debug_locks_off (void ) {return 1 ;