Thread (33 messages) flat view 33 messages, 4 authors, 2012-04-30

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

From: Mauro Carvalho Chehab <hidden>
Date: 2012-04-27 19:25:44

Possibly related (same subject, not in this thread)

Em 27-04-2012 15:11, Luck, Tony escreveu:
quoted
quoted
quoted
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help