1 /* For general debugging purposes */
16 bool dump_trace
= false, quiet
= false;
18 int eprintf(int level
, const char *fmt
, ...)
23 if (verbose
>= level
) {
26 ret
= ui_helpline__show_help(fmt
, args
);
28 ret
= vfprintf(stderr
, fmt
, args
);
35 int dump_printf(const char *fmt
, ...)
42 ret
= vprintf(fmt
, args
);
49 #ifdef NO_NEWT_SUPPORT
50 void ui__warning(const char *format
, ...)
54 va_start(args
, format
);
55 vfprintf(stderr
, format
, args
);
60 void trace_event(event_t
*event
)
62 unsigned char *raw_event
= (void *)event
;
63 const char *color
= PERF_COLOR_BLUE
;
70 color_fprintf(stdout
, color
, "\n. ... raw event: size %d bytes\n",
73 for (i
= 0; i
< event
->header
.size
; i
++) {
76 color_fprintf(stdout
, color
, " %04x: ", i
);
79 color_fprintf(stdout
, color
, " %02x", raw_event
[i
]);
81 if (((i
& 15) == 15) || i
== event
->header
.size
-1) {
82 color_fprintf(stdout
, color
, " ");
83 for (j
= 0; j
< 15-(i
& 15); j
++)
84 color_fprintf(stdout
, color
, " ");
85 for (j
= i
& ~15; j
<= i
; j
++) {
86 color_fprintf(stdout
, color
, "%c",
87 isprint(raw_event
[j
]) ?
90 color_fprintf(stdout
, color
, "\n");