mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
perf tools: Factorize the dprintf definition
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>
This commit is contained in:
parent
0d31b82dd5
commit
2cec19d9d0
4 changed files with 62 additions and 51 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int verbose = 0;
|
||||
int dump_trace = 0;
|
||||
|
||||
int eprintf(const char *fmt, ...)
|
||||
{
|
||||
|
@ -20,3 +21,17 @@ int eprintf(const char *fmt, ...)
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue