46
45
# capture strace output to a file
47
46
log_file = tempfile.NamedTemporaryFile()
48
47
log_file_fd = log_file.fileno()
51
51
strace_cmd = ['strace', '-r', '-tt', '-p', str(pid), '-o', log_file.name]
54
56
proc = subprocess.Popen(strace_cmd,
57
59
# Wait for strace to attach
58
60
attached_notice = proc.stdout.readline()
59
61
# Run the function to strace