MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / prof_log_emit_metadata

Function prof_log_emit_metadata

deps/jemalloc/src/prof.c:2671–2692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2669}
2670
2671static void
2672prof_log_emit_metadata(emitter_t *emitter) {
2673 emitter_json_object_kv_begin(emitter, "info");
2674
2675 nstime_t now = NSTIME_ZERO_INITIALIZER;
2676
2677 nstime_update(&now);
2678 uint64_t ns = nstime_ns(&now) - nstime_ns(&log_start_timestamp);
2679 emitter_json_kv(emitter, "duration", emitter_type_uint64, &ns);
2680
2681 char *vers = JEMALLOC_VERSION;
2682 emitter_json_kv(emitter, "version",
2683 emitter_type_string, &vers);
2684
2685 emitter_json_kv(emitter, "lg_sample_rate",
2686 emitter_type_int, &lg_prof_sample);
2687
2688 int pid = prof_getpid();
2689 emitter_json_kv(emitter, "pid", emitter_type_int, &pid);
2690
2691 emitter_json_object_end(emitter);
2692}
2693
2694
2695bool

Callers 1

prof_log_stopFunction · 0.85

Calls 5

emitter_json_kvFunction · 0.85
emitter_json_object_endFunction · 0.85
nstime_nsFunction · 0.70
prof_getpidFunction · 0.70

Tested by

no test coverage detected