perf tools: Simplify die() mechanism

This should die altogether, but for now lets remove a bit of this stuff,
as it is not used at all.

Cc: Adrian Hunter <adrian.hunter@intel.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-ade3n99xscldhg5mx2vzd8p3@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 236f71eb
...@@ -41,15 +41,9 @@ static void warn_builtin(const char *warn, va_list params) ...@@ -41,15 +41,9 @@ static void warn_builtin(const char *warn, va_list params)
/* If we are in a dlopen()ed .so write to a global variable would segfault /* If we are in a dlopen()ed .so write to a global variable would segfault
* (ugh), so keep things static. */ * (ugh), so keep things static. */
static void (*usage_routine)(const char *err) NORETURN = usage_builtin; static void (*usage_routine)(const char *err) NORETURN = usage_builtin;
static void (*die_routine)(const char *err, va_list params) NORETURN = die_builtin;
static void (*error_routine)(const char *err, va_list params) = error_builtin; static void (*error_routine)(const char *err, va_list params) = error_builtin;
static void (*warn_routine)(const char *err, va_list params) = warn_builtin; static void (*warn_routine)(const char *err, va_list params) = warn_builtin;
void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN)
{
die_routine = routine;
}
void set_warning_routine(void (*routine)(const char *err, va_list params)) void set_warning_routine(void (*routine)(const char *err, va_list params))
{ {
warn_routine = routine; warn_routine = routine;
...@@ -65,7 +59,7 @@ void die(const char *err, ...) ...@@ -65,7 +59,7 @@ void die(const char *err, ...)
va_list params; va_list params;
va_start(params, err); va_start(params, err);
die_routine(err, params); die_builtin(err, params);
va_end(params); va_end(params);
} }
......
...@@ -140,7 +140,6 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))) ...@@ -140,7 +140,6 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)))
#include "../../../include/linux/stringify.h" #include "../../../include/linux/stringify.h"
extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);
extern void set_warning_routine(void (*routine)(const char *err, va_list params)); extern void set_warning_routine(void (*routine)(const char *err, va_list params));
extern int prefixcmp(const char *str, const char *prefix); extern int prefixcmp(const char *str, const char *prefix);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment