News for hackers. Stuff that matters.
Re:The Magic of strace by _kp6z on Friday January 31, 2014 @04:12AM (#7155969)
If you think strace is useful, wait until you try dtrace.
Re:The Magic of strace by fafner on Friday January 31, 2014 @07:26AM (#7156320)
Re:The Magic of strace by cbab on Friday January 31, 2014 @02:33PM (#7158673)
or LTTng with both kernel and userspace tracers http://lttng.org

Disclaimer: LTTng developer :)

Re:The Magic of strace by sgt on Friday January 31, 2014 @08:10AM (#7156466)
I was thinking that too. It is my humble opinion that dtrace will knock strace out of its socks.
Re:The Magic of strace by stormbrew on Friday January 31, 2014 @03:35PM (#7159025)
I find that strace (or dtruss) is more useful when you know less about what exactly you're trying to find. A log of syscalls is often exactly the right granularity to find out the gist of what a process you didn't write is trying (and failing) to do.

So I think the comparison, despite the superficial similarity and similar mechanism of action, isn't really fair.

Re:The Magic of strace by ballard on Friday January 31, 2014 @04:50AM (#7156022)
dtrace is cool, and it benefits from source instrumentation (probes).

strace / dtruss just spit out kernel syscalls of any user land program wo modifications.

Also dtrace, as seen on smartos

Re:The Magic of strace by hobo_mark on Friday January 31, 2014 @05:39AM (#7156113)
while we wait, could you elaborate on that? ;)
Re:The Magic of strace by dmpk2k on Friday January 31, 2014 @09:06AM (#7156650)
strace shows syscalls -- it's effectively truss.

That's useful and all, but what if you want to instrument arbitrary parts of a program, not just the syscall interface? By function or instruction? Either in userspace or in kernel? With statistical functions? And speculative tracing? And extensive control flow (except loops, which prevent certain safely guarantees DTrace makes). And a lot more.

Don't be fooled by the single-letter change: strace is to DTrace what edlin is to emacs. Or something else ridiculously extreme. They're barely comparable.

Re:The Magic of strace by Xdes on Friday January 31, 2014 @10:14AM (#7157016)
Still doesn't tell me what dtrace does.
Re:The Magic of strace by brodney on Friday January 31, 2014 @10:18AM (#7157045)
Re:The Magic of strace by Xdes on Friday January 31, 2014 @10:35AM (#7157151)
Or you could just give a concise definition:

    >What is this "DTrace" thing? It stands for "Dynamic Tracing",
    >a way you can attach "probes" to a running system
    >and peek inside as to what it is doing.
Re:The Magic of strace by brodney on Friday January 31, 2014 @01:22PM (#7158178)
It was my mistake to link you to a tutorial on the thing you are asking about. I don't know what came over me.
Re:The Magic of strace by dunham on Friday January 31, 2014 @12:51PM (#7157935)
It's like awk, except that you match entry/exit of syscalls, function calls, method invocations (in ObjC/Java), and give code to execute with access to arguments, return values, stack trace, etc.

It can be used to write tools like strace (see "dtruss" on OSX), iotop, topsyscall, etc.

Re:The Magic of strace by Someone on Friday January 31, 2014 @03:04PM (#7158861)
On Mac OS X, the way to get an idea of what dtrace can do is "apropos dtrace". That shows you the dtrace scripts that the OS ships with.
Re:The Magic of strace by shangxiao on Saturday February 01, 2014 @12:21AM (#7160944)
Thanks! It looks as though by default strace isn't available on Mac but dtrace is!