bcm2835-audio: logging mechanism

Robin Krahl robin.krahl at ireas.org
Tue Mar 7 18:52:38 EST 2017


Hi there,

the TODO file for drivers/staging/vc04_services/bcm2835-audio contains
the following item:

> 4) Cleanup the logging mechanism.  The driver should probably be using
> the standard kernel logging mechanisms such as dev_info, dev_dbg, and
> friends.

Currently there are macros audio_debug, audio_warning, LOG_DBG, LOG_WARN
etc. that call pr_* and use the function name and the line number as a
prefix for the logged message.  Refactoring this driver to use the dev_*
methods would remove this additional information, and would also lead to
some clutter as the driver structure is not directly accessible in most
of the functions, for example
	dev_dbg(alsa_stream->chip->card->dev, "...
instead of
	audio_debug("...

Furthermore, the driver currently uses "IN" and "OUT" debug messages at
the beginning and at the end of some functions, for example
snd_bcm2835_ctl_info in bcm2835-ctl.c.  This is useless if the function
name is not included in the log message.  But on the other hand, I’m not
sure whether it is desirable to have this kind of messages in the kernel
code at all.

So my question is:  Does it make sense to replace the audio_* and LOG_*
macros with the standard dev_* functions?  And is it okay to remove log
messages like "IN" and "OUT" that are only used to track function entries
and exits?

Regards,
Robin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170308/430772fc/attachment.bin 


More information about the Kernelnewbies mailing list