tech-kern archive

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

Re: Converting kernel printf() to aprint_*() or log()



In article <20141201004712.GA25792@stishovite>,
Izaak  <yitzhak%inbox.ru@localhost> wrote:
>On Sun, Nov 23, 2014 at 08:07:12AM +1100, matthew green wrote:
>> Izaak writes:
>> > I am interested in working on the project to convert kernel printf to
>> > the appropriate aprint or log function:
>> > http://wiki.netbsd.org/projects/project/aprint/
>> > [...]
>> my take on this is:
>> 
>>   - we should convert all autoconf messages to the relevant
>>     aprint(9).  this is its own project.
>> 
>>   - we should convert all other device logging (whether printf
>>     or log based) to use a device_*() function that does what
>>     we want.)  this is another project.
>> 
>>   - non-device log/printf should be ignored for these projects.
>So, I have looked into this, but I just want to confirm some basics
>before I start. 
>
>I have decided to concentrate on converting the autoconf messages first.
>Does this mean that I will only be looking at the code in /sys/dev or are 
>there other places where autoconf is performed?

In sys/dev we have the MI drivers; there are MD drivers in sys/arch/*/*

>After reading the manual for driver(9) and autoconf(9) it appears that
>I should only change calls contained inside *_match, *_attach, *_detach,
>*_activate as defined in the CFATTACH_DECL for that driver. Is that
>correct?

That should cover most of it.

>Also, the manual for kprintf(9) says that the choice of aprint function
>should depend on the verbosity set in the boothowto variable (e.g
>AB_VERBOSE implies aprint_verbose). Still, this rule does not seem to be
>strict -- e.g. /sys/dev/acpi/acpi_pci_link.c:510-511 -- I would expect
>aprint_verbose here.
>https://github.com/jsonn/src/blob/trunk/sys/dev/acpi/acpi_pci_link.c#L511
>Is that a mistake? Should I also fix these 'mistakes'?

Yes, I think so.

christos



Home | Main Index | Thread Index | Old Index