[PATCH 4.19 10/46] tracing: Change offset type to s32 in preempt/irq tracepoints

From: Greg Kroah-Hartman
Date: Tue Jan 14 2020 - 05:08:14 EST


From: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>

commit bf44f488e168368cae4139b4b33c3d0aaa11679c upstream.

Discussion in the below link reported that symbols in modules can appear
to be before _stext on ARM architecture, causing wrapping with the
offsets of this tracepoint. Change the offset type to s32 to fix this.

Link: http://lore.kernel.org/r/20191127154428.191095-1-antonio.borneo@xxxxxx
Link: http://lkml.kernel.org/r/20200102194625.226436-1-joel@xxxxxxxxxxxxxxxxx

Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: David Sterba <dsterba@xxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx>
Cc: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
Cc: Antonio Borneo <antonio.borneo@xxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Fixes: d59158162e032 ("tracing: Add support for preempt and irq enable/disable events")
Signed-off-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
include/trace/events/preemptirq.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

--- a/include/trace/events/preemptirq.h
+++ b/include/trace/events/preemptirq.h
@@ -18,13 +18,13 @@ DECLARE_EVENT_CLASS(preemptirq_template,
TP_ARGS(ip, parent_ip),

TP_STRUCT__entry(
- __field(u32, caller_offs)
- __field(u32, parent_offs)
+ __field(s32, caller_offs)
+ __field(s32, parent_offs)
),

TP_fast_assign(
- __entry->caller_offs = (u32)(ip - (unsigned long)_stext);
- __entry->parent_offs = (u32)(parent_ip - (unsigned long)_stext);
+ __entry->caller_offs = (s32)(ip - (unsigned long)_stext);
+ __entry->parent_offs = (s32)(parent_ip - (unsigned long)_stext);
),

TP_printk("caller=%pF parent=%pF",