Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
The kernel sees "%[subsys]s" and adds the argument as the value of the "subsys" key, using the same format (or alternatively, just prints the unformatted format string, and userspace does the work).
This would make the API easy to use, compared to the patch which requires horrible code like this:
char* buf = kmalloc(64 + strlen(subsys_name) + strlen(dev_name));
sprintf(buf, "SUBSYS=%s\nDEVICE=%s\n", subsys_name, dev_name);
printk_emit(buf, strlen(buf), KERN_EMERG "%s: %s: device caught fire", subsys_name, dev_name);
Compare that to just:
printk(KERN_EMERG "%[subsys]s: %[device]s: device caught fire", subsys_name, dev_name);
It's clear that the API in the patch is totally inferior and that almost nobody will use it except dev_printk.
Toward more reliable logging
Posted Apr 15, 2012 14:56 UTC (Sun) by abacus (guest, #49001)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds