Skip to content

Commit

Permalink
tracing: Set kernel_stack's caller size properly
Browse files Browse the repository at this point in the history
I noticed when trying to use the trace-cmd python interface that reading the raw
buffer wasn't working for kernel_stack events.  This is because it uses a
stubbed version of __dynamic_array that doesn't do the __data_loc trick and
encode the length of the array into the field.  Instead it just shows up as a
size of 0.  So change this to __array and set the len to FTRACE_STACK_ENTRIES
since this is what we actually do in practice and matches how user_stack_trace
works.

Link: http://lkml.kernel.org/r/[email protected]

Signed-off-by: Josef Bacik <[email protected]>
[ Pulled from the archeological digging of my INBOX ]
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
Josef Bacik authored and rostedt committed Jan 24, 2020
1 parent afccc00 commit cbc3b92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_entries.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ FTRACE_ENTRY(kernel_stack, stack_entry,

F_STRUCT(
__field( int, size )
__dynamic_array(unsigned long, caller )
__array( unsigned long, caller, FTRACE_STACK_ENTRIES )
),

F_printk("\t=> %ps\n\t=> %ps\n\t=> %ps\n"
Expand Down

0 comments on commit cbc3b92

Please sign in to comment.