Fletcher,
Mark Durney hit similar problem and while I was working with him and
talking to
my colleague he pointed out that we could use "function:offset" notation
when we
are using pid-provider.
So, I have modified the script to enable the first instruction of malloc.
Attached is the script. Please try it out and let me know if it works.
If it does I shall update my blog to reflect it.
NOTE : If there more functions which fail (for :entry) please replace
"entry" with 0.
Thanks and regards,
Sanjeev.
Sanjeev Bagewadi wrote:
Fletcher,
You could attach mdb to the running process and disassemble the routine
in question :
-- snip --
# mdb -p <pid>
> malloc::dis
libc.so.1`malloc: pushl %ebp
libc.so.1`malloc+1: movl %esp,%ebp
libc.so.1`malloc+3: pushl %ebx
libc.so.1`malloc+4: pushl %esi
libc.so.1`malloc+5: pushl %edi
libc.so.1`malloc+6: call +0x5 <libc.so.1`malloc+0xb>
libc.so.1`malloc+0xb: popl %ebx
libc.so.1`malloc+0xc: addl $0x88fe1,%ebx
-- snip --
So, in my case notice that the first instruction is "pushl".
Thanks and regards,
Sanjeev.
Fletcher Cocquyt wrote:
Can you please provide a reference for disassembling malloc on Solaris 10?
I am also pursuing the previous suggestion of a Python provider - this one
seems to be against Python 2.5:
http://blogs.sun.com/binujp/resource/pydtrace/diffs
Thanks,
Fletcher
On 7/1/08 9:48 PM, "Sanjeev Bagewadi" <[EMAIL PROTECTED]> wrote:
Hello Fletcher,
From the error looks like dtrace is not able recognize it as probe.
DTrace needs a signature for the function to be detected as probe.
Probably this is missing in case of malloc.
Just to double check this you could disassemble malloc and check if we
have a "push' instruction at the beginning.
Thanks and regards,
Sanjeev.
Fletcher Cocquyt wrote:
Hola, I am trying to isolate the memory leak I suspect in a mailman
installation I found:
http://blogs.sun.com/sanjeevb/date/200506
It gives an error:
[EMAIL PROTECTED]:~ 9:21am 65 # ./memleak.d 10312
dtrace: failed to compile script ./memleak.d: line 3: probe
description pid10312:libc.so.1:malloc:entry does not match any probes
I am on SunOS 5.10 Generic_127112-07 i86pc i386 i86pc
Are there some better scripts for isolating memory leaks?
thanks
Fletch.
------------------------------------------------------------------------
_______________________________________________
dtrace-discuss mailing list
[email protected]
--
Solaris Revenue Products Engineering,
India Engineering Center,
Sun Microsystems India Pvt Ltd.
Tel: x27521 +91 80 669 27521
#!/usr/sbin/dtrace -s
pid$1:libc.so.1:malloc:0
{
self->trace = 1;
self->size = arg0;
}
pid$1:libc.so.1:malloc:return
/self->trace == 1/
{
printf("Ptr=0x%p Size=%d", arg1, self->size);
ustack();
self->trace = 0;
self->size = 0;
}
pid$1:libc.so.1:realloc:entry
{
self->trace = 1;
self->size = arg1;
self->oldptr = arg0;
}
pid$1:libc.so.1:realloc:return
/self->trace == 1/
{
printf("Ptr=0x%p Oldptr=0x%p Size=%d", arg1, self->oldptr,
self->size);
ustack();
self->trace = 0;
self->size = 0;
}
pid$1:libc.so.1:calloc:entry
/self->trace == 1/
{
self->trace = 1;
self->size = arg1;
}
pid$1:libc.so.1:calloc:return
/self->trace == 1/
{
printf("Ptr=0x%p Size=%d", arg1, self->size);
ustack();
self->trace = 0;
self->size = 0;
}
pid$1:libc.so.1:free:entry
{
printf("Ptr=0x%p ", arg0);
}
_______________________________________________
dtrace-discuss mailing list
[email protected]