summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.c
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2018-11-16 23:26:35 +0530
committerVijay Bellur <vbellur@redhat.com>2019-01-07 11:33:01 -0800
commit86f5d75c70a5fa6f1790b17d12d56fd8b37b9ddd (patch)
treef6914e3406aed97e2a5406f846992d56837ddffc /xlators/performance/io-threads/src/io-threads.c
parent1a3c2a48e7cd44f2cc8b7b5384321d289aedab8e (diff)
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>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.c')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 411888424ed..dbf8e8f6a70 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -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;
}