2 // Similar to Cachegrind, check if instrumentation works in the presence
3 // of a client request. Uses a Callgrind request to check this.
5 #include "../callgrind.h"
11 for(i
=0;i
<10;i
++) sum
+= i
; /* some dummy work */
16 int some_callgrind_clreqs()
18 int sum
= some_work(0);
22 sum
+= some_work(sum
);
26 sum
+= some_work(sum
);
28 CALLGRIND_DUMP_STATS_AT("Please dump here");
30 return some_work(sum
);
33 int more_callgrind_clreqs()
35 int sum
= some_callgrind_clreqs();
37 CALLGRIND_TOGGLE_COLLECT
;
39 sum
+= some_callgrind_clreqs();
41 CALLGRIND_TOGGLE_COLLECT
;
49 more_callgrind_clreqs();
51 CALLGRIND_STOP_INSTRUMENTATION
;
53 more_callgrind_clreqs();
55 CALLGRIND_START_INSTRUMENTATION
;
57 more_callgrind_clreqs();
59 CALLGRIND_STOP_INSTRUMENTATION
;
61 more_callgrind_clreqs();
63 CALLGRIND_START_INSTRUMENTATION
;
65 return RUNNING_ON_VALGRIND
;