MCPcopy Create free account
hub / github.com/coreboot/coreboot / PDC_debug

Function PDC_debug

payloads/libpayload/curses/PDCurses/pdcurses/debug.c:38–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36bool pdc_trace_on = FALSE;
37
38void PDC_debug(const char *fmt, ...)
39{
40 va_list args;
41 FILE *dbfp;
42 char hms[9];
43 time_t now;
44
45 if (!pdc_trace_on)
46 return;
47
48 /* open debug log file append */
49
50 dbfp = fopen("trace", "a");
51 if (!dbfp)
52 {
53 fprintf(stderr,
54 "PDC_debug(): Unable to open debug log file\n");
55 return;
56 }
57
58 time(&now);
59 strftime(hms, 9, "%H:%M:%S", localtime(&now));
60 fprintf(dbfp, "At: %8.8ld - %s ", (long) clock(), hms);
61
62 va_start(args, fmt);
63 vfprintf(dbfp, fmt, args);
64 va_end(args);
65
66 fclose(dbfp);
67}
68
69void traceon(void)
70{

Callers 1

x11.cFile · 0.85

Calls 4

fopenFunction · 0.85
fprintfFunction · 0.85
timeFunction · 0.85
fcloseFunction · 0.85

Tested by

no test coverage detected