From fe8e5e095c29d90abf0f0b683f1bba50c4f92710 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 27 Oct 2017 15:43:13 -0500 Subject: [PATCH] scoutfs: turn on cluster locking stats I accidentally left this off with the initial dlmglue commit. I enabled it here so that I could see our CW locks happening in real time. We don't print lock name yet but that will be remedied in a future patch. Turning this on gives us a debugfs file, /sys/kernel/debug/scoutfs//locking_state which exports the full lock state to userspace. The information exported on each lock is extensive. The export includes each locks name level, blocking level, request state, flags, etc. We also get a count of lock attempts and failures for each level (cw, pr, ex). In addition we also get the total time and max time waited on a given lock request. Signed-off-by: Mark Fasheh --- kmod/Makefile | 2 +- kmod/src/dlmglue.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kmod/Makefile b/kmod/Makefile index 97c48c17..ade36d3e 100644 --- a/kmod/Makefile +++ b/kmod/Makefile @@ -22,7 +22,7 @@ SCOUTFS_FORMAT_HASH := \ SCOUTFS_ARGS := SCOUTFS_GIT_DESCRIBE=$(SCOUTFS_GIT_DESCRIBE) \ SCOUTFS_FORMAT_HASH=$(SCOUTFS_FORMAT_HASH) \ CONFIG_SCOUTFS_FS=m -C $(SK_KSRC) M=$(CURDIR)/src \ - EXTRA_CFLAGS=-Werror + EXTRA_CFLAGS="-Werror -DCONFIG_OCFS2_FS_STATS" all: module diff --git a/kmod/src/dlmglue.c b/kmod/src/dlmglue.c index c4df1071..c7bf711c 100644 --- a/kmod/src/dlmglue.c +++ b/kmod/src/dlmglue.c @@ -179,9 +179,9 @@ static void ocfs2_update_lock_stats(struct ocfs2_lock_res *res, int level, ktime_t kt; struct ocfs2_lock_stats *stats; - if (level == LKM_PRMODE) + if (level == DLM_LOCK_PR) stats = &res->l_lock_prmode; - else if (level == LKM_EXMODE) + else if (level == DLM_LOCK_EX) stats = &res->l_lock_exmode; else return;