[Ocfs2-tools-devel] [PATCH 7/8] dump.py: add dlm_migratable_lockres handler
Jeff Liu
jeff.liu at oracle.com
Thu Aug 20 08:23:50 PDT 2009
extract and print the following entries out, associated with the format as:
master/num_locks/flags/total_locks/mig_cookie/lockname = M/LN/F/TLN/MC/LL
we need to the dump string format compat in one line, so do not parse struct dlm_migratable_lock for now
example:
...[MIGR] K=0x74e320eb M=3 LN=2 F=0x06 TLN=2 MC=0x0000000000000000 LL=O000000000000000017a00900000000
Signed-off-by: Jeff Liu <jeff.liu at oracle.com>
---
ADDONS/odump.py | 48 ++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/ADDONS/odump.py b/ADDONS/odump.py
index b2f26a0..7856ef9 100755
--- a/ADDONS/odump.py
+++ b/ADDONS/odump.py
@@ -376,10 +376,50 @@ def MigrateRequestMsg(odict, fmtstr=MASTER_FMT + NEW_MASTER_FMT + NAME_FMT):
str = fmtstr % (master, new_master, name)
return str
-def MigrateLockresMsg(odict, fmtstr=''):
- ''' master; num_locks; flags; total_locks; mig_cookie;
- lockname; struct dlm_migratble_lock '''
- return ' '
+LOCKNUM_FMT='LN=%s '
+MIG_COOKIE='MC=%s '
+TOTAL_LOCKS='TLN=%s '
+LOCKNAME_FMT='LL=%s '
+def MigrateLockresMsg(odict, fmtstr=MASTER_FMT + LOCKNUM_FMT + \
+ FLAGS_FMT + TOTAL_LOCKS + MIG_COOKIE + LOCKNAME_FMT):
+ ''' master; num_locks; flags; total_locks; mig_cookie;
+ lockname; lvb(DLM_LVB_LEN); struct dlm_migratble_lock '''
+
+ if not odict:
+ return ''
+
+ if odict.has_key('Master'):
+ master = odict['Master'][0].strip()
+ else:
+ master = ' '
+
+ if odict.has_key('Lock Num'):
+ locknum = odict['Lock Num'][0].strip()
+ else:
+ locknum = ' '
+
+ if odict.has_key('Migres Flags'):
+ mflags = odict['Migres Flags'][0].strip()
+ else:
+ mflags = ' '
+
+ if odict.has_key('Total Locks'):
+ total_locks = odict['Total Locks'][0].strip()
+ else:
+ total_locks = ' '
+
+ if odict.has_key('Migres Cookie'):
+ mig_cookie = odict['Migres Cookie'][0].strip()
+ else:
+ mig_cookie = ' '
+
+ if odict.has_key('Lockname'):
+ lockname = odict['Lockname'][0].strip()
+ else:
+ lockname = ' '
+
+ str = fmtstr % (master, locknum, mflags, total_locks, mig_cookie, lockname)
+ return str
DNODE_FMT = "D=%s "
def LockRequestMsg(odict, fmtstr=NODEIDX_FMT + DNODE_FMT):
--
1.5.4.3
More information about the Ocfs2-tools-devel
mailing list