public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: agentzh <agentzh@gmail.com>
Cc: David Smith <dsmith@redhat.com>, systemtap@sourceware.org
Subject: Re: Accessing user-space global variables in timer.profile?
Date: Mon, 03 Jun 2013 23:19:00 -0000	[thread overview]
Message-ID: <51AD246B.3060402@redhat.com> (raw)
In-Reply-To: <CAB4Tn6OrHSPKiuvbuPLQ-TiROzJ2fYWJ8WK5yTrGktypPeBqGQ@mail.gmail.com>

On 06/01/2013 12:46 AM, agentzh wrote:
> Hello!
> 
> On Wed, May 29, 2013 at 9:00 PM, agentzh wrote:
>> Okay, I've come up with a (naive) patch to implement
>> @var("somevar@somefile", "somemodule") for stap user functions and
>> context-free probe handlers (see below). It works for me on Fedora 17,
>> both in a function or in timer.profile.
>>
> 
> Okay, based on this new feature, I've just written a systemtap-based
> tool named pl-sample-bt that can sample and aggregate Perl-land
> backtraces for a specified perl process at the Linux system ticks:
> 
>     https://github.com/agentzh/perl-systemtap-toolkit#pl-sample-bt
> 
> Its output can then be used to render "Perl-land Flame Graphs" by
> Brendan Gregg's FlameGraph tool chain, for example:
> 
>     http://agentzh.org/misc/flamegraph/perl-test-nginx-socket.svg
> 
> Essentially, pl-sample-bt emulates dtrace's jstack() thing for Perl 5.
> And I just ported the Perl_pp_caller function in the perl 5 core over
> to the stap language. The basic approach may well apply to other high
> level languages' VMs :)

Very cool!  In fact, if we can tease the script portions of this away
from perl-generation, it would be great to make an example script out of
this.  Hey, I'm sure if you're probing perl, then you're perfectly
comfortable writing perl to drive stap, but we need to be kinder in the
examples we present. :)

If I read it correctly, the dynamic pieces of this script are mostly
just to avoid repeating yourself - is that right?  I think with a
parameter for $perl_path, you can do the rest with macros.  Maybe a
second parameter for the $minor_version variations.

I certainly won't force you to change, but it would make a nice in-tree
showcase for @var-module support. :)

  reply	other threads:[~2013-06-03 23:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18  0:55 agentzh
2013-04-22 15:54 ` David Smith
2013-04-23  0:39   ` agentzh
2013-04-23  1:23     ` Josh Stone
2013-04-23 19:08       ` agentzh
2013-05-30  4:00       ` agentzh
2013-06-01  7:46         ` agentzh
2013-06-03 23:19           ` Josh Stone [this message]
2013-06-07 23:23             ` agentzh
2013-06-03 22:41         ` Josh Stone
2013-06-03 23:21           ` Josh Stone
2013-06-07 23:20             ` agentzh
2013-06-15  2:18             ` [PATCH] PR11096: Add support for the "module" argument to @var Yichun Zhang (agentzh)
2013-06-18  1:06               ` Josh Stone
2013-06-24  7:52                 ` [PATCH v2 0/1] " Yichun Zhang (agentzh)
2013-06-24  7:53                   ` [PATCH v2 1/1] " Yichun Zhang (agentzh)
2013-06-25  1:16                     ` Josh Stone
2013-06-26  5:42                       ` [PATCH v3 0/1] " Yichun Zhang (agentzh)
2013-06-26  5:43                         ` [PATCH v3 1/1] " Yichun Zhang (agentzh)
2013-06-26 22:40                           ` Josh Stone
2013-06-27 19:35                             ` Yichun Zhang (agentzh)
2013-06-27 23:31                               ` Yichun Zhang (agentzh)
2013-06-03 23:52           ` Accessing user-space global variables in timer.profile? Josh Stone

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=51AD246B.3060402@redhat.com \
    --to=jistone@redhat.com \
    --cc=agentzh@gmail.com \
    --cc=dsmith@redhat.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).