3 ms·
None of the complexity talked about in the article is about formatting and all of the complexity is about reliability and message durability in light of all the
by pilif 7y ago
None of the complexity talked about in the article is about formatting and all of the complexity is about reliability and message durability in light of all the low-level things going on concurrently on actual hardware while still wanting to offer an easy-to use interface and acceptable performance.
printf doesn't have to deal with any of these issues.
- devit 7y agoWell, it does since calling printf in a userspace signal handler is equivalent to calling printk in a kernel interrupt handler. But the userspace "solution" is to just forbid such usage.
- jlokier 7y agoAnd in fact, you can implement the similar tricks to those used in printk(), to make a safe_printf() that works for logging in a userspace signal handler.
- pilif 7y ago> But the userspace "solution" is to just forbid such usage. which is totally not something the kernel developers want because printk is the one thing that remains even when everything else has gone belly-up. They need a reliable method to log even under the harshest of circumstances because without a reliable log, how should they be able to ever cause those circumstances to not happen?