Skip to contentSkip to conversation

lockdep: Add #include <linux/instruction_pointer.h> to lockdep.h

PATCH In review Steven Rostedt 3 participants 8 messages Oct 28 – Oct 29

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 lockdep: Add #include <linux/instruction_pointer.h> to lockdep.h

From: Steven Rostedt <[email protected]>

On 32bit x86, _THIS_IP_ is not defined in asm/linkage.h. It happens to get included into lockdep.h via kernel.h pulling in trace_printk.h which includes instruction_pointer.h that has _THIS_IP_ defined when linkage.h does not.

In order to remove trace_printk.h from kernel.h, have lockdep.h include instruction_pointer.h directly.

---
 include/linux/lockdep.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/lockdep.h +1 -0
index a6451ecbbe9a..c6b0168f5fc9 100644
@@ -22,6 +22,7 @@ struct task_struct;
 #include <linux/list.h>
 #include <linux/debug_locks.h>
 #include <linux/stacktrace.h>
+#include <linux/instruction_pointer.h> /* In case _THIS_IP_ isn't defined */
 
 static inline void lockdep_copy_map(struct lockdep_map *to,
 				    struct lockdep_map *from)
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Steven Rostedt

From: Steven Rostedt <[email protected]>

On 32bit x86, _THIS_IP_ is not defined in asm/linkage.h. It happens to get included into lockdep.h via kernel.h pulling in trace_printk.h which includes instruction_pointer.h that has _THIS_IP_ defined when linkage.h does not.

In order to remove trace_printk.h from kernel.h, have lockdep.h include instruction_pointer.h directly.

Quoted 18 lines
---
 include/linux/lockdep.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/lockdep.h +1 -0
index a6451ecbbe9a..c6b0168f5fc9 100644
@@ -22,6 +22,7 @@ struct task_struct;
 #include <linux/list.h>
 #include <linux/debug_locks.h>
 #include <linux/stacktrace.h>
+#include <linux/instruction_pointer.h> /* In case _THIS_IP_ isn't defined */
 
 static inline void lockdep_copy_map(struct lockdep_map *to,
 				    struct lockdep_map *from)
Signature · 1 line
2.53.0
author maintainer
#2 lore raw
Quoted 8 lines · On Wed, 28 Oct 2026 11:16:05 -0400 Yury Norov <[email protected]> wrote:
Quoted 7 lines · Steven Rostedt

From: Steven Rostedt <[email protected]>

On 32bit x86, _THIS_IP_ is not defined in asm/linkage.h. It happens to get included into lockdep.h via kernel.h pulling in trace_printk.h which includes instruction_pointer.h that has _THIS_IP_ defined when linkage.h does not.

Quoted 6 lines
Quoted 4 lines

In order to remove trace_printk.h from kernel.h, have lockdep.h include instruction_pointer.h directly.

Thanks Yury.

Peter, can you give me an Acked-by on this patch and then I can add it to my series to remove trace_printk.h from kernel.h as that depends on this patch.

Thanks,

-- Steve

Quoted 19 lines
Quoted 19 lines
---
 include/linux/lockdep.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/lockdep.h +1 -0
index a6451ecbbe9a..c6b0168f5fc9 100644
@@ -22,6 +22,7 @@ struct task_struct;
 #include <linux/list.h>
 #include <linux/debug_locks.h>
 #include <linux/stacktrace.h>
+#include <linux/instruction_pointer.h> /* In case _THIS_IP_ isn't defined */
 
 static inline void lockdep_copy_map(struct lockdep_map *to,
 				    struct lockdep_map *from)
Signature · 1 line
2.53.0  
#3 lore raw
Quoted 16 lines · Steven Rostedt
Quoted 13 lines · On Wed, 28 Oct 2026 11:16:05 -0400 Yury Norov <[email protected]> wrote:
Quoted 11 lines · Steven Rostedt

From: Steven Rostedt <[email protected]>

On 32bit x86, _THIS_IP_ is not defined in asm/linkage.h. It happens to get included into lockdep.h via kernel.h pulling in trace_printk.h which includes instruction_pointer.h that has _THIS_IP_ defined when linkage.h does not.

In order to remove trace_printk.h from kernel.h, have lockdep.h include instruction_pointer.h directly.

Quoted 7 lines
Quoted 1 line

Thanks Yury.

Peter, can you give me an Acked-by on this patch and then I can add it to my series to remove trace_printk.h from kernel.h as that depends on this patch.

Steven, can you share a link to the series?

#5 lore raw
Quoted 7 lines · Steven Rostedt
Quoted 4 lines · On Wed, 28 Oct 2026 11:48:16 -0400 Yury Norov <[email protected]> wrote:
Quoted 3 lines

Peter, can you give me an Acked-by on this patch and then I can add it to my series to remove trace_printk.h from kernel.h as that depends on this patch.

Quoted 5 lines
Quoted 1 line

Steven, can you share a link to the series?

I just applied my last series:

https://lore.kernel.org/linux-trace-kernel/[email protected]/

Hmm... Seems I overlooked that v4. If not too late, please add my:

Thanks,
Yury

maintainer Acked-by on v1 1/1
#7 lore raw
In reply to Steven Rostedt
Quoted 11 lines · Steven Rostedt

From: Steven Rostedt <[email protected]>

On 32bit x86, _THIS_IP_ is not defined in asm/linkage.h. It happens to get included into lockdep.h via kernel.h pulling in trace_printk.h which includes instruction_pointer.h that has _THIS_IP_ defined when linkage.h does not.

In order to remove trace_printk.h from kernel.h, have lockdep.h include instruction_pointer.h directly.

Quoted 19 lines
---
 include/linux/lockdep.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/lockdep.h +1 -0
index a6451ecbbe9a..c6b0168f5fc9 100644
@@ -22,6 +22,7 @@ struct task_struct;
 #include <linux/list.h>
 #include <linux/debug_locks.h>
 #include <linux/stacktrace.h>
+#include <linux/instruction_pointer.h> /* In case _THIS_IP_ isn't defined */
 
 static inline void lockdep_copy_map(struct lockdep_map *to,
 				    struct lockdep_map *from)
Signature · 1 line
2.53.0