I want to get the return value of malloc, my DTrace command is:
sudo dtrace -n 'pid32519::malloc:return {printf("%p %p %p %p %p %p %p %p %p %p %s\n",arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,probefunc);}'
and the pid of provider is a tiny program as follow:
printf("%d\n",getpid());
getchar();
int cnt=50;
void* a = malloc(1000);
printf("%llx\n",a);
a = malloc(1000);
printf("%llx\n",a);
a = malloc(1000);
printf("%llx\n",a);
a = malloc(1000);
printf("%llx\n",a);
getchar();
return 0;
I found some documentation that say "arg1 holds return value", but the result is:
CPU ID FUNCTION:NAME
8 10499 malloc:return f a 1 0 0 0 0 0 0 60000000a malloc
8 10499 malloc:return f f 1 0 0 0 0 0 f00000000 60000000a malloc
8 10499 malloc:return f 10 1 0 0 0 0 0 f00000010 60000000a malloc
8 10499 malloc:return f 10 1 0 0 0 0 1000000000 f00000010 60000000a malloc
There is none of args equaled the return value of malloc and where is it?