netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Phil Sutter <phil@nwl.cc>, Stephen Hemminger <shemming@brocade.com>
Cc: netdev@vger.kernel.org
Subject: Re: [iproute PATCH v2] ip{,6}tunnel: have a shared stats parser/printer
Date: Mon, 21 Dec 2015 12:00:06 +0100	[thread overview]
Message-ID: <5677DBB6.3070008@iogearbox.net> (raw)
In-Reply-To: <1450436286-14882-1-git-send-email-phil@nwl.cc>

On 12/18/2015 11:58 AM, Phil Sutter wrote:
> This has a slight side-effect of not aborting when /proc/net/dev is
> malformed, but OTOH stats are not parsed for uninteresting interfaces.
>
> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
> Changes since v1:
> - Fix conflict resolution (sscan from 'buf' instead of 'ptr').
[...]

Hmm, did you actually compile that?

The code is still the same as in v1 ... the only thing added is the "Changes since v1"
description. ;)

[...]
> +void tnl_print_stats(const char *buf)
> +{
> +	unsigned long rx_bytes, rx_packets, rx_errs, rx_drops,
> +		      rx_fifo, rx_frame,
> +		      tx_bytes, tx_packets, tx_errs, tx_drops,
> +		      tx_fifo, tx_colls, tx_carrier, rx_multi;
> +
> +	if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",

   s/ptr/buf/

> +	           &rx_bytes, &rx_packets, &rx_errs, &rx_drops,
> +	           &rx_fifo, &rx_frame, &rx_multi,
> +	           &tx_bytes, &tx_packets, &tx_errs, &tx_drops,
> +	           &tx_fifo, &tx_colls, &tx_carrier) != 14)
> +		return;
> +
> +	printf("%s", _SL_);
> +	printf("RX: Packets    Bytes        Errors CsumErrs OutOfSeq Mcasts%s", _SL_);
> +	printf("    %-10ld %-12ld %-6ld %-8ld %-8ld %-8ld%s",
> +	       rx_packets, rx_bytes, rx_errs, rx_frame, rx_fifo, rx_multi, _SL_);
> +	printf("TX: Packets    Bytes        Errors DeadLoop NoRoute  NoBufs%s", _SL_);
> +	printf("    %-10ld %-12ld %-6ld %-8ld %-8ld %-6ld",
> +	       tx_packets, tx_bytes, tx_errs, tx_colls, tx_carrier, tx_drops);
> +}

tunnel.c: In function ‘tnl_print_stats’:
tunnel.c:211:13: error: ‘buff’ undeclared (first use in this function)
   if (sscanf(buff, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
              ^
tunnel.c:211:13: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [tunnel.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

  parent reply	other threads:[~2015-12-21 11:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 12:23 [iproute PATCH] ip{,6}tunnel: have a shared stats parser/printer Phil Sutter
2015-12-18  1:14 ` Stephen Hemminger
2015-12-18 10:52   ` Phil Sutter
2015-12-18 10:58     ` [iproute PATCH v2] " Phil Sutter
2015-12-18 19:47       ` Stephen Hemminger
2015-12-21 11:00       ` Daniel Borkmann [this message]
2015-12-21 19:36         ` Phil Sutter
2015-12-21 19:42         ` [iproute PATCH] iptunnel: Fix compile error in ip/tunnel.c Phil Sutter
2015-12-22  5:34           ` Stephen Hemminger

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=5677DBB6.3070008@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=shemming@brocade.com \
    /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).