benmmurphy
benmmurphy

Reputation: 2505

Strace Multithreaded Program

When running strace on a multithreaded program I get results like this:

[pid 14778] futex(0x7fd8082f266c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7fd8082f2668, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...>
[pid 14780] <... futex resumed> )       = 0

Notice the arguments are on one line with <unfinished...> and the result is on another line with <...resumed>. Not having arguments correlated with their results reduces the utility of strace. Is it possible to make strace print the results and the arguments on the same line when tracing a multithreaded program?

Upvotes: 8

Views: 6866

Answers (1)

DukeLion
DukeLion

Reputation: 376

use strace -ff cmd 2> log.out

Upvotes: 10

Related Questions