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