@@ -10,70 +10,48 @@ pub const CallgrindClientRequest = extern enum {
1010 StopInstrumentation ,
1111};
1212
13- fn doCallgrindClientRequestExpr (default : usize , request : CallgrindClientRequest ,
14- a1 : usize , a2 : usize , a3 : usize , a4 : usize , a5 : usize
15- ) usize
16- {
17- return valgrind .doClientRequest (
18- default ,
19- @intCast (usize , @enumToInt (request )),
20- a1 , a2 , a3 , a4 , a5 );
13+ fn doCallgrindClientRequestExpr (default : usize , request : CallgrindClientRequest , a1 : usize , a2 : usize , a3 : usize , a4 : usize , a5 : usize ) usize {
14+ return valgrind .doClientRequest (default , @intCast (usize , @enumToInt (request )), a1 , a2 , a3 , a4 , a5 );
2115}
2216
23- fn doCallgrindClientRequestStmt (request : CallgrindClientRequest ,
24- a1 : usize , a2 : usize , a3 : usize , a4 : usize , a5 : usize
25- ) void
26- {
17+ fn doCallgrindClientRequestStmt (request : CallgrindClientRequest , a1 : usize , a2 : usize , a3 : usize , a4 : usize , a5 : usize ) void {
2718 _ = doCallgrindClientRequestExpr (0 , request , a1 , a2 , a3 , a4 , a5 );
2819}
2920
30-
31-
3221/// Dump current state of cost centers, and zero them afterwards
3322pub fn dumpStats () void {
34- doCallgrindClientRequestStmt (CallgrindClientRequest .DumpStats ,
35- 0 , 0 , 0 , 0 , 0 );
23+ doCallgrindClientRequestStmt (CallgrindClientRequest .DumpStats , 0 , 0 , 0 , 0 , 0 );
3624}
3725
38-
3926/// Dump current state of cost centers, and zero them afterwards.
4027/// The argument is appended to a string stating the reason which triggered
4128/// the dump. This string is written as a description field into the
4229/// profile data dump.
4330pub fn dumpStatsAt (pos_str : [* ]u8 ) void {
44- doCallgrindClientRequestStmt (CallgrindClientRequest .DumpStatsAt ,
45- @ptrToInt (pos_str ),
46- 0 , 0 , 0 , 0 );
31+ doCallgrindClientRequestStmt (CallgrindClientRequest .DumpStatsAt , @ptrToInt (pos_str ), 0 , 0 , 0 , 0 );
4732}
4833
49-
5034/// Zero cost centers
5135pub fn zeroStats () void {
52- doCallgrindClientRequestStmt (CallgrindClientRequest .ZeroStats ,
53- 0 , 0 , 0 , 0 , 0 );
36+ doCallgrindClientRequestStmt (CallgrindClientRequest .ZeroStats , 0 , 0 , 0 , 0 , 0 );
5437}
5538
56-
5739/// Toggles collection state.
5840/// The collection state specifies whether the happening of events
5941/// should be noted or if they are to be ignored. Events are noted
6042/// by increment of counters in a cost center
6143pub fn toggleCollect () void {
62- doCallgrindClientRequestStmt (CallgrindClientRequest .ToggleCollect ,
63- 0 , 0 , 0 , 0 , 0 );
44+ doCallgrindClientRequestStmt (CallgrindClientRequest .ToggleCollect , 0 , 0 , 0 , 0 , 0 );
6445}
6546
66-
6747/// Start full callgrind instrumentation if not already switched on.
6848/// When cache simulation is done, it will flush the simulated cache;
6949/// this will lead to an artificial cache warmup phase afterwards with
7050/// cache misses which would not have happened in reality.
7151pub fn startInstrumentation () void {
72- doCallgrindClientRequestStmt (CallgrindClientRequest .StartInstrumentation ,
73- 0 , 0 , 0 , 0 , 0 );
52+ doCallgrindClientRequestStmt (CallgrindClientRequest .StartInstrumentation , 0 , 0 , 0 , 0 , 0 );
7453}
7554
76-
7755/// Stop full callgrind instrumentation if not already switched off.
7856/// This flushes Valgrinds translation cache, and does no additional
7957/// instrumentation afterwards, which effectivly will run at the same
@@ -82,6 +60,5 @@ pub fn startInstrumentation() void {
8260/// To start Callgrind in this mode to ignore the setup phase, use
8361/// the option "--instr-atstart=no".
8462pub fn stopInstrumentation () void {
85- doCallgrindClientRequestStmt (CallgrindClientRequest .StopInstrumentation ,
86- 0 , 0 , 0 , 0 , 0 );
63+ doCallgrindClientRequestStmt (CallgrindClientRequest .StopInstrumentation , 0 , 0 , 0 , 0 , 0 );
8764}
0 commit comments