This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
2009-08-12 08:03:49 +00:00
|
|
|
/* For general debugging purposes */
|
|
|
|
|
|
|
|
#include "../perf.h"
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int verbose = 0;
|
2009-08-16 17:24:21 +00:00
|
|
|
int dump_trace = 0;
|
2009-08-12 08:03:49 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2009-08-16 17:24:21 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|