Sometime when we want to debug our program, we have to verify what's the program real step of function calls. We can use the DTrace to achieve it. For example (scenario): 1. Create C file /tmp/t.c with following source. #include <stdio.h> int f1(int a) { f2(a+2); } int f2(int b) { printf("%d\n", b+3); } int main(int argc, char *argv) { char a='1'; f1(a); } 2. compiler then run it. # gcc -o /tmp/t /tmp/t.c # /tmp/t 54 # When we got the answer 54, why the answer is '54', is rare(we think, 1+2+3, should be '6'). Then we can use DTrace to trace it. 3. write a D-Language script (/tmp/t.d), then change mode with 700. # cat /tmp/t.d #!/usr/sbin/dtrace -s #pragma D option quiet pid$1:t:f1:entry { printf("f1: %d\n", arg0); } pid$1:t:f2:entry { printf("f2: %d\n", arg0); } # chmod 700 4. use mdb to execute the program. (terminal 1) PS. _start:b, set breakpoint in _start function :...