netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roberto Nibali <ratz@drugphish.ch>
To: "LinuxVirtualServer.org users mailing list."
	<lvs-users@LinuxVirtualServer.org>
Cc: "David S. Miller" <davem@redhat.com>,
	netdev@oss.sgi.com, Wensong Zhang <wensong@linux-vs.org>
Subject: Re: [PATCH] ipvs -- print statistics in decimal.
Date: Tue, 16 Sep 2003 00:59:02 +0200	[thread overview]
Message-ID: <3F664436.6020709@drugphish.ch> (raw)
In-Reply-To: <20030915144154.26b9bad5.shemminger@osdl.org>

Stephen Hemminger wrote:
> Most of of us read decimal better than hex ;-)

While I agree with your comment this will seriously break existing user 
space applications, such as for example ipvsadm.

> Assumes earlier seq_file patch.
> diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
> --- a/net/ipv4/ipvs/ip_vs_ctl.c	Mon Sep 15 14:31:43 2003
> +++ b/net/ipv4/ipvs/ip_vs_ctl.c	Mon Sep 15 14:31:43 2003
> @@ -1716,22 +1716,22 @@
>  #ifdef CONFIG_PROC_FS
>  static int ip_vs_stats_show(struct seq_file *seq, void *v)
>  {
> +	static const char hfmt[]
> +		= "%10s %10s %10s %20s %20s\n";
>  
> -/*               01234567 01234567 01234567 0123456701234567 0123456701234567 */
> -	seq_puts(seq,
> -		 "   Total Incoming Outgoing         Incoming         Outgoing\n");
> -	seq_printf(seq, 	   
> -		   "   Conns  Packets  Packets            Bytes            Bytes\n");
> +	seq_printf(seq, hfmt, "Total", "Incoming", "Outgoing", 
> +		   "Incoming" ,"Outgoing");
> +	seq_printf(seq, hfmt, "Conns", "Packets","Packets","Bytes","Bytes");
>  
>  	spin_lock_bh(&ip_vs_stats.lock);
> -	seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns,
> +	seq_printf(seq, "%10u %10u %10u %20llu %20llu\n\n", 
> +		   ip_vs_stats.conns,
>  		   ip_vs_stats.inpkts, ip_vs_stats.outpkts,
>  		   ip_vs_stats.inbytes, ip_vs_stats.outbytes);

You break ipvsadm.

> -/*                 01234567 01234567 01234567 0123456701234567 0123456701234567 */
> -	seq_puts(seq,
> -		   " Conns/s   Pkts/s   Pkts/s          Bytes/s          Bytes/s\n");
> -	seq_printf(seq,"%8X %8X %8X %16X %16X\n",
> +	seq_printf(seq, hfmt, "Conns/s", "Pkts/s","Pkts/s", 
> +		   "Bytes/s","Bytes/s");
> +	seq_printf(seq,"%10u %10u %10u %20u %20u\n",
>  			ip_vs_stats.cps,
>  			ip_vs_stats.inpps,
>  			ip_vs_stats.outpps,

Ditto.

Best regards,
Roberto Nibali, ratz
-- 
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc

      reply	other threads:[~2003-09-15 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-15 21:41 [PATCH] ipvs -- print statistics in decimal Stephen Hemminger
2003-09-15 22:59 ` Roberto Nibali [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F664436.6020709@drugphish.ch \
    --to=ratz@drugphish.ch \
    --cc=davem@redhat.com \
    --cc=lvs-users@LinuxVirtualServer.org \
    --cc=netdev@oss.sgi.com \
    --cc=wensong@linux-vs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).