]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tracing: Set kernel_stack's caller size properly
authorJosef Bacik <jbacik@fb.com>
Wed, 24 Sep 2014 20:14:12 +0000 (16:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 09:11:52 +0000 (11:11 +0200)
[ Upstream commit cbc3b92ce037f5e7536f6db157d185cd8b8f615c ]

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/1411589652-1318-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
[ Pulled from the archeological digging of my INBOX ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace_entries.h

index ee7b94a4810af8c85aa4baa246203dc52f588eb6..246db27dbdc998b565e95b60eab498386bcfb28c 100644 (file)
@@ -178,7 +178,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=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"