aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/rbtree.py
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <[email protected]>2022-07-31 01:59:28 -0400
committerSteven Rostedt (Google) <[email protected]>2022-07-31 14:55:01 -0400
commit4c3d2f9388d36eb28640a220a6f908328442d873 (patch)
tree82197710fc2f45100c5c3ebdbd9686d5c50f05f9 /scripts/gdb/linux/rbtree.py
parente88043c0ac16f19960048372dcffc6df7c05c5b8 (diff)
tracing: Use a struct alignof to determine trace event field alignment
alignof() gives an alignment of types as they would be as standalone variables. But alignment in structures might be different, and when building the fields of events, the alignment must be the actual alignment otherwise the field offsets may not match what they actually are. This caused trace-cmd to crash, as libtraceevent did not check if the field offset was bigger than the event. The write_msr and read_msr events on 32 bit had their fields incorrect, because it had a u64 field between two ints. alignof(u64) would give 8, but the u64 field was at a 4 byte alignment. Define a macro as: ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b))) which gives the actual alignment of types in a structure. Link: https://lkml.kernel.org/r/[email protected] Cc: Ingo Molnar <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: [email protected] Fixes: 04ae87a52074e ("ftrace: Rework event_create_dir()") Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/rbtree.py')
0 files changed, 0 insertions, 0 deletions