3 ms·
>it’s how you know what wrong-ass directory your compiler is pulling the broken config from Mind=blown. Of course! I've been neglecting this thing for so man
by omginternets 4y ago
>it’s how you know what wrong-ass directory your compiler is pulling the broken config from
Mind=blown. Of course! I've been neglecting this thing for so many years!
Question: any recommended reading for using strace effectively?
- benreesman 4y ago`strace` has a bunch of features that I'd like to learn thoroughly someday, but I get weekly if not daily value from a few basic invocations: `run_my_build.whatever` -> hangs, damn. `strace run_my_build.whatever` -> awesome i can see all the system calls so i know what `.so`s it's pulling in, and what config files it's trying to read, and if it's hanging on a network socket or whatever. This is usually where `strace` just immediately solves my problem. If you've got like a background daemon that's misbehaving you can do `strace -p <PID>` and it will attach and start printing out the syscalls, this can also be really useful. `strace` (on all my systems at least) logs to `STDERR` by default, so sometimes you want some combination of like `2>/tmp/log.strace.blah` or to interleave the `STDOOUT` of the process so it's just the usual shell stuff `strace whatever 2>&1 | rg -C ...`. My use of the tool is very basic, but that's part of what makes it such a great tool, a few simple invocations will just save your bacon. This is especially true on a new team/company or whatever where you run the thing from the Wiki and it doesn't build or start or...
- omginternets 4y agoNice. I definitely need to use this more. Thanks :)
- mbwgh 4y agoIf you use `htop`, you can press `s` while hovering over the process. In addition to providing the `strace -p` functionality, you also get some rudimentary helper functionality like searching, filtering, or manually scrolling vs. tailing the output.
- omginternets 4y agoThat's super cool. Thanks for the tip!