From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28057 invoked by alias); 1 Jun 2013 07:46:13 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 28033 invoked by uid 89); 1 Jun 2013 07:46:06 -0000 X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-oa0-f42.google.com (HELO mail-oa0-f42.google.com) (209.85.219.42) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 01 Jun 2013 07:46:05 +0000 Received: by mail-oa0-f42.google.com with SMTP id i10so377700oag.15 for ; Sat, 01 Jun 2013 00:46:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.135.134 with SMTP id ps6mr6934246oeb.114.1370072763822; Sat, 01 Jun 2013 00:46:03 -0700 (PDT) Received: by 10.182.96.9 with HTTP; Sat, 1 Jun 2013 00:46:03 -0700 (PDT) In-Reply-To: References: <51755D3D.6020004@redhat.com> <5175E28B.9050500@redhat.com> Date: Sat, 01 Jun 2013 07:46:00 -0000 Message-ID: Subject: Re: Accessing user-space global variables in timer.profile? From: agentzh To: Josh Stone Cc: David Smith , systemtap@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2013-q2/txt/msg00223.txt.bz2 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 :) Best regards, -agentzh