aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/usage.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-07 11:31:52 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-07 11:31:52 -0400
commit716c69fecacd42f2a304a97158e04af2786a3f65 (patch)
tree5f86a0ce67ba87595d14a6fd6d5f59f8f7cf1f56 /tools/perf/util/usage.c
parent743ee1f80434138495bbb95ffb897acf46b51d54 (diff)
perf top: Fall back to cpu-clock-tick hrtimer sampling if no cycle counter available
On architectures/CPUs without PMU support but with perfcounters enabled 'perf top' currently fails because it cannot create a cycle based hw-perfcounter. Fall back to the cpu-clock-tick sw-perfcounter in this case, which is hrtimer based and will always work (as long as perfcounters is enabled). Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/usage.c')
-rw-r--r--tools/perf/util/usage.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c
index 2cad286e4371..e16bf9a707e8 100644
--- a/tools/perf/util/usage.c
+++ b/tools/perf/util/usage.c
@@ -9,29 +9,29 @@ static void report(const char *prefix, const char *err, va_list params)
9{ 9{
10 char msg[1024]; 10 char msg[1024];
11 vsnprintf(msg, sizeof(msg), err, params); 11 vsnprintf(msg, sizeof(msg), err, params);
12 fprintf(stderr, "%s%s\n", prefix, msg); 12 fprintf(stderr, " %s%s\n", prefix, msg);
13} 13}
14 14
15static NORETURN void usage_builtin(const char *err) 15static NORETURN void usage_builtin(const char *err)
16{ 16{
17 fprintf(stderr, "\n usage: %s\n", err); 17 fprintf(stderr, "\n Usage: %s\n", err);
18 exit(129); 18 exit(129);
19} 19}
20 20
21static NORETURN void die_builtin(const char *err, va_list params) 21static NORETURN void die_builtin(const char *err, va_list params)
22{ 22{
23 report("fatal: ", err, params); 23 report(" Fatal: ", err, params);
24 exit(128); 24 exit(128);
25} 25}
26 26
27static void error_builtin(const char *err, va_list params) 27static void error_builtin(const char *err, va_list params)
28{ 28{
29 report("error: ", err, params); 29 report(" Error: ", err, params);
30} 30}
31 31
32static void warn_builtin(const char *warn, va_list params) 32static void warn_builtin(const char *warn, va_list params)
33{ 33{
34 report("warning: ", warn, params); 34 report(" Warning: ", warn, params);
35} 35}
36 36
37/* If we are in a dlopen()ed .so write to a global variable would segfault 37/* If we are in a dlopen()ed .so write to a global variable would segfault