From: Josef Bacik <jbacik@fb.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] trace-cmd: add helper to read kernel_stack functions
Date: Wed, 24 Sep 2014 12:49:48 -0400 [thread overview]
Message-ID: <5422F62C.30205@fb.com> (raw)
In-Reply-To: <20140924121234.066bd249@gandalf.local.home>
On 09/24/2014 12:12 PM, Steven Rostedt wrote:
> On Wed, 24 Sep 2014 12:03:29 -0400
> Josef Bacik <jbacik@fb.com> wrote:
>
>> The way the ftrace kernel_stack event is handled doesn't work right with the
>> normal event reading stuff in python. The raw buffer read stuff expects the
>> size of the event to be non-zero, but in the case of kernel_stack the caller
>> array is 0 and we are given a size field
>>
>> field:int size; offset:8; size:4; signed:1;
>> field:unsigned long caller; offset:16; size:0; signed:0;
>>
>> This screws up python becuase it uses the size field to indicate how much of the
>> memory buffer is there to read, which in this case is 0. This makes it
>> impossible to actually read the caller array from python. So add a new c
>> binding to specially read the addr array and go ahead and look up the function
>> names for the addr and return those strings. With this I can now pull the
>> function names for a kernel_stack event from the python library. Thanks,
>
> No need to add "Thanks" to a change log ;-)
git log --author="Josef Bacik" --author="Josef Whiter" \
| grep "Thanks," | wc -l
540
git log --author="Josef Bacik" --author="Josef Whiter" --oneline \
| wc -l
688
Old habits ;).
>
> Will this still work if we convert the kernel_stack to be the same as
> the other dynamic_arrays?
>
> I'm assuming so, as there doesn't seem to be anything here that looks
> specific to the kernel_stack event, and we wouldn't want to break the
> other events.
>
> I just want to make sure you are testing both formats.
>
It should work which is why I went ahead and sent it, but I'm fixing to
do the kernel side now and I'll test with that and if it doesn't work
I'll send a v2. Thanks,
Josef
prev parent reply other threads:[~2014-09-24 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 16:03 [PATCH] trace-cmd: add helper to read kernel_stack functions Josef Bacik
2014-09-24 16:12 ` Steven Rostedt
2014-09-24 16:49 ` Josef Bacik [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5422F62C.30205@fb.com \
--to=jbacik@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox