Question

I want to get the Output of multiple strace calls in one file,
but i do not know how.

At the moment i am using:
strace -o tmpfile, but this just puts the output of one file in and then overrites the file with the new output.

Has anyone an idea, how to do this? I hope this is no dumb question.

Thanks in advance.

Was it helpful?

Solution 3

I could not manage to do this via the call itself (in the Android Shell).
I just read through all files and write them to one Log file.
This solution slows the whole process down, but was the only solution I found.

OTHER TIPS

Under the bash shell use the following command

strace -o >(cat >>outputfile) command [args] ...

This will pass to the -o flag an argument that will appear like a file, but will be instead a file descriptor to the standard input of the

cat >>outputfile

process. This process will append its input to the specified output file.

Instead of strace -o somefile command, can you just do strace command >> somefile? Alternatively, assuming a similar version of strace, my manual for strace indicates this should work: strace -o "|tail -a somefile" command (the -o "|command" functionality is implemented by strace itself, not by the shell).

The strace output is on stderr, strace 2>> outfile did the trick for me. If you invoke strace as single command you have to call it like this: adb -e shell "strace -p pid 2>> file"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top