Skip to content

Commit

Permalink
perf tools: Simplify die() mechanism
Browse files Browse the repository at this point in the history
This should die altogether, but for now lets remove a bit of this stuff,
as it is not used at all.

Cc: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Mar 23, 2016
1 parent 236f71e commit e476343
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions tools/perf/util/usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* (ugh), so keep things static. */
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 (*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))
{
warn_routine = routine;
Expand All @@ -65,7 +59,7 @@ void die(const char *err, ...)
va_list params;

va_start(params, err);
die_routine(err, params);
die_builtin(err, params);
va_end(params);
}

Expand Down
1 change: 0 additions & 1 deletion tools/perf/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)))

#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 int prefixcmp(const char *str, const char *prefix);
Expand Down

0 comments on commit e476343

Please sign in to comment.