All of lore.kernel.org
 help / color / mirror / Atom feed
From: amosbird@gmail.com (Amos Bird)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Trying to export per process network bandwidth stats under /proc/[pid]/
Date: Sat, 14 Jul 2018 11:24:23 +0800	[thread overview]
Message-ID: <87in5iwlco.fsf@gmail.com> (raw)

Hello!

I'm trying to add a proc entry under /proc/[pid] in order to get 
per process network bandwidth stats. I suppose it's similar to 
/proc/[pid]/io . However I couldn't find a modular way to add 
entries under /proc/[pid]. This thread 
https://lists.kernelnewbies.org/pipermail/kernelnewbies/2011-January/000475.html 
suggests modifying the kernel which isn't practical to me. Here is 
what I've found by going through a bit of the related kernel code.

1. I need to find a way to override or hooking 
`sock_sendmsg`/`sock_recvmsg` functions with accounting variables 
like `task_io_accounting`
2. a way to add proc entries under /proc/[pid] with readops 
printing `current` netio accounting variables.

Am I on the right path of implementing this? Thanks!

--
Amos Bird
amosbird at gmail.com

             reply	other threads:[~2018-07-14  3:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-14  3:24 Amos Bird [this message]
2018-07-14  6:41 ` Trying to export per process network bandwidth stats under /proc/[pid]/ Greg KH

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=87in5iwlco.fsf@gmail.com \
    --to=amosbird@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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.