Functions | |
void | tm_msg_enable (const char *codes, int enable) |
Enable or disable messages. | |
void | tm_msg (const char *format,...) |
Prints messages to tm_msg_file. | |
void | tm_msg1 (const char *format,...) |
Format additional message data. | |
void | tm_print_stats () |
API: Print statistics. | |
void | tm_print_block_stats () |
API: Print block statistics. | |
void | tm_print_time_stats () |
API: Print timing stats. | |
Variables | |
int | tm_sweep_is_error |
FILE * | tm_msg_file |
Debug message file handle. | |
const char * | tm_msg_prefix |
void tm_msg | ( | const char * | format, | |
... | ||||
) |
Prints messages to tm_msg_file.
Returns if format is empty.
Default tm_msg_file to stderr.
Print header.
Print allocation pass if > 1
Print msg.
Flush IO buffers.
Referenced by __tm_write_barrier(), __tm_write_barrier_root(), _tm_alloc_type_inner(), _tm_assert(), _tm_block_alloc(), _tm_block_alloc_from_free_list(), _tm_block_free(), _tm_block_sweep_some(), _tm_check_sweep_error(), _tm_gc_full_type_inner(), _tm_node_delete(), _tm_node_mark(), _tm_node_parcel_some(), _tm_node_scan_some(), _tm_node_sweep(), _tm_node_sweep_some(), _tm_node_sweep_some_for_type(), _tm_node_unmark_some(), _tm_os_alloc(), _tm_os_alloc_aligned(), _tm_os_free(), _tm_phase_init(), _tm_print_utilization(), _tm_range_scan(), _tm_root_add_1(), _tm_root_scan_all(), _tm_root_scan_id(), _tm_root_scan_some(), _tm_type_alloc_node_from_free_list(), tm_fatal(), tm_init(), tm_print_block_stats(), tm_print_color_transition_stats(), tm_print_phase_transition_stats(), tm_print_stats(), tm_print_time_stats(), tm_ptr_to_block(), tm_ptr_to_node(), tm_root_add(), tm_root_remove(), tm_time_stat_print_(), tm_type_new_2(), and tm_write_barrier_node().
void tm_msg1 | ( | const char * | format, | |
... | ||||
) |
Format additional message data.
Referenced by _tm_print_utilization(), tm_print_block_stats(), tm_print_color_transition_stats(), tm_print_phase_transition_stats(), and tm_time_stat_print_().
void tm_msg_enable | ( | const char * | codes, | |
int | enable | |||
) |
Enable or disable messages.
Messages correspond the first character in the format string of tm_msg().
Referenced by tm_init(), tm_print_block_stats(), tm_print_color_transition_stats(), tm_print_phase_transition_stats(), tm_print_stats(), and tm_print_time_stats().
void tm_print_block_stats | ( | ) |
API: Print block statistics.
Definition at line 208 of file stats.c.
References _tm_block_validate, tm_data::block_id, tm_block::id, tm_type::id, tm_data::n, tm_block::size, tm_type::size, tm, tm_B, tm_block_SIZE, tm_CAPACITY, tm_color_name, tm_list_LOOP, tm_list_LOOP_END, tm_msg(), tm_msg1(), tm_msg_enable(), tm_TOTAL, tm_WHITE, and tm_data::types.
00209 { 00210 tm_type *t; 00211 00212 tm_block *b; 00213 00214 tm_msg_enable("X", 1); 00215 00216 tm_msg("X { b tb%lu[%lu] block_id %d\n", 00217 tm.n[tm_B], 00218 tm.n[tm_B] * tm_block_SIZE, 00219 tm.block_id 00220 ); 00221 00222 tm_list_LOOP(&tm.types, t); 00223 { 00224 tm_msg("X t#%d @%p s%lu \n", t->id, (void*) t, (unsigned long) t->size); 00225 00226 tm_list_LOOP(&t->blocks, b); 00227 { 00228 int j; 00229 00230 _tm_block_validate(b); 00231 00232 tm_msg("X b#%d @%p s%lu ", (int) b->id, (void*) b, (unsigned long) b->size); 00233 00234 for ( j = 0; j < sizeof(b->n)/sizeof(b->n[0]); j ++ ) { 00235 tm_msg1("%c%-4lu ", tm_color_name[j][0], (unsigned long) b->n[j]); 00236 } 00237 00238 /* Parcel utilization. */ 00239 tm_msg1("T/b%3d%% ", 00240 (int) ((b->n[tm_TOTAL] * 100) / b->n[tm_CAPACITY]) 00241 ); 00242 00243 /* Compute block utilization. */ 00244 tm_msg1("(T-W)/b%3d%% ", 00245 (int) (((b->n[tm_TOTAL] - b->n[tm_WHITE]) * 100) / b->n[tm_CAPACITY]) 00246 ); 00247 00248 tm_msg1("\n"); 00249 } 00250 tm_list_LOOP_END; 00251 } 00252 tm_list_LOOP_END; 00253 00254 tm_msg("X }\n"); 00255 00256 tm_msg_enable("X", 0); 00257 }
void tm_print_stats | ( | ) |
API: Print statistics.
Definition at line 93 of file stats.c.
References _tm_print_utilization(), tm_data::free_blocks_n, tm_type::id, tm_type::n, tm_data::n, tm_type::size, tm, tm__LAST3, tm_B, tm_b_OS, tm_B_OS, tm_b_OS_M, tm_B_OS_M, tm_block_SIZE, tm_list_LOOP, tm_list_LOOP_END, tm_msg(), tm_msg_enable(), tm_print_color_transition_stats(), tm_print_phase_transition_stats(), tm_print_time_stats(), tm_data::type_id, and tm_data::types.
Referenced by _tm_check_sweep_error(), _tm_os_alloc(), and tm_abort().
00094 { 00095 tm_type *t; 00096 size_t sum[tm__LAST3]; 00097 00098 memset(sum, 0, sizeof(sum)); 00099 00100 tm_msg_enable("X", 1); 00101 00102 tm_msg("X { t#%d : blk_in_use %lu[~%lu], blk_free %lu[~%lu]\n", 00103 tm.type_id, 00104 tm.n[tm_B], 00105 tm.n[tm_B] * tm_block_SIZE, 00106 tm.free_blocks_n, 00107 tm.free_blocks_n * tm_block_SIZE 00108 ); 00109 00110 tm_list_LOOP(&tm.types, t); 00111 { 00112 tm_msg("X t#%d S%-6lu\n", t->id, (unsigned long) t->size, (unsigned) t->n[tm_B]); 00113 _tm_print_utilization("X ", t, t->n, sizeof(t->n)/sizeof(t->n[0]), sum); 00114 } 00115 tm_list_LOOP_END; 00116 00117 /* current/max number of blocks/bytes allocated from OS is in tm.n[]. */ 00118 sum[tm_B_OS] = tm.n[tm_B_OS]; 00119 sum[tm_b_OS] = tm.n[tm_b_OS]; 00120 sum[tm_B_OS_M] = tm.n[tm_B_OS_M]; 00121 sum[tm_b_OS_M] = tm.n[tm_b_OS_M]; 00122 00123 _tm_print_utilization("X S ", 0, sum, sizeof(sum)/sizeof(sum[0]), sum); 00124 00125 tm_msg("X }\n"); 00126 00127 tm_msg_enable("X", 0); 00128 00129 tm_print_time_stats(); 00130 00131 tm_print_color_transition_stats(); 00132 00133 tm_print_phase_transition_stats(); 00134 00135 //tm_validate_lists(); 00136 }
void tm_print_time_stats | ( | ) |
API: Print timing stats.
Definition at line 395 of file stats.c.
References tm_data::alloc_by_phase, tm, tm_msg(), tm_msg_enable(), tm_time_stat_print_(), tm_data::ts_alloc, tm_data::ts_barrier, tm_data::ts_barrier_black, tm_data::ts_barrier_pure, tm_data::ts_barrier_root, tm_data::ts_free, tm_data::ts_gc, tm_data::ts_os_alloc, tm_data::ts_os_free, and tm_data::ts_phase.
Referenced by tm_print_stats().
00396 { 00397 int i; 00398 00399 tm_msg_enable("T", 1); 00400 00401 tm_msg("T {\n"); 00402 00403 tm_time_stat_print_(&tm.ts_os_alloc, ~0, 0); 00404 tm_time_stat_print_(&tm.ts_os_free, ~0, 0); 00405 tm_time_stat_print_(&tm.ts_alloc, ~0, 0); 00406 tm_time_stat_print_(&tm.ts_free, ~0, 0); 00407 tm_time_stat_print_(&tm.ts_gc, ~0, 0); 00408 tm_time_stat_print_(&tm.ts_barrier, ~0, 0); 00409 tm_time_stat_print_(&tm.ts_barrier_pure, ~0, 0); 00410 tm_time_stat_print_(&tm.ts_barrier_root, ~0, 0); 00411 tm_time_stat_print_(&tm.ts_barrier_black, ~0, 0); 00412 00413 for ( i = 0; 00414 i < (sizeof(tm.ts_phase) / sizeof(tm.ts_phase[0])); 00415 ++ i ) { 00416 tm_time_stat_print_(&tm.ts_phase[i], ~0, &tm.alloc_by_phase[i]); 00417 } 00418 00419 tm_msg("T }\n"); 00420 00421 tm_msg_enable("T", 0); 00422 }
FILE* tm_msg_file |
Debug message file handle.
Definition at line 56 of file debug.c.
Referenced by tm_validate_lists().
const char* tm_msg_prefix |