public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: Matthew Hall <mh@mhcomputing•net>
Cc: netdev@vger•kernel.org
Subject: Re: per-PID network stats files in /proc
Date: Tue, 24 Sep 2013 13:41:57 -0700	[thread overview]
Message-ID: <20130924134157.4fc22806@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20130924201536.GA3555@mhcomputing.net>

On Tue, 24 Sep 2013 13:15:37 -0700
Matthew Hall <mh@mhcomputing•net> wrote:

> Hello,
> 
> I have an application that I'd like to make self-tuning, based upon the values 
> of some of the network stats counters. Thus I went reading through a copy of 
> linux-3.11.1 to look for some more information, and began exploring procfs as 
> well.
> 
> I discovered some system-wide counters in /proc/net/snmp which are pretty 
> interesting so I was trying to use the per-PID counters in 
> /proc/net/PID/net/snmp as well.
> 
> Unfortunately I found that all of these files seem to be identical on my own 
> system running Linux 3.2.0:
> 
> $ md5sum /proc/net/snmp /proc/1/net/snmp /proc/2/net/snmp
> 8b92b426f860d0667a780cd8baabb7bf  /proc/net/snmp
> 8b92b426f860d0667a780cd8baabb7bf  /proc/1/net/snmp
> 8b92b426f860d0667a780cd8baabb7bf  /proc/2/net/snmp
> 
> I found the snmp_seq_show function in net/ipv4/proc.c which prints these 
> statistics to see how it really worked, but then I was having a hard time 
> finding out what's really calling this code since it hooks up to the /proc 
> framework.
> 
> Is there some option one can change which enables gathering the network 
> statistics per-PID, or per-socket? This would be a tremendous help for my 
> application.
> 
> Thanks,
> Matthew.

No. because most of these would be associated with global state.
Even sockets can be shared between PID's.

  reply	other threads:[~2013-09-24 20:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 20:15 per-PID network stats files in /proc Matthew Hall
2013-09-24 20:41 ` Stephen Hemminger [this message]
2013-09-24 20:44   ` Matthew Hall
2013-09-24 21:02     ` Eric Dumazet
2013-09-24 21:04     ` Stephen Hemminger
2013-09-24 21:22       ` Matthew Hall
2013-09-26 20:12         ` Matthew Hall

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=20130924134157.4fc22806@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber$(echo .)org \
    --cc=mh@mhcomputing$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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