mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Zhao Lei <zhaolei@cn.fujitsu.com>
Subject: [PATCH v4 0/3] cpuacct: Introduce cpuacct.usage_all to show all cpu stats together(was: [PATCH v2 0/3] cpuacct: Show all detail stats in one file)
Date: Mon, 20 Jun 2016 17:37:17 +0800	[thread overview]
Message-ID: <cover.1466415271.git.zhaolei@cn.fujitsu.com> (raw)

In current code, we can get cpuacct data from several files,
but each file have its limit.

For example:
we can get cpu usage in user and kernel mode by cpuacct.stat,
but we can't get detail data of each cpu in above file.
we can get each cpu's kernel mode usage in cpuacct.usage_percpu_sys,
but we can't get user mode data in the same time.

This patch introduce cpuacct.usage_all, to show all detailed
cpu accounting data altogether:
 # cat cpuacct.usage_all
 cpu user system
 0 3809760299 5807968992
 1 3250329855 454612211
 ..

Any aspects of statistics data can be get from this file
with a simple data-processing code.

Changelog v3->v4:
 1: Rebase on top of 4.7-rc4

Changelog v2->v3:
 1: Change title of PATCH 3/3 from:
    cpuacct: Show all detail stats in one file
    to
    cpuacct: Introduce cpuacct.usage_all to show all cpu stats together
 2: Fix spelling typos in patch's description.
 Suggested by: Ingo Molnar <mingo.kernel.org@gmail.com>

Changelog v1->v2:
 1: Rewrite subject in PATCH 1/3 and 2/3 to fix typos and
    make it more accurate.
 2: Use a variable for the cpustat array itself to make
    code clean(avoid lot of 'kcpustat->').
 3: Add missed newline between variable definitions and
    the first non-definition C statement.
 Above are suggested by: Ingo Molnar <mingo.kernel.org@gmail.com>
 4: Remove '[]' in CPUID, to make it easier to parse.
 Suggested by: Peter Zijlstra <peterz@infradead.org>

Zhao Lei (3):
  cpuacct: Merge cpuacct_usage_index and cpuacct_stat_index
  cpuacct: Use loop to avoid copies of the similar code in
    cpuacct_stats_show()
  cpuacct: Introduce cpuacct.usage_all to show all cpu stats together

 kernel/sched/cpuacct.c | 114 +++++++++++++++++++++++++++++++------------------
 1 file changed, 73 insertions(+), 41 deletions(-)

-- 
1.8.5.1

             reply	other threads:[~2016-06-20  9:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  9:37 Zhao Lei [this message]
2016-06-20  9:37 ` [PATCH v4 1/3] cpuacct: Merge cpuacct_usage_index and cpuacct_stat_index Zhao Lei
2016-07-09 17:52   ` [tip:sched/core] sched/cpuacct: Merge cpuacct_usage_index and cpuacct_stat_index enums tip-bot for Zhao Lei
2016-06-20  9:37 ` [PATCH v4 2/3] cpuacct: Use loop to avoid copies of the similar code in cpuacct_stats_show() Zhao Lei
2016-07-09 17:53   ` [tip:sched/core] sched/cpuacct: Use loop to consolidate " tip-bot for Zhao Lei
2016-06-20  9:37 ` [PATCH v4 3/3] cpuacct: Introduce cpuacct.usage_all to show all cpu stats together Zhao Lei
2016-07-09 17:53   ` [tip:sched/core] sched/cpuacct: Introduce cpuacct.usage_all to show all CPU " tip-bot for Zhao Lei

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=cover.1466415271.git.zhaolei@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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

Powered by JetHome