diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2010-02-26 22:42:45 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-02-27 22:57:07 -0500 |
commit | 6fcef3f04a1a0f8d7a086147d2f2e650c8cc2754 (patch) | |
tree | cb68835c1ecdc9a197b0eeabe0eb4a4405d36665 /fs/ocfs2/dlmfs | |
parent | 9b915181af0a99fe94ef0152e6a4ca9990c3b6d0 (diff) |
ocfs2/userdlm: Add tracing in userdlm
Make use of the newly added BASTS masklog to trace ASTs and BASTs in userdlm.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlmfs')
-rw-r--r-- | fs/ocfs2/dlmfs/userdlm.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c index 2858ee6003c7..0499e3fb7bdb 100644 --- a/fs/ocfs2/dlmfs/userdlm.c +++ b/fs/ocfs2/dlmfs/userdlm.c | |||
@@ -128,8 +128,9 @@ static void user_ast(struct ocfs2_dlm_lksb *lksb) | |||
128 | struct user_lock_res *lockres = user_lksb_to_lock_res(lksb); | 128 | struct user_lock_res *lockres = user_lksb_to_lock_res(lksb); |
129 | int status; | 129 | int status; |
130 | 130 | ||
131 | mlog(0, "AST fired for lockres %.*s\n", lockres->l_namelen, | 131 | mlog(ML_BASTS, "AST fired for lockres %.*s, level %d => %d\n", |
132 | lockres->l_name); | 132 | lockres->l_namelen, lockres->l_name, lockres->l_level, |
133 | lockres->l_requested); | ||
133 | 134 | ||
134 | spin_lock(&lockres->l_lock); | 135 | spin_lock(&lockres->l_lock); |
135 | 136 | ||
@@ -214,8 +215,8 @@ static void user_bast(struct ocfs2_dlm_lksb *lksb, int level) | |||
214 | { | 215 | { |
215 | struct user_lock_res *lockres = user_lksb_to_lock_res(lksb); | 216 | struct user_lock_res *lockres = user_lksb_to_lock_res(lksb); |
216 | 217 | ||
217 | mlog(0, "Blocking AST fired for lockres %.*s. Blocking level %d\n", | 218 | mlog(ML_BASTS, "BAST fired for lockres %.*s, blocking %d, level %d\n", |
218 | lockres->l_namelen, lockres->l_name, level); | 219 | lockres->l_namelen, lockres->l_name, level, lockres->l_level); |
219 | 220 | ||
220 | spin_lock(&lockres->l_lock); | 221 | spin_lock(&lockres->l_lock); |
221 | lockres->l_flags |= USER_LOCK_BLOCKED; | 222 | lockres->l_flags |= USER_LOCK_BLOCKED; |
@@ -232,8 +233,8 @@ static void user_unlock_ast(struct ocfs2_dlm_lksb *lksb, int status) | |||
232 | { | 233 | { |
233 | struct user_lock_res *lockres = user_lksb_to_lock_res(lksb); | 234 | struct user_lock_res *lockres = user_lksb_to_lock_res(lksb); |
234 | 235 | ||
235 | mlog(0, "UNLOCK AST called on lock %.*s\n", lockres->l_namelen, | 236 | mlog(ML_BASTS, "UNLOCK AST fired for lockres %.*s, flags 0x%x\n", |
236 | lockres->l_name); | 237 | lockres->l_namelen, lockres->l_name, lockres->l_flags); |
237 | 238 | ||
238 | if (status) | 239 | if (status) |
239 | mlog(ML_ERROR, "dlm returns status %d\n", status); | 240 | mlog(ML_ERROR, "dlm returns status %d\n", status); |
@@ -302,8 +303,7 @@ static void user_dlm_unblock_lock(struct work_struct *work) | |||
302 | struct ocfs2_cluster_connection *conn = | 303 | struct ocfs2_cluster_connection *conn = |
303 | cluster_connection_from_user_lockres(lockres); | 304 | cluster_connection_from_user_lockres(lockres); |
304 | 305 | ||
305 | mlog(0, "processing lockres %.*s\n", lockres->l_namelen, | 306 | mlog(0, "lockres %.*s\n", lockres->l_namelen, lockres->l_name); |
306 | lockres->l_name); | ||
307 | 307 | ||
308 | spin_lock(&lockres->l_lock); | 308 | spin_lock(&lockres->l_lock); |
309 | 309 | ||
@@ -321,17 +321,23 @@ static void user_dlm_unblock_lock(struct work_struct *work) | |||
321 | * flag, and finally we might get another bast which re-queues | 321 | * flag, and finally we might get another bast which re-queues |
322 | * us before our ast for the downconvert is called. */ | 322 | * us before our ast for the downconvert is called. */ |
323 | if (!(lockres->l_flags & USER_LOCK_BLOCKED)) { | 323 | if (!(lockres->l_flags & USER_LOCK_BLOCKED)) { |
324 | mlog(ML_BASTS, "lockres %.*s USER_LOCK_BLOCKED\n", | ||
325 | lockres->l_namelen, lockres->l_name); | ||
324 | spin_unlock(&lockres->l_lock); | 326 | spin_unlock(&lockres->l_lock); |
325 | goto drop_ref; | 327 | goto drop_ref; |
326 | } | 328 | } |
327 | 329 | ||
328 | if (lockres->l_flags & USER_LOCK_IN_TEARDOWN) { | 330 | if (lockres->l_flags & USER_LOCK_IN_TEARDOWN) { |
331 | mlog(ML_BASTS, "lockres %.*s USER_LOCK_IN_TEARDOWN\n", | ||
332 | lockres->l_namelen, lockres->l_name); | ||
329 | spin_unlock(&lockres->l_lock); | 333 | spin_unlock(&lockres->l_lock); |
330 | goto drop_ref; | 334 | goto drop_ref; |
331 | } | 335 | } |
332 | 336 | ||
333 | if (lockres->l_flags & USER_LOCK_BUSY) { | 337 | if (lockres->l_flags & USER_LOCK_BUSY) { |
334 | if (lockres->l_flags & USER_LOCK_IN_CANCEL) { | 338 | if (lockres->l_flags & USER_LOCK_IN_CANCEL) { |
339 | mlog(ML_BASTS, "lockres %.*s USER_LOCK_IN_CANCEL\n", | ||
340 | lockres->l_namelen, lockres->l_name); | ||
335 | spin_unlock(&lockres->l_lock); | 341 | spin_unlock(&lockres->l_lock); |
336 | goto drop_ref; | 342 | goto drop_ref; |
337 | } | 343 | } |
@@ -352,16 +358,18 @@ static void user_dlm_unblock_lock(struct work_struct *work) | |||
352 | if ((lockres->l_blocking == DLM_LOCK_EX) | 358 | if ((lockres->l_blocking == DLM_LOCK_EX) |
353 | && (lockres->l_ex_holders || lockres->l_ro_holders)) { | 359 | && (lockres->l_ex_holders || lockres->l_ro_holders)) { |
354 | spin_unlock(&lockres->l_lock); | 360 | spin_unlock(&lockres->l_lock); |
355 | mlog(0, "can't downconvert for ex: ro = %u, ex = %u\n", | 361 | mlog(ML_BASTS, "lockres %.*s, EX/PR Holders %u,%u\n", |
356 | lockres->l_ro_holders, lockres->l_ex_holders); | 362 | lockres->l_namelen, lockres->l_name, |
363 | lockres->l_ex_holders, lockres->l_ro_holders); | ||
357 | goto drop_ref; | 364 | goto drop_ref; |
358 | } | 365 | } |
359 | 366 | ||
360 | if ((lockres->l_blocking == DLM_LOCK_PR) | 367 | if ((lockres->l_blocking == DLM_LOCK_PR) |
361 | && lockres->l_ex_holders) { | 368 | && lockres->l_ex_holders) { |
362 | spin_unlock(&lockres->l_lock); | 369 | spin_unlock(&lockres->l_lock); |
363 | mlog(0, "can't downconvert for pr: ex = %u\n", | 370 | mlog(ML_BASTS, "lockres %.*s, EX Holders %u\n", |
364 | lockres->l_ex_holders); | 371 | lockres->l_namelen, lockres->l_name, |
372 | lockres->l_ex_holders); | ||
365 | goto drop_ref; | 373 | goto drop_ref; |
366 | } | 374 | } |
367 | 375 | ||
@@ -369,8 +377,8 @@ static void user_dlm_unblock_lock(struct work_struct *work) | |||
369 | new_level = user_highest_compat_lock_level(lockres->l_blocking); | 377 | new_level = user_highest_compat_lock_level(lockres->l_blocking); |
370 | lockres->l_requested = new_level; | 378 | lockres->l_requested = new_level; |
371 | lockres->l_flags |= USER_LOCK_BUSY; | 379 | lockres->l_flags |= USER_LOCK_BUSY; |
372 | mlog(0, "Downconvert lock from %d to %d\n", | 380 | mlog(ML_BASTS, "lockres %.*s, downconvert %d => %d\n", |
373 | lockres->l_level, new_level); | 381 | lockres->l_namelen, lockres->l_name, lockres->l_level, new_level); |
374 | spin_unlock(&lockres->l_lock); | 382 | spin_unlock(&lockres->l_lock); |
375 | 383 | ||
376 | /* need lock downconvert request now... */ | 384 | /* need lock downconvert request now... */ |
@@ -430,10 +438,8 @@ int user_dlm_cluster_lock(struct user_lock_res *lockres, | |||
430 | goto bail; | 438 | goto bail; |
431 | } | 439 | } |
432 | 440 | ||
433 | mlog(0, "lockres %.*s: asking for %s lock, passed flags = 0x%x\n", | 441 | mlog(ML_BASTS, "lockres %.*s, level %d, flags = 0x%x\n", |
434 | lockres->l_namelen, lockres->l_name, | 442 | lockres->l_namelen, lockres->l_name, level, lkm_flags); |
435 | (level == DLM_LOCK_EX) ? "DLM_LOCK_EX" : "DLM_LOCK_PR", | ||
436 | lkm_flags); | ||
437 | 443 | ||
438 | again: | 444 | again: |
439 | if (signal_pending(current)) { | 445 | if (signal_pending(current)) { |
@@ -603,7 +609,7 @@ int user_dlm_destroy_lock(struct user_lock_res *lockres) | |||
603 | struct ocfs2_cluster_connection *conn = | 609 | struct ocfs2_cluster_connection *conn = |
604 | cluster_connection_from_user_lockres(lockres); | 610 | cluster_connection_from_user_lockres(lockres); |
605 | 611 | ||
606 | mlog(0, "asked to destroy %.*s\n", lockres->l_namelen, lockres->l_name); | 612 | mlog(ML_BASTS, "lockres %.*s\n", lockres->l_namelen, lockres->l_name); |
607 | 613 | ||
608 | spin_lock(&lockres->l_lock); | 614 | spin_lock(&lockres->l_lock); |
609 | if (lockres->l_flags & USER_LOCK_IN_TEARDOWN) { | 615 | if (lockres->l_flags & USER_LOCK_IN_TEARDOWN) { |