1 From: Sunil Mushran <sunil.mushran@oracle.com>
2 Date: Thu, 26 Feb 2009 15:00:46 -0800
3 Subject: ocfs2/dlm: Show the number of lockres/mles in dlm_state
7 This patch shows the number of lockres' and mles in the debugfs file, dlm_state.
9 Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
10 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
12 fs/ocfs2/dlm/dlmdebug.c | 36 ++++++++++++++++++++++++++++++++++++
13 1 files changed, 36 insertions(+), 0 deletions(-)
15 Index: linux-2.6.27-sle11_ocfs2_update/fs/ocfs2/dlm/dlmdebug.c
16 ===================================================================
17 --- linux-2.6.27-sle11_ocfs2_update.orig/fs/ocfs2/dlm/dlmdebug.c
18 +++ linux-2.6.27-sle11_ocfs2_update/fs/ocfs2/dlm/dlmdebug.c
19 @@ -763,6 +763,8 @@ static int debug_state_print(struct dlm_
21 struct dlm_reco_node_data *node;
23 + int cur_mles = 0, tot_mles = 0;
26 spin_lock(&dlm->spinlock);
28 @@ -805,6 +807,40 @@ static int debug_state_print(struct dlm_
29 db->buf + out, db->len - out);
30 out += snprintf(db->buf + out, db->len - out, "\n");
32 + /* Lock Resources: xxx (xxx) */
33 + out += snprintf(db->buf + out, db->len - out,
34 + "Lock Resources: %d (%d)\n",
35 + atomic_read(&dlm->res_cur_count),
36 + atomic_read(&dlm->res_tot_count));
38 + for (i = 0; i < DLM_MLE_NUM_TYPES; ++i)
39 + tot_mles += atomic_read(&dlm->mle_tot_count[i]);
41 + for (i = 0; i < DLM_MLE_NUM_TYPES; ++i)
42 + cur_mles += atomic_read(&dlm->mle_cur_count[i]);
44 + /* MLEs: xxx (xxx) */
45 + out += snprintf(db->buf + out, db->len - out,
46 + "MLEs: %d (%d)\n", cur_mles, tot_mles);
48 + /* Blocking: xxx (xxx) */
49 + out += snprintf(db->buf + out, db->len - out,
50 + " Blocking: %d (%d)\n",
51 + atomic_read(&dlm->mle_cur_count[DLM_MLE_BLOCK]),
52 + atomic_read(&dlm->mle_tot_count[DLM_MLE_BLOCK]));
54 + /* Mastery: xxx (xxx) */
55 + out += snprintf(db->buf + out, db->len - out,
56 + " Mastery: %d (%d)\n",
57 + atomic_read(&dlm->mle_cur_count[DLM_MLE_MASTER]),
58 + atomic_read(&dlm->mle_tot_count[DLM_MLE_MASTER]));
60 + /* Migration: xxx (xxx) */
61 + out += snprintf(db->buf + out, db->len - out,
62 + " Migration: %d (%d)\n",
63 + atomic_read(&dlm->mle_cur_count[DLM_MLE_MIGRATION]),
64 + atomic_read(&dlm->mle_tot_count[DLM_MLE_MIGRATION]));
66 /* Lists: Dirty=Empty Purge=InUse PendingASTs=Empty ... */
67 out += snprintf(db->buf + out, db->len - out,
68 "Lists: Dirty=%s Purge=%s PendingASTs=%s "