| 2631 | } |
| 2632 | |
| 2633 | static void |
| 2634 | prof_log_emit_allocs(tsd_t *tsd, emitter_t *emitter) { |
| 2635 | emitter_json_array_kv_begin(emitter, "allocations"); |
| 2636 | prof_alloc_node_t *alloc_node = log_alloc_first; |
| 2637 | prof_alloc_node_t *alloc_old_node; |
| 2638 | while (alloc_node != NULL) { |
| 2639 | emitter_json_object_begin(emitter); |
| 2640 | |
| 2641 | emitter_json_kv(emitter, "alloc_thread", emitter_type_size, |
| 2642 | &alloc_node->alloc_thr_ind); |
| 2643 | |
| 2644 | emitter_json_kv(emitter, "free_thread", emitter_type_size, |
| 2645 | &alloc_node->free_thr_ind); |
| 2646 | |
| 2647 | emitter_json_kv(emitter, "alloc_trace", emitter_type_size, |
| 2648 | &alloc_node->alloc_bt_ind); |
| 2649 | |
| 2650 | emitter_json_kv(emitter, "free_trace", emitter_type_size, |
| 2651 | &alloc_node->free_bt_ind); |
| 2652 | |
| 2653 | emitter_json_kv(emitter, "alloc_timestamp", |
| 2654 | emitter_type_uint64, &alloc_node->alloc_time_ns); |
| 2655 | |
| 2656 | emitter_json_kv(emitter, "free_timestamp", emitter_type_uint64, |
| 2657 | &alloc_node->free_time_ns); |
| 2658 | |
| 2659 | emitter_json_kv(emitter, "usize", emitter_type_uint64, |
| 2660 | &alloc_node->usize); |
| 2661 | |
| 2662 | emitter_json_object_end(emitter); |
| 2663 | |
| 2664 | alloc_old_node = alloc_node; |
| 2665 | alloc_node = alloc_node->next; |
| 2666 | idalloc(tsd, alloc_old_node); |
| 2667 | } |
| 2668 | emitter_json_array_end(emitter); |
| 2669 | } |
| 2670 | |
| 2671 | static void |
| 2672 | prof_log_emit_metadata(emitter_t *emitter) { |
no test coverage detected