News for hackers. Stuff that matters.
Re:Strace – My Favourite Secret Weapon (2011) by brendangregg on Sunday February 11, 2018 @08:19PM (#16355845)
No mention of overhead. strace can bring down your production environment -- it is not safe. This is why I wrote this: http://www.brendangregg.com/blog/2014-05-11/strace-wow-much-...

"perf trace" has improved since I wrote that, and may well be mostly strace-equivalent (but without crippling overhead) in the latest Linux.

Re:Strace – My Favourite Secret Weapon (2011) by zwischenzug on Monday February 12, 2018 @02:26AM (#16357110)
Whenever I've had to use it in prod (in heavy OLTP environments) the seriousness of the issue has always outweighed any performance concerns. Ditto tcpdump. Often it was used specifically to determine the cause of performance issues. In any case you generally only strace 1 process, and if your application stack depends on one process you're probably in other kinds of trouble... unless it's erlang :)
Re:Strace – My Favourite Secret Weapon (2011) by brendangregg on Monday February 12, 2018 @03:03AM (#16357235)
It's not a choice between strace or nothing. It's a choice between strace, ftrace, perf, or eBPF -- and that's just the Linux builtins. Many low overhead addons can also do syscall tracing (sysdig, LTTng).

I often run ftrace, perf, and eBPF on our production instances for syscall tracing. If I ran strace, the instance would suddenly be very slow, and it would trigger Hysterix (and other) timeouts and be removed from the ASG and auto terminated. Our environment is fault-tolerant, so yes, we can run strace -- you just don't get much output, and the load vanishes from the instance you are looking at.

Re:Strace – My Favourite Secret Weapon (2011) by Bromskloss on Monday February 12, 2018 @05:52AM (#16357859)
Which of those alternatives are an option if the goal is to inspect and rewrite syscall arguments and return values, and do other things in between?
Re:Strace – My Favourite Secret Weapon (2011) by helper on Monday February 12, 2018 @03:50PM (#16361986)
Last time I tried `perf trace` I realized how many things strace does that I take for granted. Things like file handle to filename resolution and pretty printing read() and write() buffers.

Do newer versions of `perf trace` expose these?

Re:Strace – My Favourite Secret Weapon (2011) by Bromskloss on Monday February 12, 2018 @05:47AM (#16357843)
> it is not safe

Are you referring to that it makes syscalls slow, or is it about something else?

Re:Strace – My Favourite Secret Weapon (2011) by cynwoody on Monday February 12, 2018 @01:41AM (#16356978)
Many thanks!

Yours is a very superior treatment of the strace topic.

Re:Strace – My Favourite Secret Weapon (2011) by shaklee3 on Sunday February 11, 2018 @11:11PM (#16356474)
Thanks. Really enjoy your blog.