mirror of
https://github.com/schoebel/mars
synced 2025-02-17 04:26:53 +00:00
prettyprint code
This commit is contained in:
parent
dc6d26bb2a
commit
8e42c45cf4
38
brick_mem.c
38
brick_mem.c
@ -584,7 +584,20 @@ void brick_mem_statistics(void)
|
||||
BRICK_INF("======== page allocation:\n");
|
||||
#ifdef CONFIG_MARS_MEM_PREALLOC
|
||||
for (i = 0; i <= BRICK_MAX_ORDER; i++) {
|
||||
BRICK_INF("pages order = %2d operations = %9d freelist_count = %4d / %3d raw_count = %5d alloc_count = %5d line = %5d max_count = %5d\n", i, atomic_read(&op_count[i]), atomic_read(&freelist_count[i]), freelist_max[i], atomic_read(&raw_count[i]), atomic_read(&alloc_count[i]), alloc_line[i], alloc_max[i]);
|
||||
BRICK_INF("pages order = %2d "
|
||||
"operations = %9d "
|
||||
"freelist_count = %4d / %3d "
|
||||
"raw_count = %5d "
|
||||
"alloc_count = %5d "
|
||||
"line = %5d "
|
||||
"max_count = %5d\n",
|
||||
i,
|
||||
atomic_read(&op_count[i]),
|
||||
atomic_read(&freelist_count[i]),
|
||||
freelist_max[i],
|
||||
atomic_read(&raw_count[i]),
|
||||
atomic_read(&alloc_count[i]),
|
||||
alloc_line[i], alloc_max[i]);
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < BRICK_DEBUG_MEM; i++) {
|
||||
@ -592,7 +605,13 @@ void brick_mem_statistics(void)
|
||||
if (val) {
|
||||
count += val;
|
||||
places++;
|
||||
BRICK_INF("line %4d: %6d allocated (last size = %4d, freed = %6d)\n", i, val, block_len[i], atomic_read(&block_free[i]));
|
||||
BRICK_INF("line %4d: "
|
||||
"%6d allocated "
|
||||
"(last size = %4d, freed = %6d)\n",
|
||||
i,
|
||||
val,
|
||||
block_len[i],
|
||||
atomic_read(&block_free[i]));
|
||||
}
|
||||
}
|
||||
BRICK_INF("======== %d block allocations in %d places\n", count, places);
|
||||
@ -602,7 +621,13 @@ void brick_mem_statistics(void)
|
||||
if (val) {
|
||||
count += val;
|
||||
places++;
|
||||
BRICK_INF("line %4d: %6d allocated (last size = %4d, freed = %6d)\n", i, val, mem_len[i], atomic_read(&mem_free[i]));
|
||||
BRICK_INF("line %4d: "
|
||||
"%6d allocated "
|
||||
"(last size = %4d, freed = %6d)\n",
|
||||
i,
|
||||
val,
|
||||
mem_len[i],
|
||||
atomic_read(&mem_free[i]));
|
||||
}
|
||||
}
|
||||
BRICK_INF("======== %d memory allocations in %d places\n", count, places);
|
||||
@ -612,7 +637,12 @@ void brick_mem_statistics(void)
|
||||
if (val) {
|
||||
count += val;
|
||||
places++;
|
||||
BRICK_INF("line %4d: %6d allocated (freed = %6d)\n", i, val, atomic_read(&string_free[i]));
|
||||
BRICK_INF("line %4d: "
|
||||
"%6d allocated "
|
||||
"(freed = %6d)\n",
|
||||
i,
|
||||
val,
|
||||
atomic_read(&string_free[i]));
|
||||
}
|
||||
}
|
||||
BRICK_INF("======== %d string allocations in %d places\n", count, places);
|
||||
|
40
mars_aio.c
40
mars_aio.c
@ -849,16 +849,38 @@ char *aio_statistics(struct aio_brick *brick, int verbose)
|
||||
|
||||
// FIXME: check for allocation overflows
|
||||
|
||||
snprintf(res, 1024, "total reads = %d writes = %d allocs = %d delays = %d msleeps = %d fdsyncs = %d fdsync_waits = %d | flying reads = %d writes = %d allocs = %d q0 = %d (%d - %d) q1 = %d (%d - %d) q2 = %d (%d - %d) | %s\n",
|
||||
atomic_read(&output->total_read_count), atomic_read(&output->total_write_count), atomic_read(&output->total_alloc_count), atomic_read(&output->total_delay_count), atomic_read(&output->total_msleep_count), atomic_read(&output->total_fdsync_count), atomic_read(&output->total_fdsync_wait_count),
|
||||
atomic_read(&output->read_count), atomic_read(&output->write_count), atomic_read(&output->alloc_count),
|
||||
snprintf(res, 1024,
|
||||
"total reads = %d "
|
||||
"writes = %d "
|
||||
"allocs = %d "
|
||||
"delays = %d "
|
||||
"msleeps = %d "
|
||||
"fdsyncs = %d "
|
||||
"fdsync_waits = %d | "
|
||||
"flying reads = %d "
|
||||
"writes = %d "
|
||||
"allocs = %d "
|
||||
"q0 = %d (%d - %d) "
|
||||
"q1 = %d (%d - %d) "
|
||||
"q2 = %d (%d - %d) |"
|
||||
" %s\n",
|
||||
atomic_read(&output->total_read_count),
|
||||
atomic_read(&output->total_write_count),
|
||||
atomic_read(&output->total_alloc_count),
|
||||
atomic_read(&output->total_delay_count),
|
||||
atomic_read(&output->total_msleep_count),
|
||||
atomic_read(&output->total_fdsync_count),
|
||||
atomic_read(&output->total_fdsync_wait_count),
|
||||
atomic_read(&output->read_count),
|
||||
atomic_read(&output->write_count),
|
||||
atomic_read(&output->alloc_count),
|
||||
atomic_read(&output->tinfo[0].total_enqueue_count) - atomic_read(&output->tinfo[0].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[0].total_enqueue_count), atomic_read(&output->tinfo[0].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[1].total_enqueue_count) - atomic_read(&output->tinfo[1].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[1].total_enqueue_count), atomic_read(&output->tinfo[1].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[2].total_enqueue_count) - atomic_read(&output->tinfo[2].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[2].total_enqueue_count), atomic_read(&output->tinfo[2].total_dequeue_count),
|
||||
sync ? sync : "");
|
||||
atomic_read(&output->tinfo[0].total_enqueue_count), atomic_read(&output->tinfo[0].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[1].total_enqueue_count) - atomic_read(&output->tinfo[1].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[1].total_enqueue_count), atomic_read(&output->tinfo[1].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[2].total_enqueue_count) - atomic_read(&output->tinfo[2].total_dequeue_count),
|
||||
atomic_read(&output->tinfo[2].total_enqueue_count), atomic_read(&output->tinfo[2].total_dequeue_count),
|
||||
sync ? sync : "");
|
||||
|
||||
if (sync)
|
||||
brick_string_free(sync);
|
||||
|
14
mars_bio.c
14
mars_bio.c
@ -1,5 +1,7 @@
|
||||
// (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG
|
||||
|
||||
// (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG
|
||||
|
||||
// Bio brick (interface to blkdev IO via kernel bios)
|
||||
|
||||
//#define BRICK_DEBUGGING
|
||||
@ -559,7 +561,17 @@ char *bio_statistics(struct bio_brick *brick, int verbose)
|
||||
|
||||
// FIXME: check for allocation overflows
|
||||
|
||||
snprintf(res, 512, "total completed = %d background = %d | flying = %d completing = %d background = %d\n", atomic_read(&brick->total_completed_count), atomic_read(&brick->total_background_count), atomic_read(&brick->fly_count), atomic_read(&brick->completed_count), atomic_read(&brick->background_count));
|
||||
snprintf(res, 512,
|
||||
"total completed = %d "
|
||||
"background = %d | "
|
||||
"flying = %d "
|
||||
"completing = %d "
|
||||
"background = %d\n",
|
||||
atomic_read(&brick->total_completed_count),
|
||||
atomic_read(&brick->total_background_count),
|
||||
atomic_read(&brick->fly_count),
|
||||
atomic_read(&brick->completed_count),
|
||||
atomic_read(&brick->background_count));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -567,9 +567,16 @@ char *client_statistics(struct client_brick *brick, int verbose)
|
||||
return NULL;
|
||||
|
||||
snprintf(res, 1024,
|
||||
"#%d socket max_flying = %d io_timeout = %d | timeout_count = %d fly_count = %d\n",
|
||||
output->socket.s_debug_nr, brick->max_flying, brick->io_timeout,
|
||||
atomic_read(&output->timeout_count), atomic_read(&output->fly_count));
|
||||
"#%d socket "
|
||||
"max_flying = %d "
|
||||
"io_timeout = %d | "
|
||||
"timeout_count = %d "
|
||||
"fly_count = %d\n",
|
||||
output->socket.s_debug_nr,
|
||||
brick->max_flying,
|
||||
brick->io_timeout,
|
||||
atomic_read(&output->timeout_count),
|
||||
atomic_read(&output->fly_count));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
22
mars_copy.c
22
mars_copy.c
@ -609,10 +609,24 @@ char *copy_statistics(struct copy_brick *brick, int verbose)
|
||||
return NULL;
|
||||
|
||||
snprintf(res, 1024,
|
||||
"copy_start = %lld copy_last = %lld copy_end = %lld copy_error = %d low_dirty = %d is_aborting = %d clash = %lu | io_flight = %d copy_flight = %d\n",
|
||||
brick->copy_start, brick->copy_last, brick->copy_end,
|
||||
brick->copy_error, brick->low_dirty, brick->is_aborting, brick->clash,
|
||||
atomic_read(&brick->io_flight), atomic_read(&brick->copy_flight));
|
||||
"copy_start = %lld "
|
||||
"copy_last = %lld "
|
||||
"copy_end = %lld "
|
||||
"copy_error = %d "
|
||||
"low_dirty = %d "
|
||||
"is_aborting = %d "
|
||||
"clash = %lu | "
|
||||
"io_flight = %d "
|
||||
"copy_flight = %d\n",
|
||||
brick->copy_start,
|
||||
brick->copy_last,
|
||||
brick->copy_end,
|
||||
brick->copy_error,
|
||||
brick->low_dirty,
|
||||
brick->is_aborting,
|
||||
brick->clash,
|
||||
atomic_read(&brick->io_flight),
|
||||
atomic_read(&brick->copy_flight));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
37
mars_if.c
37
mars_if.c
@ -738,7 +738,7 @@ static
|
||||
char *if_statistics(struct if_brick *brick, int verbose)
|
||||
{
|
||||
struct if_input *input = brick->inputs[0];
|
||||
char *res = brick_string_alloc(0);
|
||||
char *res = brick_string_alloc(512);
|
||||
int tmp0 = atomic_read(&input->total_reada_count);
|
||||
int tmp1 = atomic_read(&input->total_read_count);
|
||||
int tmp2 = atomic_read(&input->total_mref_read_count);
|
||||
@ -746,19 +746,28 @@ char *if_statistics(struct if_brick *brick, int verbose)
|
||||
int tmp4 = atomic_read(&input->total_mref_write_count);
|
||||
if (!res)
|
||||
return NULL;
|
||||
snprintf(res, 512, "total reada = %d reads = %d mref_reads = %d (%d%%) writes = %d mref_writes = %d (%d%%) empty = %d | plugged = %d flying = %d (reads = %d writes = %d)\n",
|
||||
tmp0,
|
||||
tmp1,
|
||||
tmp2,
|
||||
tmp1 ? tmp2 * 100 / tmp1 : 0,
|
||||
tmp3,
|
||||
tmp4,
|
||||
tmp3 ? tmp4 * 100 / tmp3 : 0,
|
||||
atomic_read(&input->total_empty_count),
|
||||
atomic_read(&input->plugged_count),
|
||||
atomic_read(&input->flying_count),
|
||||
atomic_read(&input->read_flying_count),
|
||||
atomic_read(&input->write_flying_count));
|
||||
snprintf(res, 512,
|
||||
"total reada = %d "
|
||||
"reads = %d "
|
||||
"mref_reads = %d (%d%%) "
|
||||
"writes = %d "
|
||||
"mref_writes = %d (%d%%) "
|
||||
"empty = %d | "
|
||||
"plugged = %d "
|
||||
"flying = %d "
|
||||
"(reads = %d writes = %d)\n",
|
||||
tmp0,
|
||||
tmp1,
|
||||
tmp2,
|
||||
tmp1 ? tmp2 * 100 / tmp1 : 0,
|
||||
tmp3,
|
||||
tmp4,
|
||||
tmp3 ? tmp4 * 100 / tmp3 : 0,
|
||||
atomic_read(&input->total_empty_count),
|
||||
atomic_read(&input->plugged_count),
|
||||
atomic_read(&input->flying_count),
|
||||
atomic_read(&input->read_flying_count),
|
||||
atomic_read(&input->write_flying_count));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -490,8 +490,11 @@ char *server_statistics(struct server_brick *brick, int verbose)
|
||||
return NULL;
|
||||
|
||||
snprintf(res, 1024,
|
||||
"cb_running = %d self_shutdown = %d in_flight = %d\n",
|
||||
brick->cb_running, brick->self_shutdown,
|
||||
"cb_running = %d "
|
||||
"self_shutdown = %d "
|
||||
"in_flight = %d\n",
|
||||
brick->cb_running,
|
||||
brick->self_shutdown,
|
||||
atomic_read(&brick->in_flight));
|
||||
|
||||
return res;
|
||||
|
@ -2583,15 +2583,104 @@ char *trans_logger_statistics(struct trans_logger_brick *brick, int verbose)
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
snprintf(res, 1023, "mode replay=%d continuous=%d replay_code=%d log_reads=%d | replay_start_pos = %lld replay_end_pos = %lld | new_input_nr = %d log_input_nr = %d (old = %d) replay_min_pos1 = %lld replay_max_pos1 = %lld replay_min_pos2 = %lld replay_max_pos2 = %lld | total replay=%d callbacks=%d reads=%d writes=%d flushes=%d (%d%%) wb_clusters=%d writebacks=%d (%d%%) shortcut=%d (%d%%) mshadow=%d sshadow=%d rounds=%d restarts=%d delays=%d phase1=%d phase2=%d phase3=%d phase4=%d | current #mrefs = %d shadow_mem_used=%ld/%lld replay=%d mshadow=%d/%d sshadow=%d hash_count=%d pos_count=%d balance=%d/%d/%d/%d fly=%d phase1=%d+%d phase2=%d+%d phase3=%d+%d phase4=%d+%d\n",
|
||||
brick->do_replay, brick->do_continuous_replay, brick->replay_code, brick->log_reads,
|
||||
brick->replay_start_pos, brick->replay_end_pos,
|
||||
brick->new_input_nr, brick->log_input_nr, brick->old_input_nr,
|
||||
brick->inputs[TL_INPUT_LOG1]->replay_min_pos, brick->inputs[TL_INPUT_LOG1]->replay_max_pos,
|
||||
brick->inputs[TL_INPUT_LOG2]->replay_min_pos, brick->inputs[TL_INPUT_LOG2]->replay_max_pos,
|
||||
atomic_read(&brick->total_replay_count), atomic_read(&brick->total_cb_count), atomic_read(&brick->total_read_count), atomic_read(&brick->total_write_count), atomic_read(&brick->total_flush_count), atomic_read(&brick->total_write_count) ? atomic_read(&brick->total_flush_count) * 100 / atomic_read(&brick->total_write_count) : 0, atomic_read(&brick->total_writeback_cluster_count), atomic_read(&brick->total_writeback_count), atomic_read(&brick->total_writeback_cluster_count) ? atomic_read(&brick->total_writeback_count) * 100 / atomic_read(&brick->total_writeback_cluster_count) : 0, atomic_read(&brick->total_shortcut_count), atomic_read(&brick->total_writeback_count) ? atomic_read(&brick->total_shortcut_count) * 100 / atomic_read(&brick->total_writeback_count) : 0, atomic_read(&brick->total_mshadow_count), atomic_read(&brick->total_sshadow_count), atomic_read(&brick->total_round_count), atomic_read(&brick->total_restart_count), atomic_read(&brick->total_delay_count), atomic_read(&brick->q_phase1.q_total), atomic_read(&brick->q_phase2.q_total), atomic_read(&brick->q_phase3.q_total), atomic_read(&brick->q_phase4.q_total),
|
||||
snprintf(res, 1023,
|
||||
"mode replay=%d "
|
||||
"continuous=%d "
|
||||
"replay_code=%d "
|
||||
"log_reads=%d | "
|
||||
"replay_start_pos = %lld "
|
||||
"replay_end_pos = %lld | "
|
||||
"new_input_nr = %d "
|
||||
"log_input_nr = %d "
|
||||
"(old = %d) "
|
||||
"replay_min_pos1 = %lld "
|
||||
"replay_max_pos1 = %lld "
|
||||
"replay_min_pos2 = %lld "
|
||||
"replay_max_pos2 = %lld | "
|
||||
"total replay=%d "
|
||||
"callbacks=%d "
|
||||
"reads=%d "
|
||||
"writes=%d "
|
||||
"flushes=%d (%d%%) "
|
||||
"wb_clusters=%d "
|
||||
"writebacks=%d (%d%%) "
|
||||
"shortcut=%d (%d%%) "
|
||||
"mshadow=%d "
|
||||
"sshadow=%d "
|
||||
"rounds=%d "
|
||||
"restarts=%d "
|
||||
"delays=%d "
|
||||
"phase1=%d "
|
||||
"phase2=%d "
|
||||
"phase3=%d "
|
||||
"phase4=%d | "
|
||||
"current #mrefs = %d "
|
||||
"shadow_mem_used=%ld/%lld "
|
||||
"replay=%d "
|
||||
"mshadow=%d/%d "
|
||||
"sshadow=%d "
|
||||
"hash_count=%d "
|
||||
"pos_count=%d "
|
||||
"balance=%d/%d/%d/%d "
|
||||
"fly=%d "
|
||||
"phase1=%d+%d "
|
||||
"phase2=%d+%d "
|
||||
"phase3=%d+%d "
|
||||
"phase4=%d+%d\n",
|
||||
brick->do_replay,
|
||||
brick->do_continuous_replay,
|
||||
brick->replay_code,
|
||||
brick->log_reads,
|
||||
brick->replay_start_pos,
|
||||
brick->replay_end_pos,
|
||||
brick->new_input_nr,
|
||||
brick->log_input_nr,
|
||||
brick->old_input_nr,
|
||||
brick->inputs[TL_INPUT_LOG1]->replay_min_pos,
|
||||
brick->inputs[TL_INPUT_LOG1]->replay_max_pos,
|
||||
brick->inputs[TL_INPUT_LOG2]->replay_min_pos,
|
||||
brick->inputs[TL_INPUT_LOG2]->replay_max_pos,
|
||||
atomic_read(&brick->total_replay_count),
|
||||
atomic_read(&brick->total_cb_count),
|
||||
atomic_read(&brick->total_read_count),
|
||||
atomic_read(&brick->total_write_count),
|
||||
atomic_read(&brick->total_flush_count),
|
||||
atomic_read(&brick->total_write_count) ? atomic_read(&brick->total_flush_count) * 100 / atomic_read(&brick->total_write_count) : 0,
|
||||
atomic_read(&brick->total_writeback_cluster_count),
|
||||
atomic_read(&brick->total_writeback_count),
|
||||
atomic_read(&brick->total_writeback_cluster_count) ? atomic_read(&brick->total_writeback_count) * 100 / atomic_read(&brick->total_writeback_cluster_count) : 0,
|
||||
atomic_read(&brick->total_shortcut_count),
|
||||
atomic_read(&brick->total_writeback_count) ? atomic_read(&brick->total_shortcut_count) * 100 / atomic_read(&brick->total_writeback_count) : 0,
|
||||
atomic_read(&brick->total_mshadow_count),
|
||||
atomic_read(&brick->total_sshadow_count),
|
||||
atomic_read(&brick->total_round_count),
|
||||
atomic_read(&brick->total_restart_count),
|
||||
atomic_read(&brick->total_delay_count),
|
||||
atomic_read(&brick->q_phase1.q_total),
|
||||
atomic_read(&brick->q_phase2.q_total),
|
||||
atomic_read(&brick->q_phase3.q_total),
|
||||
atomic_read(&brick->q_phase4.q_total),
|
||||
atomic_read(&brick->mref_object_layout.alloc_count),
|
||||
atomic64_read(&brick->shadow_mem_used), brick_global_memlimit, atomic_read(&brick->replay_count), atomic_read(&brick->mshadow_count), brick->shadow_mem_limit, atomic_read(&brick->sshadow_count), atomic_read(&brick->hash_count), atomic_read(&brick->pos_count), atomic_read(&brick->sub_balance_count), atomic_read(&brick->inner_balance_count), atomic_read(&brick->outer_balance_count), atomic_read(&brick->wb_balance_count), atomic_read(&brick->fly_count), atomic_read(&brick->q_phase1.q_queued), atomic_read(&brick->q_phase1.q_flying), atomic_read(&brick->q_phase2.q_queued), atomic_read(&brick->q_phase2.q_flying), atomic_read(&brick->q_phase3.q_queued), atomic_read(&brick->q_phase3.q_flying), atomic_read(&brick->q_phase4.q_queued), atomic_read(&brick->q_phase4.q_flying));
|
||||
atomic64_read(&brick->shadow_mem_used),
|
||||
brick_global_memlimit, atomic_read(&brick->replay_count),
|
||||
atomic_read(&brick->mshadow_count),
|
||||
brick->shadow_mem_limit,
|
||||
atomic_read(&brick->sshadow_count),
|
||||
atomic_read(&brick->hash_count),
|
||||
atomic_read(&brick->pos_count),
|
||||
atomic_read(&brick->sub_balance_count),
|
||||
atomic_read(&brick->inner_balance_count),
|
||||
atomic_read(&brick->outer_balance_count),
|
||||
atomic_read(&brick->wb_balance_count),
|
||||
atomic_read(&brick->fly_count),
|
||||
atomic_read(&brick->q_phase1.q_queued),
|
||||
atomic_read(&brick->q_phase1.q_flying),
|
||||
atomic_read(&brick->q_phase2.q_queued),
|
||||
atomic_read(&brick->q_phase2.q_flying),
|
||||
atomic_read(&brick->q_phase3.q_queued),
|
||||
atomic_read(&brick->q_phase3.q_flying),
|
||||
atomic_read(&brick->q_phase4.q_queued),
|
||||
atomic_read(&brick->q_phase4.q_flying));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user