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