On Sun, Jul 20, 2008 at 11:15:43AM +0800, zhihui Chen wrote:
> I want to check value of the in-out parameter of one function when it
> returns, but each time dtrace will report error.
> Following is the script, anyone can help me correct the error with it?
> #!/usr/sbin/dtrace -s
> #pragma D option quiet
> #pragma D option bufsize=4m
> 
> fbt::kstrgetmsg:entry
> /pid==$target/
> {
>         self->arg1=arg1;

This should really be:

        self->arg1 = args[1];

That way, it will get the correct type automatically.

> }
> fbt::kstrgetmsg:return
> /pid==$target&&self->arg1/
> {
>         printf("mp=%x\n",*(uint64_t *)copyin(self->arg1,8));

And this should be:

        printf("mp=%x\n", *self->arg1);

Cheers,
- jonathan
>         self->arg1=0;
> }
> 
> intel6# ./kstrgetmsg.d -c "rcp intel2-1:/test1000k ."
> rcp: dropped connection
> dtrace: error on enabled probe ID 2 (ID 17047:
> fbt:genunix:kstrgetmsg:return): invalid address (0xffffff001edd9b90) in
> action #1 at DIF offset 52
> dtrace: error on enabled probe ID 2 (ID 17047:
> fbt:genunix:kstrgetmsg:return): invalid address (0xffffff001edd9b90) in
> action #1 at DIF offset 52
> dtrace: error on enabled probe ID 2 (ID 17047:
> fbt:genunix:kstrgetmsg:return): invalid address (0xffffff001edd9b90) in
> action #1 at DIF offset 52
> .......
> 
> 
> Thanks
> Zhihui

> _______________________________________________
> dtrace-discuss mailing list
> [email protected]
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to