Lines Matching full:emitter
7 #include "jemalloc/internal/emitter.h"
225 mutex_stats_emit(emitter_t *emitter, emitter_row_t *row, in mutex_stats_emit() argument
229 emitter_table_row(emitter, row); in mutex_stats_emit()
243 emitter_json_kv(emitter, #counter, EMITTER_TYPE_##type, \ in mutex_stats_emit()
270 stats_arena_bins_print(emitter_t *emitter, bool mutex, unsigned i, uint64_t uptime) { in stats_arena_bins_print() argument
333 emitter_table_printf(emitter, "bins:"); in stats_arena_bins_print()
334 emitter_table_row(emitter, &header_row); in stats_arena_bins_print()
335 emitter_json_array_kv_begin(emitter, "bins"); in stats_arena_bins_print()
352 emitter_table_printf(emitter, in stats_arena_bins_print()
385 emitter_json_object_begin(emitter); in stats_arena_bins_print()
386 emitter_json_kv(emitter, "nmalloc", emitter_type_uint64, in stats_arena_bins_print()
388 emitter_json_kv(emitter, "ndalloc", emitter_type_uint64, in stats_arena_bins_print()
390 emitter_json_kv(emitter, "curregs", emitter_type_size, in stats_arena_bins_print()
392 emitter_json_kv(emitter, "nrequests", emitter_type_uint64, in stats_arena_bins_print()
394 emitter_json_kv(emitter, "nfills", emitter_type_uint64, in stats_arena_bins_print()
396 emitter_json_kv(emitter, "nflushes", emitter_type_uint64, in stats_arena_bins_print()
398 emitter_json_kv(emitter, "nreslabs", emitter_type_uint64, in stats_arena_bins_print()
400 emitter_json_kv(emitter, "curslabs", emitter_type_size, in stats_arena_bins_print()
402 emitter_json_kv(emitter, "nonfull_slabs", emitter_type_size, in stats_arena_bins_print()
405 emitter_json_object_kv_begin(emitter, "mutex"); in stats_arena_bins_print()
406 mutex_stats_emit(emitter, NULL, col_mutex64, in stats_arena_bins_print()
408 emitter_json_object_end(emitter); in stats_arena_bins_print()
410 emitter_json_object_end(emitter); in stats_arena_bins_print()
460 emitter_table_row(emitter, &row); in stats_arena_bins_print()
462 emitter_json_array_end(emitter); /* Close "bins". */ in stats_arena_bins_print()
465 emitter_table_printf(emitter, " ---\n"); in stats_arena_bins_print()
470 stats_arena_lextents_print(emitter_t *emitter, unsigned i, uint64_t uptime) { in stats_arena_lextents_print() argument
495 emitter_table_printf(emitter, "large:"); in stats_arena_lextents_print()
496 emitter_table_row(emitter, &header_row); in stats_arena_lextents_print()
497 emitter_json_array_kv_begin(emitter, "lextents"); in stats_arena_lextents_print()
513 emitter_table_printf(emitter, in stats_arena_lextents_print()
521 emitter_json_object_begin(emitter); in stats_arena_lextents_print()
522 emitter_json_kv(emitter, "curlextents", emitter_type_size, in stats_arena_lextents_print()
524 emitter_json_object_end(emitter); in stats_arena_lextents_print()
538 emitter_table_row(emitter, &row); in stats_arena_lextents_print()
541 emitter_json_array_end(emitter); /* Close "lextents". */ in stats_arena_lextents_print()
543 emitter_table_printf(emitter, " ---\n"); in stats_arena_lextents_print()
548 stats_arena_extents_print(emitter_t *emitter, unsigned i) { in stats_arena_extents_print() argument
569 emitter_table_printf(emitter, "extents:"); in stats_arena_extents_print()
570 emitter_table_row(emitter, &header_row); in stats_arena_extents_print()
571 emitter_json_array_kv_begin(emitter, "extents"); in stats_arena_extents_print()
596 emitter_table_printf(emitter, in stats_arena_extents_print()
600 emitter_json_object_begin(emitter); in stats_arena_extents_print()
601 emitter_json_kv(emitter, "ndirty", emitter_type_size, &ndirty); in stats_arena_extents_print()
602 emitter_json_kv(emitter, "nmuzzy", emitter_type_size, &nmuzzy); in stats_arena_extents_print()
603 emitter_json_kv(emitter, "nretained", emitter_type_size, in stats_arena_extents_print()
606 emitter_json_kv(emitter, "dirty_bytes", emitter_type_size, in stats_arena_extents_print()
608 emitter_json_kv(emitter, "muzzy_bytes", emitter_type_size, in stats_arena_extents_print()
610 emitter_json_kv(emitter, "retained_bytes", emitter_type_size, in stats_arena_extents_print()
612 emitter_json_object_end(emitter); in stats_arena_extents_print()
626 emitter_table_row(emitter, &row); in stats_arena_extents_print()
629 emitter_json_array_end(emitter); /* Close "extents". */ in stats_arena_extents_print()
631 emitter_table_printf(emitter, " ---\n"); in stats_arena_extents_print()
636 stats_arena_mutexes_print(emitter_t *emitter, unsigned arena_ind, uint64_t uptime) { in stats_arena_mutexes_print() argument
645 emitter_json_object_kv_begin(emitter, "mutexes"); in stats_arena_mutexes_print()
646 emitter_table_row(emitter, &row); in stats_arena_mutexes_print()
651 emitter_json_object_kv_begin(emitter, name); in stats_arena_mutexes_print()
654 mutex_stats_emit(emitter, &row, col64, col32); in stats_arena_mutexes_print()
655 emitter_json_object_end(emitter); /* Close the mutex dict. */ in stats_arena_mutexes_print()
657 emitter_json_object_end(emitter); /* End "mutexes". */ in stats_arena_mutexes_print()
661 stats_arena_print(emitter_t *emitter, unsigned i, bool bins, bool large, in stats_arena_print() argument
682 emitter_kv(emitter, "nthreads", "assigned threads", in stats_arena_print()
686 emitter_kv(emitter, "uptime_ns", "uptime", emitter_type_uint64, in stats_arena_print()
690 emitter_kv(emitter, "dss", "dss allocation precedence", in stats_arena_print()
713 emitter_json_kv(emitter, "dirty_decay_ms", emitter_type_ssize, in stats_arena_print()
715 emitter_json_kv(emitter, "muzzy_decay_ms", emitter_type_ssize, in stats_arena_print()
718 emitter_json_kv(emitter, "pactive", emitter_type_size, &pactive); in stats_arena_print()
719 emitter_json_kv(emitter, "pdirty", emitter_type_size, &pdirty); in stats_arena_print()
720 emitter_json_kv(emitter, "pmuzzy", emitter_type_size, &pmuzzy); in stats_arena_print()
722 emitter_json_kv(emitter, "dirty_npurge", emitter_type_uint64, in stats_arena_print()
724 emitter_json_kv(emitter, "dirty_nmadvise", emitter_type_uint64, in stats_arena_print()
726 emitter_json_kv(emitter, "dirty_purged", emitter_type_uint64, in stats_arena_print()
729 emitter_json_kv(emitter, "muzzy_npurge", emitter_type_uint64, in stats_arena_print()
731 emitter_json_kv(emitter, "muzzy_nmadvise", emitter_type_uint64, in stats_arena_print()
733 emitter_json_kv(emitter, "muzzy_purged", emitter_type_uint64, in stats_arena_print()
756 emitter_table_row(emitter, &decay_row); in stats_arena_print()
781 emitter_table_row(emitter, &decay_row); in stats_arena_print()
806 emitter_table_row(emitter, &decay_row); in stats_arena_print()
843 emitter_table_row(emitter, &alloc_count_row); in stats_arena_print()
854 emitter_json_kv(emitter, #name, emitter_type_##valtype, \ in stats_arena_print()
859 emitter_json_object_kv_begin(emitter, "small"); in stats_arena_print()
879 emitter_table_row(emitter, &alloc_count_row); in stats_arena_print()
880 emitter_json_object_end(emitter); /* Close "small". */ in stats_arena_print()
882 emitter_json_object_kv_begin(emitter, "large"); in stats_arena_print()
902 emitter_table_row(emitter, &alloc_count_row); in stats_arena_print()
903 emitter_json_object_end(emitter); /* Close "large". */ in stats_arena_print()
907 /* Aggregated small + large stats are emitter only in table mode. */ in stats_arena_print()
925 emitter_table_row(emitter, &alloc_count_row); in stats_arena_print()
944 emitter_table_row(emitter, &mem_count_row); in stats_arena_print()
950 emitter_table_row(emitter, &mem_count_row); in stats_arena_print()
954 emitter_json_kv(emitter, #stat, emitter_type_size, &stat); \ in stats_arena_print()
957 emitter_table_row(emitter, &mem_count_row); in stats_arena_print()
971 stats_arena_mutexes_print(emitter, i, uptime); in stats_arena_print()
974 stats_arena_bins_print(emitter, mutex, i, uptime); in stats_arena_print()
977 stats_arena_lextents_print(emitter, i, uptime); in stats_arena_print()
980 stats_arena_extents_print(emitter, i); in stats_arena_print()
985 stats_general_print(emitter_t *emitter) { in stats_general_print() argument
1001 emitter_kv(emitter, "version", "Version", emitter_type_string, &cpv); in stats_general_print()
1004 emitter_dict_begin(emitter, "config", "Build-time option settings"); in stats_general_print()
1008 emitter_kv(emitter, #name, "config."#name, \ in stats_general_print()
1016 emitter_kv(emitter, "malloc_conf", "config.malloc_conf", in stats_general_print()
1027 emitter_dict_end(emitter); /* Close "config" dict. */ in stats_general_print()
1033 emitter_kv(emitter, name, "opt."name, emitter_type, \ in stats_general_print()
1042 emitter_kv_note(emitter, name, "opt."name, \ in stats_general_print()
1065 emitter_dict_begin(emitter, "opt", "Run-time option settings"); in stats_general_print()
1101 emitter_dict_end(emitter); in stats_general_print()
1114 emitter_dict_begin(emitter, "prof", "Profiling settings"); in stats_general_print()
1117 emitter_kv(emitter, "thread_active_init", in stats_general_print()
1121 emitter_kv(emitter, "active", "prof.active", emitter_type_bool, in stats_general_print()
1125 emitter_kv(emitter, "gdump", "prof.gdump", emitter_type_bool, in stats_general_print()
1129 emitter_kv(emitter, "interval", "prof.interval", in stats_general_print()
1133 emitter_kv(emitter, "lg_sample", "prof.lg_sample", in stats_general_print()
1136 emitter_dict_end(emitter); /* Close "prof". */ in stats_general_print()
1144 emitter_json_object_kv_begin(emitter, "arenas"); in stats_general_print()
1147 emitter_kv(emitter, "narenas", "Arenas", emitter_type_unsigned, &uv); in stats_general_print()
1154 emitter_json_kv(emitter, "dirty_decay_ms", emitter_type_ssize, &ssv); in stats_general_print()
1157 emitter_json_kv(emitter, "muzzy_decay_ms", emitter_type_ssize, &ssv); in stats_general_print()
1160 emitter_kv(emitter, "quantum", "Quantum size", emitter_type_size, &sv); in stats_general_print()
1163 emitter_kv(emitter, "page", "Page size", emitter_type_size, &sv); in stats_general_print()
1166 emitter_kv(emitter, "tcache_max", in stats_general_print()
1172 emitter_kv(emitter, "nbins", "Number of bin size classes", in stats_general_print()
1177 emitter_kv(emitter, "nhbins", "Number of thread-cache bin size classes", in stats_general_print()
1184 if (emitter->output == emitter_output_json) { in stats_general_print()
1185 emitter_json_array_kv_begin(emitter, "bin"); in stats_general_print()
1187 emitter_json_object_begin(emitter); in stats_general_print()
1190 emitter_json_kv(emitter, "size", emitter_type_size, in stats_general_print()
1194 emitter_json_kv(emitter, "nregs", emitter_type_uint32, in stats_general_print()
1198 emitter_json_kv(emitter, "slab_size", emitter_type_size, in stats_general_print()
1202 emitter_json_kv(emitter, "nshards", emitter_type_uint32, in stats_general_print()
1205 emitter_json_object_end(emitter); in stats_general_print()
1207 emitter_json_array_end(emitter); /* Close "bin". */ in stats_general_print()
1212 emitter_kv(emitter, "nlextents", "Number of large size classes", in stats_general_print()
1215 if (emitter->output == emitter_output_json) { in stats_general_print()
1216 emitter_json_array_kv_begin(emitter, "lextent"); in stats_general_print()
1218 emitter_json_object_begin(emitter); in stats_general_print()
1221 emitter_json_kv(emitter, "size", emitter_type_size, in stats_general_print()
1224 emitter_json_object_end(emitter); in stats_general_print()
1226 emitter_json_array_end(emitter); /* Close "lextent". */ in stats_general_print()
1229 emitter_json_object_end(emitter); /* Close "arenas" */ in stats_general_print()
1233 stats_print_helper(emitter_t *emitter, bool merged, bool destroyed, in stats_print_helper() argument
1237 * the transition to the emitter code. in stats_print_helper()
1266 emitter_json_object_kv_begin(emitter, "stats"); in stats_print_helper()
1267 emitter_json_kv(emitter, "allocated", emitter_type_size, &allocated); in stats_print_helper()
1268 emitter_json_kv(emitter, "active", emitter_type_size, &active); in stats_print_helper()
1269 emitter_json_kv(emitter, "metadata", emitter_type_size, &metadata); in stats_print_helper()
1270 emitter_json_kv(emitter, "metadata_thp", emitter_type_size, in stats_print_helper()
1272 emitter_json_kv(emitter, "resident", emitter_type_size, &resident); in stats_print_helper()
1273 emitter_json_kv(emitter, "mapped", emitter_type_size, &mapped); in stats_print_helper()
1274 emitter_json_kv(emitter, "retained", emitter_type_size, &retained); in stats_print_helper()
1276 emitter_table_printf(emitter, "Allocated: %zu, active: %zu, " in stats_print_helper()
1282 emitter_json_object_kv_begin(emitter, "background_thread"); in stats_print_helper()
1283 emitter_json_kv(emitter, "num_threads", emitter_type_size, in stats_print_helper()
1285 emitter_json_kv(emitter, "num_runs", emitter_type_uint64, in stats_print_helper()
1287 emitter_json_kv(emitter, "run_interval", emitter_type_uint64, in stats_print_helper()
1289 emitter_json_object_end(emitter); /* Close "background_thread". */ in stats_print_helper()
1291 emitter_table_printf(emitter, "Background threads: %zu, " in stats_print_helper()
1306 emitter_table_row(emitter, &row); in stats_print_helper()
1307 emitter_json_object_kv_begin(emitter, "mutexes"); in stats_print_helper()
1314 emitter_json_object_kv_begin(emitter, global_mutex_names[i]); in stats_print_helper()
1315 mutex_stats_emit(emitter, &row, col64, col32); in stats_print_helper()
1316 emitter_json_object_end(emitter); in stats_print_helper()
1319 emitter_json_object_end(emitter); /* Close "mutexes". */ in stats_print_helper()
1322 emitter_json_object_end(emitter); /* Close "stats". */ in stats_print_helper()
1327 emitter_json_object_kv_begin(emitter, "stats.arenas"); in stats_print_helper()
1355 emitter_table_printf(emitter, "Merged arenas stats:\n"); in stats_print_helper()
1356 emitter_json_object_kv_begin(emitter, "merged"); in stats_print_helper()
1357 stats_arena_print(emitter, MALLCTL_ARENAS_ALL, bins, in stats_print_helper()
1359 emitter_json_object_end(emitter); /* Close "merged". */ in stats_print_helper()
1365 emitter_table_printf(emitter, in stats_print_helper()
1367 emitter_json_object_kv_begin(emitter, "destroyed"); in stats_print_helper()
1368 stats_arena_print(emitter, MALLCTL_ARENAS_DESTROYED, in stats_print_helper()
1370 emitter_json_object_end(emitter); /* Close "destroyed". */ in stats_print_helper()
1380 emitter_json_object_kv_begin(emitter, in stats_print_helper()
1382 emitter_table_printf(emitter, in stats_print_helper()
1384 stats_arena_print(emitter, i, bins, in stats_print_helper()
1387 emitter_json_object_end(emitter); in stats_print_helper()
1391 emitter_json_object_end(emitter); /* Close "stats.arenas". */ in stats_print_helper()
1438 emitter_t emitter; in stats_print() local
1439 emitter_init(&emitter, in stats_print()
1442 emitter_begin(&emitter); in stats_print()
1443 emitter_table_printf(&emitter, "___ Begin jemalloc statistics ___\n"); in stats_print()
1444 emitter_json_object_kv_begin(&emitter, "jemalloc"); in stats_print()
1447 stats_general_print(&emitter); in stats_print()
1450 stats_print_helper(&emitter, merged, destroyed, unmerged, in stats_print()
1454 emitter_json_object_end(&emitter); /* Closes the "jemalloc" dict. */ in stats_print()
1455 emitter_table_printf(&emitter, "--- End jemalloc statistics ---\n"); in stats_print()
1456 emitter_end(&emitter); in stats_print()