diff options
Diffstat (limited to 'tools/perf/tests/sw-clock.c')
-rw-r--r-- | tools/perf/tests/sw-clock.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 6e2b44ec0749..6664a7cd828c 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include "util/cpumap.h" | 9 | #include "util/cpumap.h" |
10 | #include "util/thread_map.h" | 10 | #include "util/thread_map.h" |
11 | 11 | ||
12 | #define NR_LOOPS 1000000 | 12 | #define NR_LOOPS 10000000 |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * This test will open software clock events (cpu-clock, task-clock) | 15 | * This test will open software clock events (cpu-clock, task-clock) |
@@ -34,7 +34,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
34 | .freq = 1, | 34 | .freq = 1, |
35 | }; | 35 | }; |
36 | 36 | ||
37 | attr.sample_freq = 10000; | 37 | attr.sample_freq = 500; |
38 | 38 | ||
39 | evlist = perf_evlist__new(); | 39 | evlist = perf_evlist__new(); |
40 | if (evlist == NULL) { | 40 | if (evlist == NULL) { |
@@ -42,7 +42,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
42 | return -1; | 42 | return -1; |
43 | } | 43 | } |
44 | 44 | ||
45 | evsel = perf_evsel__new(&attr, 0); | 45 | evsel = perf_evsel__new(&attr); |
46 | if (evsel == NULL) { | 46 | if (evsel == NULL) { |
47 | pr_debug("perf_evsel__new\n"); | 47 | pr_debug("perf_evsel__new\n"); |
48 | goto out_free_evlist; | 48 | goto out_free_evlist; |
@@ -57,7 +57,14 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
57 | goto out_delete_maps; | 57 | goto out_delete_maps; |
58 | } | 58 | } |
59 | 59 | ||
60 | perf_evlist__open(evlist); | 60 | if (perf_evlist__open(evlist)) { |
61 | const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate"; | ||
62 | |||
63 | err = -errno; | ||
64 | pr_debug("Couldn't open evlist: %s\nHint: check %s, using %" PRIu64 " in this test.\n", | ||
65 | strerror(errno), knob, (u64)attr.sample_freq); | ||
66 | goto out_delete_maps; | ||
67 | } | ||
61 | 68 | ||
62 | err = perf_evlist__mmap(evlist, 128, true); | 69 | err = perf_evlist__mmap(evlist, 128, true); |
63 | if (err < 0) { | 70 | if (err < 0) { |