31

Strangely i can't find it any where but when i stdout the output of strace into afile like this:

strace foo.exe | & tee foo.log

the out put is to short, how can i make the width longer?

2

3 Answers 3

45

The "-s" option under Linux, from the "strace" package, will let you specify the width:

-s strsize  Specify  the  maximum  string  size  to  print  (the
            default is 32).  Note that filenames are not consid-
            ered strings and are always printed in full.
1
  • 2
    And with colors: strace $CMD 2>&1 > /dev/null | vim -c ':set syntax=strace' -.
    – Pablo A
    Aug 27, 2017 at 14:43
1

Use '-o filename' option:

  strace -f -o foo.log foo

man strace

-o filename Write the trace output to the file filename

2
  • 1
    True, not directly an answer, but I found it useful in this context nonetheless. It does write the full strings into the file.
    – user63623
    Jan 12, 2017 at 15:49
  • 3
    Not really, @user63623. I've tried it here and ended up having to use -s anyway (strace 4.26).
    – hdiogenes
    Jun 3, 2019 at 22:13
0

As other answers point to good directions in general, the specific issue is probably the space you have between "|" and "&". If you're trying to use a bash "|&" to pipe both stdout and stderr you can't have a space between those characters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.