diff options
author | Tejun Heo <tj@kernel.org> | 2011-05-02 08:08:43 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-05-02 08:08:47 -0400 |
commit | aff364860aa105b2deacc6f21ec8ef524460e3fc (patch) | |
tree | 18409ebe16b25b141598da9b6386d69416c06afa /tools/perf/builtin-top.c | |
parent | c7a7b814c9dca9ee01b38e63b4a46de87156d3b6 (diff) | |
parent | 993ba1585cbb03fab012e41d1a5d24330a283b31 (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-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 676b4fb0070..fc1273e976c 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -850,10 +850,10 @@ try_again: | |||
850 | top.evlist->threads, group, inherit) < 0) { | 850 | top.evlist->threads, group, inherit) < 0) { |
851 | int err = errno; | 851 | int err = errno; |
852 | 852 | ||
853 | if (err == EPERM || err == EACCES) | 853 | if (err == EPERM || err == EACCES) { |
854 | die("Permission error - are you root?\n" | 854 | ui__warning_paranoid(); |
855 | "\t Consider tweaking" | 855 | goto out_err; |
856 | " /proc/sys/kernel/perf_event_paranoid.\n"); | 856 | } |
857 | /* | 857 | /* |
858 | * If it's cycles then fall back to hrtimer | 858 | * If it's cycles then fall back to hrtimer |
859 | * based cpu-clock-tick sw counter, which | 859 | * based cpu-clock-tick sw counter, which |
@@ -861,25 +861,41 @@ try_again: | |||
861 | */ | 861 | */ |
862 | if (attr->type == PERF_TYPE_HARDWARE && | 862 | if (attr->type == PERF_TYPE_HARDWARE && |
863 | attr->config == PERF_COUNT_HW_CPU_CYCLES) { | 863 | attr->config == PERF_COUNT_HW_CPU_CYCLES) { |
864 | |||
865 | if (verbose) | 864 | if (verbose) |
866 | warning(" ... trying to fall back to cpu-clock-ticks\n"); | 865 | ui__warning("Cycles event not supported,\n" |
866 | "trying to fall back to cpu-clock-ticks\n"); | ||
867 | 867 | ||
868 | attr->type = PERF_TYPE_SOFTWARE; | 868 | attr->type = PERF_TYPE_SOFTWARE; |
869 | attr->config = PERF_COUNT_SW_CPU_CLOCK; | 869 | attr->config = PERF_COUNT_SW_CPU_CLOCK; |
870 | goto try_again; | 870 | goto try_again; |
871 | } | 871 | } |
872 | printf("\n"); | 872 | |
873 | error("sys_perf_event_open() syscall returned with %d " | 873 | if (err == ENOENT) { |
874 | "(%s). /bin/dmesg may provide additional information.\n", | 874 | ui__warning("The %s event is not supported.\n", |
875 | err, strerror(err)); | 875 | event_name(counter)); |
876 | die("No CONFIG_PERF_EVENTS=y kernel support configured?\n"); | 876 | goto out_err; |
877 | exit(-1); | 877 | } |
878 | |||
879 | ui__warning("The sys_perf_event_open() syscall " | ||
880 | "returned with %d (%s). /bin/dmesg " | ||
881 | "may provide additional information.\n" | ||
882 | "No CONFIG_PERF_EVENTS=y kernel support " | ||
883 | "configured?\n", err, strerror(err)); | ||
884 | goto out_err; | ||
878 | } | 885 | } |
879 | } | 886 | } |
880 | 887 | ||
881 | if (perf_evlist__mmap(evlist, mmap_pages, false) < 0) | 888 | if (perf_evlist__mmap(evlist, mmap_pages, false) < 0) { |
882 | die("failed to mmap with %d (%s)\n", errno, strerror(errno)); | 889 | ui__warning("Failed to mmap with %d (%s)\n", |
890 | errno, strerror(errno)); | ||
891 | goto out_err; | ||
892 | } | ||
893 | |||
894 | return; | ||
895 | |||
896 | out_err: | ||
897 | exit_browser(0); | ||
898 | exit(0); | ||
883 | } | 899 | } |
884 | 900 | ||
885 | static int __cmd_top(void) | 901 | static int __cmd_top(void) |