All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ferron <chris.e.ferron at linux.intel.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] devices: Fix processing /proc/net/dev file
Date: Mon, 15 Oct 2012 09:22:45 -0700	[thread overview]
Message-ID: <507C3855.5090401@linux.intel.com> (raw)
In-Reply-To: 1350311616-9770-1-git-send-email-namhyung@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

On 10/15/2012 07:33 AM, Namhyung Kim wrote:
> The do_proc_net_dev() reads the /proc/net/dev file and counts tx/rx
> packets for each interface.  However index for rx packet (1) is not
> match to the file:
>
> $ cat /proc/net/dev
> Inter-|   Receive                                                |  Transmit
>   face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
>         (1)      (2)     (3)  (4)  (5)  (6)   (7)        (8)       (9)      (10)    (11) (12) (13) (14)  (15)    (16)
>
> Change the index to 2 to match to the number of receive packets.
>
> Signed-off-by: Namhyung Kim <namhyung(a)gmail.com>
> ---
>   src/devices/network.cpp |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/devices/network.cpp b/src/devices/network.cpp
> index b8a5c9c..3b67610 100644
> --- a/src/devices/network.cpp
> +++ b/src/devices/network.cpp
> @@ -114,7 +114,7 @@ static void do_proc_net_dev(void)
>   			c2 = c;
>   			val = strtoull(c, &c, 10);
>   			i++;
> -			if (i == 1 || i == 10)
> +			if (i == 2 || i == 10)
>   				pkt += val;
>   
>   		}
Your patch has been merged
Thank You
-C


             reply	other threads:[~2012-10-15 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 16:22 Chris Ferron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-15 14:59 [Powertop] [PATCH] devices: Fix processing /proc/net/dev file Sergey Senozhatsky
2012-10-15 14:56 Namhyung Kim
2012-10-15 14:47 Sergey Senozhatsky
2012-10-15 14:33 Namhyung Kim

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=507C3855.5090401@linux.intel.com \
    --to=powertop@lists.01.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 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.