News for hackers. Stuff that matters.
Re:The unreasonable effectiveness of print debugging by ruslan on Saturday April 24, 2021 @10:22PM (#26929849)
You don't put printf() in critical sections, instead you collect some statistics. Once critical section is over you can freely print collected data for further analyzis. Or you can print it once a second. This simple technique works well for debugging racing conditions, performance issues (profiling), memory leaks, kernel drivers and bare-metal stuff where timing is a concern. So, yes "Print debugging always works...", but must be used wisely. :-)
Re:The unreasonable effectiveness of print debugging by Shikadi on Sunday April 25, 2021 @01:58AM (#26930605)
Collecting statistics can change race conditions too, it's just less likely