This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Systemtap Probe C++ new and delete Operator
- From: Felix Lu <flu at redhat dot com>
- To: Andy Librian <andy dot librian at kmklabs dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 4 Aug 2016 11:42:48 -0400 (EDT)
- Subject: Re: Systemtap Probe C++ new and delete Operator
- Authentication-results: sourceware.org; auth=none
- References: <CANBzSrFBABpL=4=mdVXCNkCP+VS5KVcP3P=jpLVszoC0i_aaWQ@mail.gmail.com>
----- Original Message -----
> From: "Andy Librian" <andy.librian@kmklabs.com>
> To: systemtap@sourceware.org
> Sent: Wednesday, 3 August, 2016 11:05:33 PM
> Subject: Systemtap Probe C++ new and delete Operator
>
> Hi,
>
> I'm curious if Systemtap can probe C++ new and delete operator. Maybe like:
This can be done like this if you have dwarf debugging info installed:
test.cpp:
int main(int argc, char** argv) {
int* x = new int[256];
int* y = new int;
delete[] x;
int* z = new int;
delete y;
return 0;
}
$ g++ test.cpp
$ stap -e 'probe process("a.out").library("libstdc++.so.6").{function("operator new"), function("operator delete")} {println(ppfunc())}'
operator new
operator new
operator delete
operator new
operator delete
You can take a look at man stapprobes for more information.
>
> probe process(PATH).function("__1c2n6FI_pv_") {
> }
>
> I'm trying to find the source of memory leak using this approach:
>
> https://blogs.oracle.com/openomics/entry/investigating_memory_leaks_with_dtrace
>
>
> Regards,
>
> Andy Librian.
> KMK Online.
>
- Felix