tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: log(9) variant for device error messages



On Mon, Jun 16, 2014 at 03:48:37PM +0200, Martin Husemann wrote:
> The aprint_error_dev() function is probably one of the most abused aprint_*
> family functions in drivers, because it is SO usefull.
> 
> However, the abuse of aprint_* for messages past autoconfiguration has to
> stop. It would be good to have a good replacement in the log(9) family.
> 
> So I propose to create
> 
>       void log_device_error(device_t, const char *format, ...);
> 
> which prepends the message with device_xname() and ": ", and passes it
> as LOG_ERR to log(9).
> 
> What do you think?

I think instead, we could have

        void log_dev(device_t dev, int level, const char *format, ...);

and retire aprint_*.  In these days of interrupts being activated early
and kernel modules, there isn't a specific time for autoconfiguration
any more.  log(LOG_ERR) can set the same flag aprint_error sets for
init(8) to know something unexpected happened before it was loaded,
however useful that is.

Then there is the question of aprint_naive(9) but if you ask me I could
do without AB_QUIET anyway.  The time to stare at the console while the
computer boots is long gone, so AB_SILENT, AB_NORMAL and AB_DEBUG cover
all the reasonable uses in my very humble opinion.

-- 
Quentin Garnier - cube%cubidou.net@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Attachment: pgpwZc54zqEJ1.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index