| 1 |
global indent, indent_str, entry_p |
| 2 |
|
| 3 |
probe begin { |
| 4 |
indent = 0 |
| 5 |
for (i=0; i<20; i++) { |
| 6 |
if (i == 0) |
| 7 |
indent_str[0] = "" |
| 8 |
else |
| 9 |
indent_str[i] = indent_str[i-1] . " " |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
|
| 14 |
probe nd_syscall.* ? { |
| 15 |
if (pid() == target()) { |
| 16 |
if (entry_p) printf("\n") |
| 17 |
printf("%s%s: %s (%s) = ", indent_str[indent], execname(), name, argstr) |
| 18 |
# printf("%s%s: %s (%s) = ", indent_str[indent], execname(), probefunc(), argstr) |
| 19 |
indent++ |
| 20 |
entry_p = 1 |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
probe nd_syscall.*.return ? { |
| 25 |
if (pid() == target()) { |
| 26 |
if (indent) indent-- |
| 27 |
if (entry_p) |
| 28 |
printf("%s\n", retstr) |
| 29 |
else |
| 30 |
printf("%s%s\n", indent_str[indent],retstr) |
| 31 |
entry_p = 0 |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
probe end { |
| 36 |
printf("\n") |
| 37 |
} |