Linux debugging tools I love
jvns.ca
jvns.ca
I feel reckless writing C/C++ code if I can't test it with Memcheck.
I understand it probably handles mutithreading better and probably has a much better performance - but is that really it?
{
tracer tr(function, ...)
timer ti(tr, milliseconds);
the constructor of the timer would sample and record the time. The destructor would sample the time again, and if it was over the specified milliseconds, it would log a diagnostic into the tracer.I love valgrind/callgrind and it has proven extremely valuable. As always, choose the right tool for the job.
There is also the advantage that perf is really testing the actual code on the real hardware. This can get important if you are trying to design code that is cache-aware. Although, with cachegrind, you can set what kind of emulated cache parameters you want, I'm not sure how well this emulates the real hardware, especially if you have multiple threads with cache conflicts.
edited: typo
Full disclaimer: I'm am a contributor to the LTTng project.
I recently had to debug a memory usage issue at work, and SystemTap seemed like it would be a lifesaver in those and many other occasions. Unfortunately, both myself and my coworkers were inexperienced with it and there wasn't much documentation about it online, so we ended up using a standard profiler to track down the issue, which turned out to be a much slower process.
I think you hit the nail on the head right there. Also I think SystemTap requires a certain kernel version or above and some enterprise systems are still stuck at RHEL 6.5.
Edit not on mobile now. I was randomly looking through strange loop videos and watched one of her. Her enthusiasm and attitude are infectious. Its so fun to watch her be so excited that she gets tripped up trying to decide which awesome thing to tell you. I saw no picture of her on the website i viewied but surmised from the other comments here. Great video and seemingly an amazing person.
The google interview story is superb to hear if anyone hasn't watched yet.
Personally I also like to extract data from logs with UNIX tools and feed them into csv/tsv files, then process them with R.
It gets you something closer to what the program looks like at the source code level: You get calls to printf (well, __printf_chk on a modern Linux) instead of write, for example. The downside is that ltrace doesn't (and can't) know as much about every single function in every single dynamic library, so, while the names are there, the arguments are typically less convenient to work with and may be incorrect. (For example, it doesn't dereference pointers to print out nice strings, and it might not know how many arguments a function takes.)