mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-05 08:26:49 +07:00
2cec19d9d0
We have two users of dprintf: report and annotate. Another one is coming with perf trace. Then factorize it into the debug file. While at it, rename dprintf() to dump_printf() so that it doesn't conflicts with its libc homograph. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> LKML-Reference: <1250443461-28130-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
38 lines
510 B
C
38 lines
510 B
C
/* For general debugging purposes */
|
|
|
|
#include "../perf.h"
|
|
#include <string.h>
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
|
|
int verbose = 0;
|
|
int dump_trace = 0;
|
|
|
|
int eprintf(const char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
int ret = 0;
|
|
|
|
if (verbose) {
|
|
va_start(args, fmt);
|
|
ret = vfprintf(stderr, fmt, args);
|
|
va_end(args);
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
int dump_printf(const char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
int ret = 0;
|
|
|
|
if (dump_trace) {
|
|
va_start(args, fmt);
|
|
ret = vprintf(fmt, args);
|
|
va_end(args);
|
|
}
|
|
|
|
return ret;
|
|
}
|