@@ -10,70 +10,48 @@ pub const CallgrindClientRequest = extern enum {
10
10
StopInstrumentation ,
11
11
};
12
12
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 );
21
15
}
22
16
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 {
27
18
_ = doCallgrindClientRequestExpr (0 , request , a1 , a2 , a3 , a4 , a5 );
28
19
}
29
20
30
-
31
-
32
21
/// Dump current state of cost centers, and zero them afterwards
33
22
pub fn dumpStats () void {
34
- doCallgrindClientRequestStmt (CallgrindClientRequest .DumpStats ,
35
- 0 , 0 , 0 , 0 , 0 );
23
+ doCallgrindClientRequestStmt (CallgrindClientRequest .DumpStats , 0 , 0 , 0 , 0 , 0 );
36
24
}
37
25
38
-
39
26
/// Dump current state of cost centers, and zero them afterwards.
40
27
/// The argument is appended to a string stating the reason which triggered
41
28
/// the dump. This string is written as a description field into the
42
29
/// profile data dump.
43
30
pub 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 );
47
32
}
48
33
49
-
50
34
/// Zero cost centers
51
35
pub fn zeroStats () void {
52
- doCallgrindClientRequestStmt (CallgrindClientRequest .ZeroStats ,
53
- 0 , 0 , 0 , 0 , 0 );
36
+ doCallgrindClientRequestStmt (CallgrindClientRequest .ZeroStats , 0 , 0 , 0 , 0 , 0 );
54
37
}
55
38
56
-
57
39
/// Toggles collection state.
58
40
/// The collection state specifies whether the happening of events
59
41
/// should be noted or if they are to be ignored. Events are noted
60
42
/// by increment of counters in a cost center
61
43
pub fn toggleCollect () void {
62
- doCallgrindClientRequestStmt (CallgrindClientRequest .ToggleCollect ,
63
- 0 , 0 , 0 , 0 , 0 );
44
+ doCallgrindClientRequestStmt (CallgrindClientRequest .ToggleCollect , 0 , 0 , 0 , 0 , 0 );
64
45
}
65
46
66
-
67
47
/// Start full callgrind instrumentation if not already switched on.
68
48
/// When cache simulation is done, it will flush the simulated cache;
69
49
/// this will lead to an artificial cache warmup phase afterwards with
70
50
/// cache misses which would not have happened in reality.
71
51
pub fn startInstrumentation () void {
72
- doCallgrindClientRequestStmt (CallgrindClientRequest .StartInstrumentation ,
73
- 0 , 0 , 0 , 0 , 0 );
52
+ doCallgrindClientRequestStmt (CallgrindClientRequest .StartInstrumentation , 0 , 0 , 0 , 0 , 0 );
74
53
}
75
54
76
-
77
55
/// Stop full callgrind instrumentation if not already switched off.
78
56
/// This flushes Valgrinds translation cache, and does no additional
79
57
/// instrumentation afterwards, which effectivly will run at the same
@@ -82,6 +60,5 @@ pub fn startInstrumentation() void {
82
60
/// To start Callgrind in this mode to ignore the setup phase, use
83
61
/// the option "--instr-atstart=no".
84
62
pub fn stopInstrumentation () void {
85
- doCallgrindClientRequestStmt (CallgrindClientRequest .StopInstrumentation ,
86
- 0 , 0 , 0 , 0 , 0 );
63
+ doCallgrindClientRequestStmt (CallgrindClientRequest .StopInstrumentation , 0 , 0 , 0 , 0 , 0 );
87
64
}
0 commit comments