Skip to contentSkip to conversation

bcm2835-audio: logging mechanism

DISCUSSION Robin Krahl 2 participants 3 messages Mar 7, 2017 – Mar 8, 2017

lore
Share & tools
lore
#0 lore raw

Hi there,

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

Quoted 3 lines

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

#1 lore raw
Quoted 2 lines · Robin Krahl

So my question is: Does it make sense to replace the audio_* and LOG_* macros with the standard dev_* functions?

Yes.

Quoted 2 lines

And is it okay to remove log messages like "IN" and "OUT" that are only used to track function entries and exits?

Yes please!

thanks,

greg k-h

#2 lore raw
Quoted 10 lines · Greg KH
Quoted 2 lines · Robin Krahl

So my question is: Does it make sense to replace the audio_* and LOG_* macros with the standard dev_* functions?

Yes.

Quoted 2 lines

And is it okay to remove log messages like "IN" and "OUT" that are only used to track function entries and exits?

Yes please!

Thanks! I?ll prepare a patch.

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/fa187f17/attachment.bin