aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-05-02 08:08:43 -0400
committerTejun Heo <tj@kernel.org>2011-05-02 08:08:47 -0400
commitaff364860aa105b2deacc6f21ec8ef524460e3fc (patch)
tree18409ebe16b25b141598da9b6386d69416c06afa /tools/perf/builtin-record.c
parentc7a7b814c9dca9ee01b38e63b4a46de87156d3b6 (diff)
parent993ba1585cbb03fab012e41d1a5d24330a283b31 (diff)
Merge branch 'x86/numa' into x86-mm
Merge reason: Pick up x86-32 remap allocator cleanup changes - 14 commits, 3fe14ab541^..993ba1585c. 3fe14ab541: x86-32, numa: Fix failure condition check in alloc_remap() 993ba1585c: x86-32, numa: Update remap allocator comments Scheduled NUMA init 32/64bit unification changes depend on them. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 6febcc168a8..17d1dcb3c66 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -41,7 +41,7 @@ static u64 user_interval = ULLONG_MAX;
41static u64 default_interval = 0; 41static u64 default_interval = 0;
42 42
43static unsigned int page_size; 43static unsigned int page_size;
44static unsigned int mmap_pages = 128; 44static unsigned int mmap_pages = UINT_MAX;
45static unsigned int user_freq = UINT_MAX; 45static unsigned int user_freq = UINT_MAX;
46static int freq = 1000; 46static int freq = 1000;
47static int output; 47static int output;
@@ -275,11 +275,10 @@ try_again:
275 !no_inherit) < 0) { 275 !no_inherit) < 0) {
276 int err = errno; 276 int err = errno;
277 277
278 if (err == EPERM || err == EACCES) 278 if (err == EPERM || err == EACCES) {
279 die("Permission error - are you root?\n" 279 ui__warning_paranoid();
280 "\t Consider tweaking" 280 exit(EXIT_FAILURE);
281 " /proc/sys/kernel/perf_event_paranoid.\n"); 281 } else if (err == ENODEV && cpu_list) {
282 else if (err == ENODEV && cpu_list) {
283 die("No such device - did you specify" 282 die("No such device - did you specify"
284 " an out-of-range profile CPU?\n"); 283 " an out-of-range profile CPU?\n");
285 } else if (err == EINVAL && sample_id_all_avail) { 284 } else if (err == EINVAL && sample_id_all_avail) {
@@ -302,11 +301,19 @@ try_again:
302 && attr->config == PERF_COUNT_HW_CPU_CYCLES) { 301 && attr->config == PERF_COUNT_HW_CPU_CYCLES) {
303 302
304 if (verbose) 303 if (verbose)
305 warning(" ... trying to fall back to cpu-clock-ticks\n"); 304 ui__warning("The cycles event is not supported, "
305 "trying to fall back to cpu-clock-ticks\n");
306 attr->type = PERF_TYPE_SOFTWARE; 306 attr->type = PERF_TYPE_SOFTWARE;
307 attr->config = PERF_COUNT_SW_CPU_CLOCK; 307 attr->config = PERF_COUNT_SW_CPU_CLOCK;
308 goto try_again; 308 goto try_again;
309 } 309 }
310
311 if (err == ENOENT) {
312 ui__warning("The %s event is not supported.\n",
313 event_name(pos));
314 exit(EXIT_FAILURE);
315 }
316
310 printf("\n"); 317 printf("\n");
311 error("sys_perf_event_open() syscall returned with %d (%s). /bin/dmesg may provide additional information.\n", 318 error("sys_perf_event_open() syscall returned with %d (%s). /bin/dmesg may provide additional information.\n",
312 err, strerror(err)); 319 err, strerror(err));
@@ -506,6 +513,10 @@ static int __cmd_record(int argc, const char **argv)
506 if (have_tracepoints(&evsel_list->entries)) 513 if (have_tracepoints(&evsel_list->entries))
507 perf_header__set_feat(&session->header, HEADER_TRACE_INFO); 514 perf_header__set_feat(&session->header, HEADER_TRACE_INFO);
508 515
516 /* 512 kiB: default amount of unprivileged mlocked memory */
517 if (mmap_pages == UINT_MAX)
518 mmap_pages = (512 * 1024) / page_size;
519
509 if (forks) { 520 if (forks) {
510 child_pid = fork(); 521 child_pid = fork();
511 if (child_pid < 0) { 522 if (child_pid < 0) {