MCPcopy Create free account
hub / github.com/ioi/isolate / cg_stats

Function cg_stats

cg.c:300–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300void
301cg_stats(void)
302{
303 if (!cg_enable)
304 return;
305
306 char key[CG_BUFSIZE], val[CG_BUFSIZE];
307
308 unsigned long long mem=0;
309 if (cg_read("?memory.peak", val))
310 mem = atoll(val);
311 if (mem)
312 meta_printf("cg-mem:%lld\n", mem >> 10);
313
314 // OOM kill detection
315 FILE *f = cg_fopen("memory.events");
316 while (cg_fread_kv(f, key, val))
317 {
318 if (!strcmp(key, "oom_kill") && atoll(val))
319 {
320 meta_printf("cg-oom-killed:1\n");
321 break;
322 }
323 }
324 cg_fclose(f);
325}
326
327void
328cg_remove(void)

Callers 1

final_statsFunction · 0.85

Calls 5

cg_readFunction · 0.85
meta_printfFunction · 0.85
cg_fopenFunction · 0.85
cg_fread_kvFunction · 0.85
cg_fcloseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…