Skip to content

Commit db9a685

Browse files
author
Larry Chen
committed
support ocfs2 log collecting
1 parent bb25e25 commit db9a685

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

hb_report/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
SYSINFO_F = "sysinfo.txt"
139139
SYSSTATS_F = "sysstats.txt"
140140
TIME_F = "time.txt"
141+
OCFS2_F = "ocfs2.txt"
141142

142143
# vim:ts=4:sw=4:et:

hb_report/utillib.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ def collect_info():
283283
time_status()
284284
corosync_blackbox()
285285
get_ratraces()
286+
dump_ocfs2()
286287

287288
for p in process_list:
288289
p.join()
@@ -441,7 +442,7 @@ def dlm_dump():
441442
for item in grep("^name", incmd="dlm_tool ls"):
442443
lock_name = item.split()[1]
443444
out_string += "## NOTICE - Lockspace {}\n".format(lock_name)
444-
out_string += get_command_info("dlm_tool lockdump {}".format(lock_name))[1] + '\n'
445+
out_string += get_command_info("dlm_tool lockdebug {}".format(lock_name))[1] + '\n'
445446
out_string += "##### NOTICE - Lockspace history:\n"
446447
out_string += get_command_info("dlm_tool dump")[1] + '\n'
447448

@@ -1629,6 +1630,22 @@ def time_status():
16291630
time_f = os.path.join(constants.WORKDIR, constants.TIME_F)
16301631
crmutils.str2file(out_string, time_f)
16311632

1633+
def dump_ocfs2():
1634+
ocfs2_f = os.path.join(constants.WORKDIR, constants.OCFS2_F)
1635+
with open(ocfs2_f, "w") as f:
1636+
#dump all tasks stack into dmesg
1637+
os.system("echo t > /proc/sysrq-trigger")
1638+
1639+
cmds = [ "dmesg", "ps -efL", "lsof",
1640+
"lsblk -o 'NAME,KNAME,MAJ:MIN,FSTYPE,LABEL,RO,RM,MODEL,SIZE,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,MOUNTPOINT'",
1641+
"mounted.ocfs2 -f", "findmnt", "mount",
1642+
"cat /sys/fs/ocfs2/cluster_stack"
1643+
]
1644+
for cmd in cmds:
1645+
_, out = crmutils.get_stdout(cmd)
1646+
f.write("\n\n#=====[ Command ] ==========================#\n")
1647+
f.write("# %s\n"%(cmd))
1648+
f.write(out)
16321649

16331650
def touch_dc():
16341651
if constants.SKIP_LVL:

0 commit comments

Comments
 (0)