From: Arnaldo Carvalho de Melo Date: Thu, 11 Mar 2010 23:12:42 +0000 (-0300) Subject: perf tools: Use eprintf for pr_{err,warning,info} too X-Git-Tag: v2.6.35-rc1~522^2~206 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b4f5296f0eec2aa7061dfd8bb8c0744f095f9bd1;p=karo-tx-linux.git perf tools: Use eprintf for pr_{err,warning,info} too Just like we do for pr_debug, so that we can have a single point where to redirect to the currently used output system, be it stdio or newt. Signed-off-by: Arnaldo Carvalho de Melo Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Paul Mackerras LKML-Reference: <1268349164-5822-3-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h index c6c24c522dea..58720a181591 100644 --- a/tools/perf/util/debug.h +++ b/tools/perf/util/debug.h @@ -7,8 +7,6 @@ extern int verbose; extern int dump_trace; -int eprintf(int level, - const char *fmt, ...) __attribute__((format(printf, 2, 3))); int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); void trace_event(event_t *event); diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h index f2611655ab51..388ab1bfd114 100644 --- a/tools/perf/util/include/linux/kernel.h +++ b/tools/perf/util/include/linux/kernel.h @@ -85,16 +85,19 @@ simple_strtoul(const char *nptr, char **endptr, int base) return strtoul(nptr, endptr, base); } +int eprintf(int level, + const char *fmt, ...) __attribute__((format(printf, 2, 3))); + #ifndef pr_fmt #define pr_fmt(fmt) fmt #endif #define pr_err(fmt, ...) \ - do { fprintf(stderr, pr_fmt(fmt), ##__VA_ARGS__); } while (0) + eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) #define pr_warning(fmt, ...) \ - do { fprintf(stderr, pr_fmt(fmt), ##__VA_ARGS__); } while (0) + eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ - do { fprintf(stderr, pr_fmt(fmt), ##__VA_ARGS__); } while (0) + eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) #define pr_debug(fmt, ...) \ eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) #define pr_debugN(n, fmt, ...) \