All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] output ipconfig info message as one printk
@ 2011-05-14 21:45 Micha Nelissen
  2011-05-16 18:00 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Micha Nelissen @ 2011-05-14 21:45 UTC (permalink / raw)
  To: netdev, davem

the "ip-config complete" message with ip address etc is output using
many printks. When using the netconsole, and multiple agents are booting
(and logging their boot) simultaneously, the syslog of the receiving
host gets very messy, as the individual printks are interleaved.
Combining the many printks into one printk improves syslog readability.


Index: atom-linux/net/ipv4/ipconfig.c
===================================================================
--- atom-linux/net/ipv4/ipconfig.c	(revision 1493)
+++ atom-linux/net/ipv4/ipconfig.c	(revision 1494)
@@ -1363,6 +1363,9 @@
 #ifdef IPCONFIG_DYNAMIC
 	int retries = CONF_OPEN_RETRIES;
 #endif
+#ifndef IPCONFIG_SILENT
+	char mtubuf[16];
+#endif
 	int err;
 
 #ifdef CONFIG_PROC_FS
@@ -1477,19 +1480,17 @@
 	/*
 	 * Clue in the operator.
 	 */
-	printk("IP-Config: Complete:");
-	printk("\n     device=%s", ic_dev->name);
-	printk(", addr=%pI4", &ic_myaddr);
-	printk(", mask=%pI4", &ic_netmask);
-	printk(", gw=%pI4", &ic_gateway);
-	printk(",\n     host=%s, domain=%s, nis-domain=%s",
-	       utsname()->nodename, ic_domain, utsname()->domainname);
-	printk(",\n     bootserver=%pI4", &ic_servaddr);
-	printk(", rootserver=%pI4", &root_server_addr);
-	printk(", rootpath=%s", root_server_path);
 	if (ic_dev_mtu)
-		printk(", mtu=%d", ic_dev_mtu);
-	printk("\n");
+		snprintf(mtubuf, sizeof(mtubuf), "mtu=%d, ", ic_dev_mtu);
+	else
+		mtubuf[0] = '\0';
+	printk( "IP-Config: Complete:\n"
+		"     device=%s, addr=%pI4, mask=%pI4, gw=%pI4,\n"
+		"     %shost=%s, domain=%s, nis-domain=%s,\n"
+		"     bootserver=%pI4, rootserver=%pI4, rootpath=%s\n",
+		ic_dev->name, &ic_myaddr, &ic_netmask, &ic_gateway,
+		mtubuf, utsname()->nodename, ic_domain, utsname()->domainname,
+		&ic_servaddr, &root_server_addr, root_server_path);
 #endif /* !SILENT */
 
 	return 0;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] output ipconfig info message as one printk
  2011-05-14 21:45 [PATCH] output ipconfig info message as one printk Micha Nelissen
@ 2011-05-16 18:00 ` David Miller
  2011-05-16 18:12   ` Micha Nelissen
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-05-16 18:00 UTC (permalink / raw)
  To: micha; +Cc: netdev

From: Micha Nelissen <micha@neli.hopto.org>
Date: Sat, 14 May 2011 23:45:19 +0200

> the "ip-config complete" message with ip address etc is output using
> many printks. When using the netconsole, and multiple agents are booting
> (and logging their boot) simultaneously, the syslog of the receiving
> host gets very messy, as the individual printks are interleaved.
> Combining the many printks into one printk improves syslog readability.

First, you are missing a proper "Signed-off-by: " tag in your
patch submissions.

Second, you should not do this because now the lines after the
first won't have the default loglevel prepended.

I think this should just be left alone, and you should properly
mark your netconsole logs so that you can discern which machine
the individual messages come from so you can piece them together
properly if you need to.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] output ipconfig info message as one printk
  2011-05-16 18:00 ` David Miller
@ 2011-05-16 18:12   ` Micha Nelissen
  0 siblings, 0 replies; 3+ messages in thread
From: Micha Nelissen @ 2011-05-16 18:12 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

David Miller wrote:
> Second, you should not do this because now the lines after the
> first won't have the default loglevel prepended.
> 
> I think this should just be left alone, and you should properly
> mark your netconsole logs so that you can discern which machine
> the individual messages come from so you can piece them together
> properly if you need to.

Hmm, perhaps the printks can at least be grouped per line?

Micha

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-16 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-14 21:45 [PATCH] output ipconfig info message as one printk Micha Nelissen
2011-05-16 18:00 ` David Miller
2011-05-16 18:12   ` Micha Nelissen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.