performance/io-threads: Improve debuggability in statedump

statedump from io-threads lacked information to understand the number of
running threads & number of requests in each priority queue. This patch
addresses that.

Sample statedump output w/ this patch:

current_high_priority_threads=7
current_normal_priority_threads=9
current_low_priority_threads=0
current_least_priority_threads=0
fast_priority_queue_length=32
normal_priority_queue_length=45

Also, changed the wording for least priority queue in
iot_get_pri_meaning().

Change-Id: Ic5f6391a15cc28884383f5185fce1cb52e0d10a5
fixes: bz#1664124
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Vijay Bellur 2018-11-16 23:26:35 +05:30
parent 1a3c2a48e7
commit 86f5d75c70

View File

@ -275,7 +275,7 @@ iot_get_pri_meaning(gf_fop_pri_t pri)
name = "slow";
break;
case GF_FOP_PRI_LEAST:
name = "least priority";
name = "least";
break;
case GF_FOP_PRI_MAX:
name = "invalid";
@ -370,7 +370,7 @@ iot_schedule(call_frame_t *frame, xlator_t *this, call_stub_t *stub)
return -EINVAL;
}
out:
gf_msg_debug(this->name, 0, "%s scheduled as %s fop",
gf_msg_debug(this->name, 0, "%s scheduled as %s priority fop",
gf_fop_list[stub->fop], iot_get_pri_meaning(pri));
if (this->private)
ret = do_iot_schedule(this->private, stub, pri);
@ -927,6 +927,8 @@ iot_priv_dump(xlator_t *this)
{
iot_conf_t *conf = NULL;
char key_prefix[GF_DUMP_MAX_BUF_LEN];
char key[GF_DUMP_MAX_BUF_LEN];
int i = 0;
if (!this)
return 0;
@ -944,14 +946,29 @@ iot_priv_dump(xlator_t *this)
gf_proc_dump_write("sleep_count", "%d", conf->sleep_count);
gf_proc_dump_write("idle_time", "%d", conf->idle_time);
gf_proc_dump_write("stack_size", "%zd", conf->stack_size);
gf_proc_dump_write("high_priority_threads", "%d",
gf_proc_dump_write("max_high_priority_threads", "%d",
conf->ac_iot_limit[GF_FOP_PRI_HI]);
gf_proc_dump_write("normal_priority_threads", "%d",
gf_proc_dump_write("max_normal_priority_threads", "%d",
conf->ac_iot_limit[GF_FOP_PRI_NORMAL]);
gf_proc_dump_write("low_priority_threads", "%d",
gf_proc_dump_write("max_low_priority_threads", "%d",
conf->ac_iot_limit[GF_FOP_PRI_LO]);
gf_proc_dump_write("least_priority_threads", "%d",
gf_proc_dump_write("max_least_priority_threads", "%d",
conf->ac_iot_limit[GF_FOP_PRI_LEAST]);
gf_proc_dump_write("current_high_priority_threads", "%d",
conf->ac_iot_count[GF_FOP_PRI_HI]);
gf_proc_dump_write("current_normal_priority_threads", "%d",
conf->ac_iot_count[GF_FOP_PRI_NORMAL]);
gf_proc_dump_write("current_low_priority_threads", "%d",
conf->ac_iot_count[GF_FOP_PRI_LO]);
gf_proc_dump_write("current_least_priority_threads", "%d",
conf->ac_iot_count[GF_FOP_PRI_LEAST]);
for (i = 0; i < GF_FOP_PRI_MAX; i++) {
if (!conf->queue_sizes[i])
continue;
snprintf(key, sizeof(key), "%s_priority_queue_length",
iot_get_pri_meaning(i));
gf_proc_dump_write(key, "%d", conf->queue_sizes[i]);
}
return 0;
}