public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: fche@redhat.com (Frank Ch. Eigler)
To: systemtap@sourceware.org, ahoole@islandnet.com
Subject: Re: Forw: [ahoole@islandnet.com: Accessing a va_list element from a probe]
Date: Thu, 09 Jan 2014 16:17:00 -0000	[thread overview]
Message-ID: <y0m61ptuo34.fsf@fche.csb> (raw)
In-Reply-To: <20140105201803.GD15448@redhat.com> (Frank Ch. Eigler's message of "Sun, 5 Jan 2014 15:18:03 -0500")


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

      reply	other threads:[~2014-01-09 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-05 20:18 Frank Ch. Eigler
2014-01-09 16:17 ` Frank Ch. Eigler [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=y0m61ptuo34.fsf@fche.csb \
    --to=fche@redhat.com \
    --cc=ahoole@islandnet.com \
    --cc=systemtap@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).