diff options
author | Kurt Hackel <kurt.hackel@oracle.com> | 2006-04-27 21:47:41 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-06-26 17:42:50 -0400 |
commit | 958837197e6415009cba0f31bbb5aacdb936ef09 (patch) | |
tree | 56c32cb8e4c3c419edaf1a7b1a44e2127930f406 /fs | |
parent | d6dea6e9732f5319b723e14f7adbc5f99cd69aec (diff) |
ocfs2: better mle debugging
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index f1fbf2f4e5d6..d1c85f10c634 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -130,15 +130,30 @@ static inline int dlm_mle_equal(struct dlm_ctxt *dlm, | |||
130 | #if 0 | 130 | #if 0 |
131 | /* Code here is included but defined out as it aids debugging */ | 131 | /* Code here is included but defined out as it aids debugging */ |
132 | 132 | ||
133 | #define dlm_print_nodemap(m) _dlm_print_nodemap(m,#m) | ||
134 | void _dlm_print_nodemap(unsigned long *map, const char *mapname) | ||
135 | { | ||
136 | int i; | ||
137 | printk("%s=[ ", mapname); | ||
138 | for (i=0; i<O2NM_MAX_NODES; i++) | ||
139 | if (test_bit(i, map)) | ||
140 | printk("%d ", i); | ||
141 | printk("]"); | ||
142 | } | ||
143 | |||
133 | void dlm_print_one_mle(struct dlm_master_list_entry *mle) | 144 | void dlm_print_one_mle(struct dlm_master_list_entry *mle) |
134 | { | 145 | { |
135 | int i = 0, refs; | 146 | int refs; |
136 | char *type; | 147 | char *type; |
137 | char attached; | 148 | char attached; |
138 | u8 master; | 149 | u8 master; |
139 | unsigned int namelen; | 150 | unsigned int namelen; |
140 | const char *name; | 151 | const char *name; |
141 | struct kref *k; | 152 | struct kref *k; |
153 | unsigned long *maybe = mle->maybe_map, | ||
154 | *vote = mle->vote_map, | ||
155 | *resp = mle->response_map, | ||
156 | *node = mle->node_map; | ||
142 | 157 | ||
143 | k = &mle->mle_refs; | 158 | k = &mle->mle_refs; |
144 | if (mle->type == DLM_MLE_BLOCK) | 159 | if (mle->type == DLM_MLE_BLOCK) |
@@ -159,9 +174,18 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle) | |||
159 | name = mle->u.res->lockname.name; | 174 | name = mle->u.res->lockname.name; |
160 | } | 175 | } |
161 | 176 | ||
162 | mlog(ML_NOTICE, " #%3d: %3s %3d %3u %3u %c (%d)%.*s\n", | 177 | mlog(ML_NOTICE, "%.*s: %3s refs=%3d mas=%3u new=%3u evt=%c inuse=%d ", |
163 | i, type, refs, master, mle->new_master, attached, | 178 | namelen, name, type, refs, master, mle->new_master, attached, |
164 | namelen, namelen, name); | 179 | mle->inuse); |
180 | dlm_print_nodemap(maybe); | ||
181 | printk(", "); | ||
182 | dlm_print_nodemap(vote); | ||
183 | printk(", "); | ||
184 | dlm_print_nodemap(resp); | ||
185 | printk(", "); | ||
186 | dlm_print_nodemap(node); | ||
187 | printk(", "); | ||
188 | printk("\n"); | ||
165 | } | 189 | } |
166 | 190 | ||
167 | static void dlm_dump_mles(struct dlm_ctxt *dlm) | 191 | static void dlm_dump_mles(struct dlm_ctxt *dlm) |
@@ -170,7 +194,6 @@ static void dlm_dump_mles(struct dlm_ctxt *dlm) | |||
170 | struct list_head *iter; | 194 | struct list_head *iter; |
171 | 195 | ||
172 | mlog(ML_NOTICE, "dumping all mles for domain %s:\n", dlm->name); | 196 | mlog(ML_NOTICE, "dumping all mles for domain %s:\n", dlm->name); |
173 | mlog(ML_NOTICE, " ####: type refs owner new events? lockname nodemap votemap respmap maybemap\n"); | ||
174 | spin_lock(&dlm->master_lock); | 197 | spin_lock(&dlm->master_lock); |
175 | list_for_each(iter, &dlm->master_list) { | 198 | list_for_each(iter, &dlm->master_list) { |
176 | mle = list_entry(iter, struct dlm_master_list_entry, list); | 199 | mle = list_entry(iter, struct dlm_master_list_entry, list); |