public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Keika Kobayashi <kobayashi.kk@ncos.nec.co.jp>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	h-shimamoto@ct.jp.nec.com
Subject: Re: [PATCH 2/3 v2] proc: Export statistics for softirq to /proc
Date: Sat, 22 Nov 2008 12:36:31 +0100	[thread overview]
Message-ID: <4927EEBF.1060207@cosmosbay.com> (raw)
In-Reply-To: <20081121202708.95ec8b3f.kobayashi.kk@ncos.nec.co.jp>

Keika Kobayashi a écrit :
> Export statistics for softirq in /proc/softirqs and /proc/stat.
> 
> 1. /proc/softirqs
> Implement /proc/softirqs which shows the number of softirq
> for each CPU like /proc/interrupts.
> 
> 2. /proc/stat
> Add the "softirq" line to /proc/stat.
> This line shows the number of softirq for all cpu.
> The first column is the total of all softirqs and
> each subsequent column is the total for particular softirq.
> 
> Signed-off-by: Keika Kobayashi <kobayashi.kk@ncos.nec.co.jp>
> Reviewed-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> ---
>  fs/proc/Makefile   |    1 +
>  fs/proc/softirqs.c |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  fs/proc/stat.c     |   17 +++++++++++++++
>  3 files changed, 75 insertions(+), 0 deletions(-)
>  create mode 100644 fs/proc/softirqs.c
> 
> diff --git a/fs/proc/Makefile b/fs/proc/Makefile
> index 63d9651..11a7b5c 100644
> --- a/fs/proc/Makefile
> +++ b/fs/proc/Makefile
> @@ -18,6 +18,7 @@ proc-y	+= meminfo.o
>  proc-y	+= stat.o
>  proc-y	+= uptime.o
>  proc-y	+= version.o
> +proc-y	+= softirqs.o
>  proc-$(CONFIG_PROC_SYSCTL)	+= proc_sysctl.o
>  proc-$(CONFIG_NET)		+= proc_net.o
>  proc-$(CONFIG_PROC_KCORE)	+= kcore.o
> diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c
> new file mode 100644
> index 0000000..543f9d9
> --- /dev/null
> +++ b/fs/proc/softirqs.c
> @@ -0,0 +1,57 @@
> +#include <linux/init.h>
> +#include <linux/kernel_stat.h>
> +#include <linux/proc_fs.h>
> +#include <linux/seq_file.h>
> +
> +static const char *desc_array[] = {
> +	"HI",
> +	"TIMER",
> +	"NET_TX",
> +	"NET_RX",
> +	"BLOCK",
> +	"TASKLET",
> +	"SCHED",
> +#ifdef CONFIG_HIGH_RES_TIMERS
> +	"HRTIMER",
> +#endif
> +	"RCU"};
> +


You could use C99 initializers here

[HI_SOFTIRQ] = "HI",
[TIMER_SOFTIRQ] = "TIMER",
...


  reply	other threads:[~2008-11-22 11:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22  4:22 [PATCH 0/3 v2] softirq: Statistics for softirq Keika Kobayashi
2008-11-22  4:25 ` [PATCH 1/3 v2] softirq: Introduce statistics " Keika Kobayashi
2008-11-22  5:36   ` KOSAKI Motohiro
2008-11-24 23:46     ` Keika Kobayashi
2008-11-26 10:14       ` KOSAKI Motohiro
2008-11-22  4:27 ` [PATCH 2/3 v2] proc: Export statistics for softirq to /proc Keika Kobayashi
2008-11-22 11:36   ` Eric Dumazet [this message]
2008-11-26 10:10   ` KOSAKI Motohiro
2009-01-09 22:16     ` Andrew Morton
2009-01-10 18:22       ` kobayashi.kk
2009-01-10 19:44         ` KOSAKI Motohiro
2009-01-12 11:46           ` KOSAKI Motohiro
2009-01-12 23:53             ` kobayashi.kk
2008-11-22  4:28 ` [PATCH 3/3 v2] proc: Update document for /proc/softirqs and /proc/stat Keika Kobayashi
2008-11-26 10:11   ` KOSAKI Motohiro

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=4927EEBF.1060207@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@linux-foundation.org \
    --cc=h-shimamoto@ct.jp.nec.com \
    --cc=kobayashi.kk@ncos.nec.co.jp \
    --cc=linux-kernel@vger.kernel.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