[PATCH EDACv16 1/2] edac: Change internal representation to work with layers

Mauro Carvalho Chehab mchehab at redhat.com
Sat Apr 28 05:24:28 EST 2012


Em 27-04-2012 15:11, Luck, Tony escreveu:
>>>> +	for (i = 0; i < dimm->mci->n_layers; i++) {
>>>> +		printk(KERN_CONT "%d", dimm->location[i]);
>>>> +		if (i < dimm->mci->n_layers - 1)
>>>> +			printk(KERN_CONT ".");
>>>> +	}
>>>> +	printk(KERN_CONT "\n");
>>>
>>> This looks hacky but I don't have a good suggestion what to do instead
>>> here. Maybe snprintf into a complete string which you can issue with
>>> debugf4()...
>>
>> This is not hacky. There are several places at the Kernel doing loops like
>> that. Look, for example, at lib/hexdump.c (without KERN_CONT, as this
>> macro was added later - probably to avoid checkpatch.pl complains).
> 
> There is some benefit to "one printk == one output line" ... it means
> that console output will not be (as) jumbled if multiple cpus are
> printk'ing at the same time.

Ok, but this message only appears when all the conditions below are met:
	- the driver is compiled with EDAC_DEBUG;
	- the edac_core is modprobed with edac_debug_level=4;
	- during the driver modprobe, when the EDAC driver is being registered.

Even on several-core machines, those messages won't mangle, in practice.

Let's not over-design a simple debug message.

Regards,
Mauro


More information about the Linuxppc-dev mailing list