acln0/perf

Tests fail as user with paranoid=1

pwaller opened this issue · 3 comments

--- FAIL: TestCount (0.08s)
    --- FAIL: TestCount/Software (0.02s)
        --- FAIL: TestCount/Software/PageFaults (0.02s)
            count_test.go:99: failed to drop VM cache: open /proc/sys/vm/drop_caches: permission denied
    --- FAIL: TestCount/IoctlAndCountIDsMatch (0.00s)
        count_test.go:366: failed to drop VM cache: open /proc/sys/vm/drop_caches: permission denied
--- FAIL: TestReadRecord (0.01s)
    --- FAIL: TestReadRecord/CPUWideSwitch (0.00s)
        record_test.go:846: perf_event_open: permission denied

Please note CPUWideSwitch in particular - I have a suggestion/another discussion for the TestCounts.

#16 fixes the TestCount failures.

This is currently working for me. Not sure what changed between now and when I last tried.

Oh, hang on, CPUWideSwitch is still failing, and I think it's because it uses trace events, it requires parnoid(0), not paranoid(1). Will send patch.