Systemtap Probe C++ new and delete Operator
Felix Lu
flu@redhat.com
Thu Aug 4 15:43:00 GMT 2016
----- 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
More information about the Systemtap
mailing list