Live data from Hacker News

Strace - The Sysadmin's Microscope

blogs.oracle.com

21–25 of 25 posts

Re: Strace - The Sysadmin's Microscope

#21
post #9

Earlier quoted context omitted.

This is a tangent but why is sudo needed != usable?

Unfortunately, not all organizations give their users root access :-(

usualy yoh debug code with gdb Nd the like....dtrace is morevfor profiling the whole setup and figuring out where to optimize......plus you can, i believe, insrument your code with dtrace probes, even better. if a company wants their product optimized theyll have to provide the tools for it.

Re: Strace - The Sysadmin's Microscope

#22

Does anyone know of a usable (no sudo needed) strace for Darwin / OS X?

This has bugged me for quite a while, a few days ago enough so that I actually grabbed the strace source code with the intent of compiling it on OSX, at which point I discovered the real reason: ptrace on OSX doesn't support the PTRACE_SYSCALL flag. (I gave up at that point.)

Re: Strace - The Sysadmin's Microscope

#23
Does anyone know of anything that will parse the output of strace or dtrace. What I'd like to do is generate a graph of my pipeline showing which program calls which other program, how long does it take to get back, which files it uses, etc.

I think it would be a great visualization to go along with my documentation.

Re: Strace - The Sysadmin's Microscope

#24

Does anyone know of anything that will parse the output of strace or dtrace. What I'd like to do is generate a graph of my pipeline showing which program calls which other program, how long does it take to get back, which files it uses, etc. I think it would be a great visualization to go along with my documentation.

A little Googling turned up this (definitely not the original source, though):

https://github.com/CyanogenMod/android_external_strace/blob/...

  $ strace  -tt -q -o graph.strace -s 100 -f bash -c 'ls |wc -l'
  $ ./strace-graph graph.strace 
  bash -c ls |wc -l
    +-- ls
    `-- wc -l
The comments in the code claim it will show elapsed time for each process, but that's not working for me.

I discovered the Python ptrace module while I was searching for this. I have a project for which modifying the Python module might be a nice alternative to parsing strace output.

Re: Strace - The Sysadmin's Microscope

#25

Does anyone know of a usable (no sudo needed) strace for Darwin / OS X?

With dtrace you don't run your program as root. Dtrace runs as root. It isn't a launcher like strace.

I'm referring to dtruss which is a launcher like strace and is built on dtrace. The dtruss "interface" predates dtrace, but historically didn't need to be run a root.
Post reply on HN