aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <hawk@comx.dk>2010-01-05 00:50:52 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-07 03:59:10 -0500
commit2d13bafeba24f732e89b818b8c66b07893457570 (patch)
tree1d036907574b299b573729d809b528dc69634660 /net
parent65324144b50bc7022cc9b6ca8f4a536a957019e3 (diff)
net: Make it easier to parse /proc/net/dev contents.
The contents of /proc/net/dev is annoying to parse, because it changes whether there is a space after the "ethX:" or not. It depends upon the size of the "Receive bytes" counter, if the number is below 7 digits, then there is whitespaces else if the number is 8 digits or above there is no space between the ":" and the number. This patch changes the output to assure there is always a space between the ":" and the number. Given that all existing userspace application already need to handle the whitespaces, I see no breakage of existing tools. Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d9ab9be0c323..a008f6987a95 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3206,7 +3206,7 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
3206{ 3206{
3207 const struct net_device_stats *stats = dev_get_stats(dev); 3207 const struct net_device_stats *stats = dev_get_stats(dev);
3208 3208
3209 seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu " 3209 seq_printf(seq, "%6s: %7lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
3210 "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n", 3210 "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
3211 dev->name, stats->rx_bytes, stats->rx_packets, 3211 dev->name, stats->rx_bytes, stats->rx_packets,
3212 stats->rx_errors, 3212 stats->rx_errors,