MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / print_rusage_diff

Function print_rusage_diff

random/allocator.c:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void print_rusage_diff(struct rusage r1, struct rusage r2) {
47 printf("****** CPU user time %.2lf s, sys time %.2lf s\n",
48 (TIMEVAL_TO_SEC(r2.ru_utime) - TIMEVAL_TO_SEC(r1.ru_utime)),
49 (TIMEVAL_TO_SEC(r2.ru_stime) - TIMEVAL_TO_SEC(r1.ru_stime)));
50
51 printf(
52 "****** Mem RSS %.2lf MB, soft page fault %ld - hard page fault %ld, voluntary context switches %ld - involuntary %ld\n",
53 (double) (r2.ru_maxrss - r1.ru_maxrss) / (1024.0),
54 (r2.ru_minflt - r1.ru_minflt), (r2.ru_majflt - r1.ru_majflt),
55 (r2.ru_nvcsw - r1.ru_nvcsw), (r2.ru_nivcsw - r1.ru_nivcsw));
56}
57
58void workload0(allocator alloc, const char *allocator_name) {
59 /* single size allocation */

Callers 1

eval_alloc_perfFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected