Whamcloud - gitweb
LU-13733 llite: report client stats sumsq 23/39223/7
authorWang Shilong <wshilong@ddn.com>
Wed, 1 Jul 2020 07:56:47 +0000 (15:56 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Sep 2020 03:44:17 +0000 (03:44 +0000)
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 <wshilong@ddn.com>
Change-Id: I4c7fc4c3958fdab757a9755cc851836971a4b700
Reviewed-on: https://review.whamcloud.com/39223
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Patrick Farrell <farr0186@gmail.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/lproc_llite.c
lustre/tests/sanity.sh

index 6ab8e5a..c701e0f 100644 (file)
@@ -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;
        /* 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";
 
                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,
                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);
        }
 
                                     llite_opcode_table[id].opname, ptr);
        }
 
index 78023ef..0fd2034 100755 (executable)
@@ -16492,6 +16492,17 @@ test_205b() {
 }
 run_test 205b "Verify job stats jobid and output format"
 
 }
 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
 # LU-1480, LU-1773 and LU-1657
 test_206() {
        mkdir -p $DIR/$tdir