* prof_log_emit_{...} goes through the appropriate linked list, emitting each * node to the json and deallocating it. */
| 2578 | * node to the json and deallocating it. |
| 2579 | */ |
| 2580 | static void |
| 2581 | prof_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 | |
| 2604 | static void |
| 2605 | prof_log_emit_traces(tsd_t *tsd, emitter_t *emitter) { |
no test coverage detected