Skip to content

Commit 20bf97b

Browse files
committed
Add execution test for perf integration
1 parent 1b02997 commit 20bf97b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/ExecutionTests.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module ExecutionTests
33
using BenchmarkTools
44
using Profile
55
using Test
6+
using LinuxPerf
67

78
seteq(a, b) = length(a) == length(b) == length(intersect(a, b))
89

@@ -383,4 +384,24 @@ b = x = nothing
383384
GC.gc()
384385
@test x_finalized
385386

387+
##################################
388+
# Linux Perf Integration #
389+
##################################
390+
391+
b = @benchmarkable sin(42.)
392+
results = run(b, seconds=1, enable_linux_perf=true)
393+
@test results.linux_perf_stats !== nothing
394+
@test any(reults.linux_perf_stats.threads) do thread
395+
clock = LinuxPerf.scaledcount(thread["task-clock"])
396+
!isnan(clock) && clock > 0
397+
end
398+
399+
b = @benchmarkable sin(42.)
400+
results = run(b, seconds=1, enable_linux_perf=false)
401+
@test results.linux_perf_stats === nothing
402+
403+
b = @benchmarkable sin(42.)
404+
results = run(b, seconds=1)
405+
@test results.linux_perf_stats === nothing
406+
386407
end # module

0 commit comments

Comments
 (0)