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