MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / tdprintf

Function tdprintf

tests/tools/testutil.c:15–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#define FMTSZ 512
14
15void tdprintf(FILE *f, cdb2_hndl_tp *db, const char *func, int line,
16 const char *format, ...)
17{
18 va_list ap;
19 char fmt[FMTSZ];
20 char buf[128];
21
22 fmt[0] = '\0';
23
24 if (strncasecmp(format, "XXX ", 3) == 0) {
25 strcat(fmt, "XXX ");
26 }
27
28 snprintf(buf, sizeof(buf), "td %"PRIdPTR" ", (intptr_t)pthread_self());
29 strcat(fmt, buf);
30
31 snprintf(buf, sizeof(buf), "handle %p ", db);
32 strcat(fmt, buf);
33
34 snprintf(buf, sizeof(buf), "%s:%d ", func, line);
35 strcat(fmt, buf);
36
37 snprintf(buf, sizeof(buf), "cnonce '%s' ", db ? cdb2_cnonce(db) : "(null)");
38 strcat(fmt, buf);
39
40 int file = -1, offset = -1;
41 if (db) cdb2_snapshot_file(db, &file, &offset);
42 snprintf(buf, sizeof(buf), "snapshot_lsn [%d][%d] ", file, offset);
43 strcat(fmt, buf);
44
45 strcat(fmt, format);
46 va_start(ap, format);
47 vfprintf(f, fmt, ap);
48 va_end(ap);
49}
50
51char *master(const char *dbname, const char *cltype)
52{

Callers 12

update_intFunction · 0.85
updateFunction · 0.85
thdFunction · 0.85
empty_register_tableFunction · 0.85
masterFunction · 0.85
read_nodeFunction · 0.85
insertFunction · 0.85
thdFunction · 0.85
checkFunction · 0.85
prepare_select_bugFunction · 0.85
prepare_select_testFunction · 0.85
clearFunction · 0.85

Calls 2

cdb2_cnonceFunction · 0.85
cdb2_snapshot_fileFunction · 0.85

Tested by

no test coverage detected