linux/tools/testing/selftests/powerpc/pmu
Cyril Bur d4ecdff2ec selftests/powerpc/pmu: Use signed long to read perf_event_paranoid
Excerpt from man 2 perf_event_open:

  /proc/sys/kernel/perf_event_paranoid
  The perf_event_paranoid file can be set to restrict access to the
  performance counters.
    2 allow only user-space measurements.
    1 allow both kernel and user measurements (default).
    0 allow access to CPU-specific data but not raw tracepoint samples.
   -1 no restrictions.

require_paranoia_below() should return 0 if perf_event_paranoid is below
a specified level, the value from perf_event_paranoid is read into an
unsigned long so the incorrect value is returned when
perf_event_paranoid is set to -1.

Without this patch applied there is the same number of selftests/powerpc
which skip when /proc/sys/kernel/perf_event_paranoid is set to 1 or -1
but no skips when set to zero.

With this patch applied there are no skipped selftests/powerpc test when
/proc/sys/kernel/perf_event_paranoid is set to 0 or -1.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-07-05 23:49:49 +10:00
..
ebb selftests/powerpc: Load Monitor Register Tests 2016-06-21 15:30:50 +10:00
.gitignore selftests/powerpc: Make git ignore all binaries in powerpc test suite 2015-01-23 14:02:49 +11:00
count_instructions.c selftests/powerpc: Count more instructions & use decimal 2014-07-28 14:11:31 +10:00
event.c selftests/powerpc: Add tests of PMU EBBs 2014-06-11 17:03:58 +10:00
event.h selftests/powerpc: Add tests of PMU EBBs 2014-06-11 17:03:58 +10:00
l3_bank_test.c selftests/powerpc: Add test of L3 bank handling 2014-07-28 14:11:30 +10:00
lib.c selftests/powerpc/pmu: Use signed long to read perf_event_paranoid 2016-07-05 23:49:49 +10:00
lib.h selftests/powerpc: Move pick_online_cpu() up into utils.c 2015-12-17 10:46:41 +11:00
loop.S selftests/powerpc: Fix instruction loop for ABIv2 (LE) 2014-06-11 17:03:45 +10:00
Makefile selftests/powerpc: Move pick_online_cpu() up into utils.c 2015-12-17 10:46:41 +11:00
per_event_excludes.c selftests/powerpc: Add test of per-event excludes 2014-07-28 14:11:33 +10:00