The Magic of strace
81–90 of 105 posts
Re: The Magic of strace
#82I just thought I’d let people know that it can be a lot easier to read strace’s output if you read the output log file using Vim as it contains a syntax file which can highlight PIDs, function names, constants, strings, etc. Alternatively, if you don’t want to create an strace log file, you could pipe the output to Vim and it will automatically detect it as being strace output, e.g.
strace program_name 2>&1 | vim -Re: The Magic of strace
#83Small, somewhat nit-picky critique: the man pages for system calls are in section 2. If you want to see the docs for the "read()" syscall, and not the bash builtin "read", saying "man read" w̶o̶n̶'̶t̶ may not (see follow-up) do what you expect. Instead, you should say man 2 read This should probably be mentioned somewhere. Otherwise, great writeup. Thanks for sharing! (edited)
There's a manpage bash-builtins in section 7, but I've never seen a system that had manpages for the individual builtins, let alone having them in section 1. "man read" on every system I've used opens the read manpage in section 2.
Re: The Magic of strace
#84Please see ftp://86.0.252.89/pub/release/website/tools/trace-20140126-x86_64-b95.tar.gz This is a tool called ptrace - which does everything that strace does and a lot more. You have working binaries in there, and most of the source - I havent extricated the full build dependencies so it all builds, but this includes extra facilities like reporting summaries of process trees, showing only connections or files, and sh…
Why do you link directly to the download file? A link to the tool's man page[1] would be sufficient. [1] http://linux.die.net/man/2/ptrace
Re: The Magic of strace
#85Re: The Magic of strace
#86If you think strace is useful, wait until you try dtrace.
or systemtap https://sourceware.org/systemtap/ or ktap http://www.ktap.org/doc/tutorial.html for GNU/Linux
Disclaimer: LTTng developer :)
Re: The Magic of strace
#87Small, somewhat nit-picky critique: the man pages for system calls are in section 2. If you want to see the docs for the "read()" syscall, and not the bash builtin "read", saying "man read" w̶o̶n̶'̶t̶ may not (see follow-up) do what you expect. Instead, you should say man 2 read This should probably be mentioned somewhere. Otherwise, great writeup. Thanks for sharing! (edited)
Re: The Magic of strace
#88Earlier quoted context omitted.
Still doesn't tell me what dtrace does.
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
#89If you think strace is useful, wait until you try dtrace.
I was thinking that too. It is my humble opinion that dtrace will knock strace out of its socks.
So I think the comparison, despite the superficial similarity and similar mechanism of action, isn't really fair.
Re: The Magic of strace
#90also remember also useful 'ltrace' - libraries tracing