This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How do I trap the return of a function in a user space process?
- From: Martin Martin <martin at infinio dot com>
- To: "Yichun Zhang (agentzh)" <agentzh at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Fri, 6 Sep 2013 11:57:29 -0400
- Subject: Re: How do I trap the return of a function in a user space process?
- Authentication-results: sourceware.org; auth=none
- References: <CAAQ0mPjJeQcYoKNc=1PhgCF1Z=iQjPuueTxAwQxNnzwCaCY_Hg at mail dot gmail dot com> <CAB4Tn6Oq8O_NVvfWNyrEqaNWuARMDAtK_FGWjLGHd4YaJiNMLw at mail dot gmail dot com> <CAAQ0mPjgOx3oNy5K0iXKj4wiNgC64Xy-dE_K=AeFTJB+3b4bVw at mail dot gmail dot com>
My next problem is that all of the C++ methods in the class I'm
interested in don't show up when I do:
sudo stap -l 'process("myexe").function("*")'
Although static methods defined in the same .cpp file do show up. The
mangled names don't show up in the output of .function("_Z*"),
although nm shows them just fine. How does systemtap decide what to
filter out and what to keep?
Thanks again,
Martin
On Fri, Sep 6, 2013 at 10:17 AM, Martin Martin <martin@infinio.com> wrote:
> Hi,
>
> Thanks a lot for your response. I created a virtual machine running
> the latest beta of Ubuntu 13.10, which is Linux 3.11.0, and I can now
> probe returns!
>
> However, I only get events (function enter or exit) if I start the
> process from stap using -c. If I just run the process from the shell,
> then run stap, I don't get any events. Any idea what I could be doing
> wrong?
>
> Thanks,
> Martin
>
> On Thu, Sep 5, 2013 at 4:42 PM, Yichun Zhang (agentzh)
> <agentzh@gmail.com> wrote:
>> Hello!
>>
>> On Thu, Sep 5, 2013 at 1:36 PM, Martin Martin wrote:
>>> The following systemtap script fails to compile:
>>>
>>> probe process("myexe").function("myFun").return { print("hi mom\n") }
>>>
>> [...]
>>>
>>> I'm on Ubuntu 13.04, Linux 3.8.0-29-generic, system tap 2.1/0.153.
>>>
>>
>> The Linux kernel 3.8 does not support uretprobes. I think you need to
>> use kernel 3.10+ for that or downgrade to older kernels with the
>> utrace patch applied.
>>
>> Regards,
>> -agentzh