@@ -15,9 +15,32 @@ mutable struct Parameters
15
15
gcsample:: Bool
16
16
time_tolerance:: Float64
17
17
memory_tolerance:: Float64
18
+ enable_linux_perf:: Bool
19
+ linux_perf_groups:: String
20
+ linux_perf_spaces:: NTuple{3,Bool}
21
+ linux_perf_threads:: Bool
22
+ linux_perf_gcscrub:: Bool
18
23
end
19
24
20
- const DEFAULT_PARAMETERS = Parameters (5.0 , 10000 , 1 , false , 0 , true , false , 0.05 , 0.01 )
25
+ # Task clock has large overhead so is not useful for the short time we run functions under perf
26
+ # Further we benchmark anyways so no need for cycles or task clock
27
+ # I've tried to only use one group by getting rid of noisy or not useful metrics
28
+ const DEFAULT_PARAMETERS = Parameters (
29
+ 5.0 ,
30
+ 10000 ,
31
+ 1 ,
32
+ false ,
33
+ 0 ,
34
+ true ,
35
+ false ,
36
+ 0.05 ,
37
+ 0.01 ,
38
+ false ,
39
+ " (instructions,branch-instructions)" ,
40
+ (true , false , false ),
41
+ true ,
42
+ true ,
43
+ )
21
44
22
45
function Parameters (;
23
46
seconds= DEFAULT_PARAMETERS. seconds,
@@ -29,6 +52,11 @@ function Parameters(;
29
52
gcsample= DEFAULT_PARAMETERS. gcsample,
30
53
time_tolerance= DEFAULT_PARAMETERS. time_tolerance,
31
54
memory_tolerance= DEFAULT_PARAMETERS. memory_tolerance,
55
+ enable_linux_perf= DEFAULT_PARAMETERS. enable_linux_perf,
56
+ linux_perf_groups= DEFAULT_PARAMETERS. linux_perf_groups,
57
+ linux_perf_spaces= DEFAULT_PARAMETERS. linux_perf_spaces,
58
+ linux_perf_threads= DEFAULT_PARAMETERS. linux_perf_threads,
59
+ linux_perf_gcscrub= DEFAULT_PARAMETERS. linux_perf_gcscrub,
32
60
)
33
61
return Parameters (
34
62
seconds,
@@ -40,6 +68,11 @@ function Parameters(;
40
68
gcsample,
41
69
time_tolerance,
42
70
memory_tolerance,
71
+ enable_linux_perf,
72
+ linux_perf_groups,
73
+ linux_perf_spaces,
74
+ linux_perf_threads,
75
+ linux_perf_gcscrub,
43
76
)
44
77
end
45
78
@@ -53,6 +86,11 @@ function Parameters(
53
86
gcsample= nothing ,
54
87
time_tolerance= nothing ,
55
88
memory_tolerance= nothing ,
89
+ enable_linux_perf= nothing ,
90
+ linux_perf_groups= nothing ,
91
+ linux_perf_spaces= nothing ,
92
+ linux_perf_threads= nothing ,
93
+ linux_perf_gcscrub= nothing ,
56
94
)
57
95
params = Parameters ()
58
96
params. seconds = seconds != nothing ? seconds : default. seconds
@@ -65,6 +103,31 @@ function Parameters(
65
103
time_tolerance != nothing ? time_tolerance : default. time_tolerance
66
104
params. memory_tolerance =
67
105
memory_tolerance != nothing ? memory_tolerance : default. memory_tolerance
106
+ params. enable_linux_perf = if enable_linux_perf != nothing
107
+ enable_linux_perf
108
+ else
109
+ default. enable_linux_perf
110
+ end
111
+ params. linux_perf_groups = if linux_perf_groups != nothing
112
+ linux_perf_groups
113
+ else
114
+ default. linux_perf_groups
115
+ end
116
+ params. linux_perf_spaces = if linux_perf_spaces != nothing
117
+ linux_perf_spaces
118
+ else
119
+ default. linux_perf_spaces
120
+ end
121
+ params. linux_perf_threads = if linux_perf_threads != nothing
122
+ linux_perf_threads
123
+ else
124
+ default. linux_perf_threads
125
+ end
126
+ params. linux_perf_gcscrub = if linux_perf_gcscrub != nothing
127
+ linux_perf_gcscrub
128
+ else
129
+ default. linux_perf_gcscrub
130
+ end
68
131
return params:: BenchmarkTools.Parameters
69
132
end
70
133
@@ -76,7 +139,12 @@ function Base.:(==)(a::Parameters, b::Parameters)
76
139
a. gctrial == b. gctrial &&
77
140
a. gcsample == b. gcsample &&
78
141
a. time_tolerance == b. time_tolerance &&
79
- a. memory_tolerance == b. memory_tolerance
142
+ a. memory_tolerance == b. memory_tolerance &&
143
+ a. enable_linux_perf == b. enable_linux_perf &&
144
+ a. linux_perf_groups == b. linux_perf_groups &&
145
+ a. linux_perf_spaces == b. linux_perf_spaces &&
146
+ a. linux_perf_threads == b. linux_perf_threads &&
147
+ a. linux_perf_gcscrub == b. linux_perf_gcscrub
80
148
end
81
149
82
150
function Base. copy (p:: Parameters )
@@ -90,6 +158,11 @@ function Base.copy(p::Parameters)
90
158
p. gcsample,
91
159
p. time_tolerance,
92
160
p. memory_tolerance,
161
+ p. enable_linux_perf,
162
+ p. linux_perf_groups,
163
+ p. linux_perf_spaces,
164
+ p. linux_perf_threads,
165
+ p. linux_perf_gcscrub,
93
166
)
94
167
end
95
168
0 commit comments