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 <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1268349164-5822-3-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Arnaldo Carvalho de Melo 2010-03-11 20:12:42 -03:00 committed by Ingo Molnar
parent 895f0edc3c
commit b4f5296f0e
2 changed files with 6 additions and 5 deletions

View file

@ -7,8 +7,6 @@
extern int verbose; extern int verbose;
extern int dump_trace; 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))); int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void trace_event(event_t *event); void trace_event(event_t *event);

View file

@ -85,16 +85,19 @@ simple_strtoul(const char *nptr, char **endptr, int base)
return strtoul(nptr, endptr, base); return strtoul(nptr, endptr, base);
} }
int eprintf(int level,
const char *fmt, ...) __attribute__((format(printf, 2, 3)));
#ifndef pr_fmt #ifndef pr_fmt
#define pr_fmt(fmt) fmt #define pr_fmt(fmt) fmt
#endif #endif
#define pr_err(fmt, ...) \ #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, ...) \ #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, ...) \ #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, ...) \ #define pr_debug(fmt, ...) \
eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) eprintf(1, pr_fmt(fmt), ##__VA_ARGS__)
#define pr_debugN(n, fmt, ...) \ #define pr_debugN(n, fmt, ...) \