MCPcopy Create free account
hub / github.com/antirez/ds4 / agent_dsml_raw_append

Function agent_dsml_raw_append

ds4_agent.c:1312–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1310static void agent_trace_time(FILE *fp) {
1311 struct timespec ts;
1312 clock_gettime(CLOCK_REALTIME, &ts);
1313 struct tm tm;
1314 localtime_r(&ts.tv_sec, &tm);
1315 fprintf(fp, "%04d-%02d-%02d %02d:%02d:%02d.%03ld",
1316 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
1317 tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec / 1000000);
1318}
1319
1320static void agent_trace(agent_worker *w, const char *fmt, ...) {
1321 if (!w || !w->trace) return;
1322 pthread_mutex_lock(&w->mu);
1323 agent_trace_time(w->trace);
1324 fputs(" ", w->trace);
1325 va_list ap;
1326 va_start(ap, fmt);

Callers 2

agent_dsml_startFunction · 0.85
agent_dsml_feedFunction · 0.85

Calls 1

xreallocFunction · 0.70

Tested by

no test coverage detected