Patchwork output ipconfig info message as one printk

login
register
mail settings
Submitter Micha Nelissen
Date May 14, 2011, 9:45 p.m.
Message ID <1305409519-25404-1-git-send-email-micha@neli.hopto.org>
Download mbox | patch
Permalink /patch/95587/
State Rejected
Delegated to: David Miller
Headers show

Comments

Micha Nelissen - May 14, 2011, 9:45 p.m.
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.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - May 16, 2011, 6 p.m.
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Micha Nelissen - May 16, 2011, 6:12 p.m.
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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;