This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Forw: [ahoole at islandnet dot com: Accessing a va_list element from a probe]
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: systemtap at sourceware dot org, ahoole at islandnet dot com
- Date: Thu, 09 Jan 2014 11:17:19 -0500
- Subject: Re: Forw: [ahoole at islandnet dot com: Accessing a va_list element from a probe]
- Authentication-results: sourceware.org; auth=none
- References: <20140105201803 dot GD15448 at redhat dot com>
Hi -
> I was wondering if you have ever attempted to access a va_list from a probe
> in user-space. I can access the arguments; however, I'm presently puzzled
> as to how to elegantly access the individual items of the va_list. [...]
>
> According to stap -L we have the following arguments available:
> # stap -L 'process("/lib64/libc-2.17.so").function("printf")'
> process("/usr/lib64/libc-2.17.so").function("__printf@/usr/src/debug/glibc-2
> .17-c758a686/stdio-common/printf.c:28") $format:char const* $arg:va_list
> $done:int
My guess is that one way to do this would be a tapset function kind of
like tokenize(), where some internal state is kept from call to call
(the va_list pointer), and consecutive varargs are fetched off of the
stack, based upon types & sizes, with user_long() etc. It'd have to
reimplement gcc __builtin_va_arg, which is not THAT bad, but a bit of
work.
- FChE