diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-27 10:49:13 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-27 10:49:13 -0400 |
commit | fef2a735167a827a65bbdf1791abe0dd070ce372 (patch) | |
tree | af25e9617173b6465eb6c5fd96d39350e9883401 /tools/perf/util/usage.c | |
parent | 25ce4bb8c50513e922da2709fedc9db112452fbc (diff) |
perf tools: Kill die()
Finally can nuke this function, no more users.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-eivvvzn8ie6w42gy3batxoy7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/usage.c')
-rw-r--r-- | tools/perf/util/usage.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index bf185f28b19e..6cc9d9888ce0 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c | |||
@@ -9,25 +9,12 @@ | |||
9 | #include "util.h" | 9 | #include "util.h" |
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | static void report(const char *prefix, const char *err, va_list params) | ||
13 | { | ||
14 | char msg[1024]; | ||
15 | vsnprintf(msg, sizeof(msg), err, params); | ||
16 | fprintf(stderr, " %s%s\n", prefix, msg); | ||
17 | } | ||
18 | |||
19 | static __noreturn void usage_builtin(const char *err) | 12 | static __noreturn void usage_builtin(const char *err) |
20 | { | 13 | { |
21 | fprintf(stderr, "\n Usage: %s\n", err); | 14 | fprintf(stderr, "\n Usage: %s\n", err); |
22 | exit(129); | 15 | exit(129); |
23 | } | 16 | } |
24 | 17 | ||
25 | static __noreturn void die_builtin(const char *err, va_list params) | ||
26 | { | ||
27 | report(" Fatal: ", err, params); | ||
28 | exit(128); | ||
29 | } | ||
30 | |||
31 | /* If we are in a dlopen()ed .so write to a global variable would segfault | 18 | /* If we are in a dlopen()ed .so write to a global variable would segfault |
32 | * (ugh), so keep things static. */ | 19 | * (ugh), so keep things static. */ |
33 | static void (*usage_routine)(const char *err) __noreturn = usage_builtin; | 20 | static void (*usage_routine)(const char *err) __noreturn = usage_builtin; |
@@ -36,12 +23,3 @@ void usage(const char *err) | |||
36 | { | 23 | { |
37 | usage_routine(err); | 24 | usage_routine(err); |
38 | } | 25 | } |
39 | |||
40 | void die(const char *err, ...) | ||
41 | { | ||
42 | va_list params; | ||
43 | |||
44 | va_start(params, err); | ||
45 | die_builtin(err, params); | ||
46 | va_end(params); | ||
47 | } | ||