Skip to content

Commit 1ee189b

Browse files
committed
Remove broken support for custom LinuxPerf Options
1 parent 3e73644 commit 1ee189b

File tree

6 files changed

+4
-17
lines changed

6 files changed

+4
-17
lines changed

docs/src/manual.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ You can pass the following keyword arguments to `@benchmark`, `@benchmarkable`,
8686
- `time_tolerance`: The noise tolerance for the benchmark's time estimate, as a percentage. This is utilized after benchmark execution, when analyzing results. Defaults to `BenchmarkTools.DEFAULT_PARAMETERS.time_tolerance = 0.05`.
8787
- `memory_tolerance`: The noise tolerance for the benchmark's memory estimate, as a percentage. This is utilized after benchmark execution, when analyzing results. Defaults to `BenchmarkTools.DEFAULT_PARAMETERS.memory_tolerance = 0.01`.
8888
- `enable_linux_perf`: If `true`, profile using perf once. Defaults to `BenchmarkTools.DEFAULT_PARAMETERS.enable_linux_perf = false`.
89-
- `linux_perf_options`: Options for perf profiling. Defaults to `BenchmarkTools.DEFAULT_PARAMETERS.linux_perf_options = String[]`. See LinuxPerf.jl for further details.
9089

9190
To change the default values of the above fields, one can mutate the fields of `BenchmarkTools.DEFAULT_PARAMETERS`, for example:
9291

src/BenchmarkTools.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ end
2626

2727
##############
2828
# Parameters #
29+
##############
2930

3031
include("parameters.jl")
3132

src/execution.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,7 @@ function generate_benchmark_definition(
593593
$(Expr(:tuple, quote_vars...)), __params::$BenchmarkTools.Parameters
594594
)
595595
# Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061
596-
__linux_perf_options = $LinuxPerf.parse_pstats_options(
597-
__params.linux_perf_options
598-
)
596+
__linux_perf_options = $LinuxPerf.parse_pstats_options([])
599597
__linux_perf_groups = $LinuxPerf.set_default_spaces(
600598
eval(__linux_perf_options.events), eval(__linux_perf_options.spaces)
601599
)

src/parameters.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ mutable struct Parameters
1616
time_tolerance::Float64
1717
memory_tolerance::Float64
1818
enable_linux_perf::Bool
19-
linux_perf_options::Vector{String}
2019
end
2120

2221
const DEFAULT_PARAMETERS = Parameters(
23-
5.0, 10000, 1, false, 0, true, false, 0.05, 0.01, false, String[]
22+
5.0, 10000, 1, false, 0, true, false, 0.05, 0.01, false
2423
)
2524

2625
function Parameters(;
@@ -34,7 +33,6 @@ function Parameters(;
3433
time_tolerance=DEFAULT_PARAMETERS.time_tolerance,
3534
memory_tolerance=DEFAULT_PARAMETERS.memory_tolerance,
3635
enable_linux_perf=DEFAULT_PARAMETERS.enable_linux_perf,
37-
linux_perf_options=DEFAULT_PARAMETERS.linux_perf_options,
3836
)
3937
return Parameters(
4038
seconds,
@@ -47,7 +45,6 @@ function Parameters(;
4745
time_tolerance,
4846
memory_tolerance,
4947
enable_linux_perf,
50-
linux_perf_options,
5148
)
5249
end
5350

@@ -62,7 +59,6 @@ function Parameters(
6259
time_tolerance=nothing,
6360
memory_tolerance=nothing,
6461
enable_linux_perf=nothing,
65-
linux_perf_options=nothing,
6662
)
6763
params = Parameters()
6864
params.seconds = seconds != nothing ? seconds : default.seconds
@@ -80,8 +76,6 @@ function Parameters(
8076
else
8177
default.enable_linux_perf
8278
end
83-
params.linux_perf_options =
84-
linux_perf_options != nothing ? linux_perf_options : default.linux_perf_options
8579
return params::BenchmarkTools.Parameters
8680
end
8781

@@ -94,8 +88,7 @@ function Base.:(==)(a::Parameters, b::Parameters)
9488
a.gcsample == b.gcsample &&
9589
a.time_tolerance == b.time_tolerance &&
9690
a.memory_tolerance == b.memory_tolerance &&
97-
a.enable_linux_perf == b.enable_linux_perf &&
98-
a.linux_perf_options == b.linux_perf_options
91+
a.enable_linux_perf == b.enable_linux_perf
9992
end
10093

10194
function Base.copy(p::Parameters)
@@ -110,7 +103,6 @@ function Base.copy(p::Parameters)
110103
p.time_tolerance,
111104
p.memory_tolerance,
112105
p.enable_linux_perf,
113-
p.linux_perf_options,
114106
)
115107
end
116108

src/serialization.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ function recover(x::Vector)
8686
false
8787
elseif fn == "enable_linux_perf" && !haskey(fields, fn)
8888
false
89-
elseif fn == "linux_perf_options" && !haskey(fields, fn)
90-
String[]
9189
else
9290
convert(ft, fields[fn])
9391
end

src/trials.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ function TrialEstimate(trial::Trial, t, gct)
121121
)
122122
end
123123

124-
# Should we compare linux_perf_stats here?
125124
function Base.:(==)(a::TrialEstimate, b::TrialEstimate)
126125
return a.params == b.params &&
127126
a.time == b.time &&

0 commit comments

Comments
 (0)