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

Function prof_log_emit_threads

deps/jemalloc/src/prof.c:2580–2602  ·  view source on GitHub ↗

* prof_log_emit_{...} goes through the appropriate linked list, emitting each * node to the json and deallocating it. */

Source from the content-addressed store, hash-verified

2578 * node to the json and deallocating it.
2579 */
2580static void
2581prof_log_emit_threads(tsd_t *tsd, emitter_t *emitter) {
2582 emitter_json_array_kv_begin(emitter, "threads");
2583 prof_thr_node_t *thr_node = log_thr_first;
2584 prof_thr_node_t *thr_old_node;
2585 while (thr_node != NULL) {
2586 emitter_json_object_begin(emitter);
2587
2588 emitter_json_kv(emitter, "thr_uid", emitter_type_uint64,
2589 &thr_node->thr_uid);
2590
2591 char *thr_name = thr_node->name;
2592
2593 emitter_json_kv(emitter, "thr_name", emitter_type_string,
2594 &thr_name);
2595
2596 emitter_json_object_end(emitter);
2597 thr_old_node = thr_node;
2598 thr_node = thr_node->next;
2599 idalloc(tsd, thr_old_node);
2600 }
2601 emitter_json_array_end(emitter);
2602}
2603
2604static void
2605prof_log_emit_traces(tsd_t *tsd, emitter_t *emitter) {

Callers 1

prof_log_stopFunction · 0.85

Calls 6

emitter_json_kvFunction · 0.85
emitter_json_object_endFunction · 0.85
emitter_json_array_endFunction · 0.85
idallocFunction · 0.50

Tested by

no test coverage detected