Skip to content

Commit

Permalink
fix dmesg and strace
Browse files Browse the repository at this point in the history
  • Loading branch information
debnatkh committed Jan 20, 2025
1 parent 6e72444 commit 12e67f7
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions cloud/storage/core/tools/testing/fio/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,29 +383,36 @@ def monitor_fio_progress():

if time.time() - start_time > timout:
logging.error("Fio process has timed out")
dmesg = subprocess.Popen(
["sudo", "dmesg"],
stdout=subprocess.PIPE,
)
dmesg.wait()
logging.error(
"dmesg output: "
+ dmesg.stdout.read().decode("utf-8")
if dmesg.stdout
else ""
)
for pid in fio_pids:
strace = subprocess.Popen(
["sudo", "strace", "-p", str(pid)],
stdout=subprocess.PIPE,
)
strace.wait()
logging.error(
"strace output for pid {}: ".format(pid)
+ strace.stdout.read().decode("utf-8")
if strace.stdout
else ""
try:
with open(
common.output_path() + "/dmesg.txt", "w"
) as dmesg_output:
subprocess.run(
["sudo", "-n", "dmesg", "-T"],
stdout=dmesg_output,
stderr=dmesg_output,
timeout=10,
)
except Exception as dmesg_error:
logging.info(
f"Failed to save dmesg output: {dmesg_error}"
)

for pid in fio_pids:
with open(
common.output_path() + f"/strace_{pid}.txt", "w"
) as strace_output:
try:
subprocess.run(
["sudo", "-n", "strace", "-p", str(pid)],
stdout=strace_output,
stderr=strace_output,
timeout=10,
)
except Exception as strace_error:
logging.info(
f"Failed to save strace output: {strace_error}"
)
break

else:
Expand Down

0 comments on commit 12e67f7

Please sign in to comment.