# strace help



## balanga (Oct 26, 2017)

I've never used devel/strace and would welcome any guidance on using it...

Any pointers for setting it up and using it would be appreciated.


----------



## ShelLuser (Oct 26, 2017)

Although devel/strace exists (much to my surprise) my advice would be to use truss and maybe ktrace / kdump (you need those last 2 combined). Don't forget that strace is basically a Linux tool and therefor more or less expects a Linux environment.

That in itself makes it a bit flawed for BSD usage:


```
macron:/home/peter $ truss -o test ls > /dev/null
macron:/home/peter $ strace -o test2 ls >/dev/null
pread: Device busy
pread: Device busy
pread: Device busy
pread: Device busy
PIOCWSTOP: Inappropriate ioctl for device
trouble opening proc file
```
That's really not very useful I think.

But to answer your question: there's the strace(1) manualpage (though maybe outdated, seems to be from 2003), and according to `pkg info -lx strace` you can also check out /usr/local/share/doc.

Still, my advice is definitely to use the native FreeBSD utilities instead, those will be much more reliable.


----------



## balanga (Oct 27, 2017)

ShelLuser said:


> Still, my advice is definitely to use the native FreeBSD utilities instead, those will be much more reliable.



I want to use strace because a Linux developer has agreed to help me get one of his programs working on FreeBSD and any output will be more meaningful to him.


----------



## tobik@ (Oct 27, 2017)

Output from truss(1) is very similar to strace's output. I'm sure they'll be able to understand it too.


----------

