From 8a1334626ec2f3dba954d5a7e2162eb3fe966c47 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Wed, 1 Jul 2020 15:56:47 +0800 Subject: [PATCH] LU-13733 llite: report client stats sumsq Commit cd8fb tries to account sumsq for every client operation, but lprocfs_counter_init() did not init them properly, also add a test case to verify new format of client stats. Fixes: cd8fb1e8d300 ("LU-13597 ofd: add more information to job_stats") Signed-off-by: Wang Shilong Change-Id: I4c7fc4c3958fdab757a9755cc851836971a4b700 Reviewed-on: https://review.whamcloud.com/39223 Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu Reviewed-by: Patrick Farrell Tested-by: jenkins Tested-by: Maloo --- lustre/llite/lproc_llite.c | 7 ++----- lustre/tests/sanity.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 6ab8e5a..c701e0f 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -1656,19 +1656,16 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name) /* do counter init */ for (id = 0; id < LPROC_LL_FILE_OPCODES; id++) { u32 type = llite_opcode_table[id].type; - void *ptr = NULL; + void *ptr = "unknown"; if (type & LPROCFS_TYPE_REQS) ptr = "reqs"; else if (type & LPROCFS_TYPE_BYTES) ptr = "bytes"; - else if (type & LPROCFS_TYPE_PAGES) - ptr = "pages"; else if (type & LPROCFS_TYPE_USEC) ptr = "usec"; lprocfs_counter_init(sbi->ll_stats, - llite_opcode_table[id].opcode, - (type & LPROCFS_CNTR_AVGMINMAX), + llite_opcode_table[id].opcode, type, llite_opcode_table[id].opname, ptr); } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 78023ef..0fd2034 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -16492,6 +16492,17 @@ test_205b() { } run_test 205b "Verify job stats jobid and output format" +# LU-13733 +test_205c() { + $LCTL set_param llite.*.stats=0 + dd if=/dev/zero of=$DIR/$tfile.1 bs=4k count=1 + $LCTL get_param llite.*.stats + $LCTL get_param llite.*.stats | grep \ + "write_bytes *1 samples \[bytes\] 4096 4096 4096 16777216" || + error "wrong client stats format found" +} +run_test 205c "Verify client stats format" + # LU-1480, LU-1773 and LU-1657 test_206() { mkdir -p $DIR/$tdir -- 1.8.3.1