5 void (*fnptr
[256])(char*, char*);
11 (*fnptr[(int)*calls])(calls,seq); \
14 void stacktrace(char*last
, char* callsequence
)
16 fprintf(stderr
, "\n");
17 VALGRIND_PRINTF_BACKTRACE ("%s", callsequence
);
19 __attribute__((noinline
)) void f_a(char *calls
, char*seq
);
20 __attribute__((noinline
)) void f_b(char *calls
, char*seq
);
21 __attribute__((noinline
)) void f_c(char *calls
, char*seq
);
22 __attribute__((noinline
)) void f_d(char *calls
, char*seq
);
24 __attribute__((noinline
)) void f_a(char *calls
, char*seq
)
27 __attribute__((noinline
)) void f_b(char *calls
, char*seq
)
30 __attribute__((noinline
)) void f_c(char *calls
, char*seq
)
33 __attribute__((noinline
)) void f_d(char *calls
, char*seq
)
36 void doit (int argc
, char**argv
)
39 for (i
= 1; i
< argc
; i
++) {
40 char* calls
= argv
[i
];
47 int main(int argc
, char**argv
)
50 fnptr
[0] = stacktrace
;
56 doit(argc
, argv
); // with default value of our argument.
58 (void) VALGRIND_MONITOR_COMMAND("v.set merge-recursive-frames 3");
61 (void) VALGRIND_MONITOR_COMMAND("v.set merge-recursive-frames 2");
64 (void) VALGRIND_MONITOR_COMMAND("v.set merge-recursive-frames 1");
67 (void) VALGRIND_MONITOR_COMMAND("v.set merge-recursive-frames 0");