Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -27
+5 -5
tools/perf/tests/attr.c
··· 18 18 * permissions. All the event text files are stored there. 19 19 */ 20 20 21 + #include <debug.h> 21 22 #include <errno.h> 22 23 #include <inttypes.h> 23 24 #include <stdlib.h> ··· 30 29 #include <sys/stat.h> 31 30 #include <unistd.h> 32 31 #include "../perf.h" 33 - #include "util.h" 34 32 #include <subcmd/exec-cmd.h> 35 33 #include "tests.h" 36 34 37 35 #define ENV "PERF_TEST_ATTR" 38 - 39 - extern int verbose; 40 36 41 37 static char *dir; 42 38 ··· 136 138 { 137 139 int errno_saved = errno; 138 140 139 - if (store_event(attr, pid, cpu, fd, group_fd, flags)) 140 - die("test attr FAILED"); 141 + if (store_event(attr, pid, cpu, fd, group_fd, flags)) { 142 + pr_err("test attr FAILED"); 143 + exit(128); 144 + } 141 145 142 146 errno = errno_saved; 143 147 }
-22
tools/perf/util/usage.c
··· 9 9 #include "util.h" 10 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 12 static __noreturn void usage_builtin(const char *err) 20 13 { 21 14 fprintf(stderr, "\n Usage: %s\n", err); 22 15 exit(129); 23 - } 24 - 25 - static __noreturn void die_builtin(const char *err, va_list params) 26 - { 27 - report(" Fatal: ", err, params); 28 - exit(128); 29 16 } 30 17 31 18 /* If we are in a dlopen()ed .so write to a global variable would segfault ··· 22 35 void usage(const char *err) 23 36 { 24 37 usage_routine(err); 25 - } 26 - 27 - void die(const char *err, ...) 28 - { 29 - va_list params; 30 - 31 - va_start(params, err); 32 - die_builtin(err, params); 33 - va_end(params); 34 38 }