LinuxPerf.jl

Author JuliaPerf
Popularity
15 Stars
Updated Last
5 Months Ago
Started In
May 2020

LinuxPerf.jl -- Julia wrapper for Linux's perf

Build Status Coverage

the kernel multiplexes event counter that requires limited hardware resources so some counters are only active for a fraction of the running time (% on the right).

if you need to compare two quantities you must put them in the same event group so they are always scheduled at the same time (or not at all).

julia> using LinuxPerf

julia> @noinline function g(a)
           c = 0
           for x in a
               if x > 0
                   c += 1
               end
           end
           c
       end
g (generic function with 1 method)

julia> g(zeros(10000))
0

julia> data = zeros(10000); @measure g(data)
┌───────────────────────┬────────────┬─────────────┐
│                       │ Events     │ Active Time │
├───────────────────────┼────────────┼─────────────┤
│             hw:cycles │ 25,583,165100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│       hw:cache_access │ 1,640,429100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│       hw:cache_misses │ 328,561100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│           hw:branches │ 6,164,138100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│ hw:branch_mispredicts │ 223,272100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│       hw:instructions │ 28,115,285100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│       sw:ctx_switches │ 0100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│        sw:page_faults │ 41100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│  sw:minor_page_faults │ 41100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│  sw:major_page_faults │ 0100.0 %     │
├───────────────────────┼────────────┼─────────────┤
│     sw:cpu_migrations │ 0100.0 %     │
└───────────────────────┴────────────┴─────────────┘

For more fine tuned performance profile examples, please check out the test directory.

Used By Packages

No packages found.