Skip to content

cpuacct: Introduce cpuacct.usage_all to show all cpu stats together(was: [PATCH v2 0/3] cpuacct: Show all detail stats in one file)

Zhao Lei lkml 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 0 repliesNew
  2. v33 patches 0 repliesSuperseded
  3. v23 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches3 repliesSuperseded

Changes in v4 from the cover letter

1: Rebase on top of 4.7-rc4

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cpuacct: Merge cpuacct_usage_index and cpuacct_stat_indexkernel/sched/cpuacct.c+20 -270 replies
2/3cpuacct: Use loop to avoid copies of the similar code in cpuacct_stats_show()kernel/sched/cpuacct.c+14 -150 replies
3/3cpuacct: Introduce cpuacct.usage_all to show all cpu stats togetherkernel/sched/cpuacct.c+40 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [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)

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 <[email protected]>

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 <[email protected]> 4: Remove '[]' in CPUID, to make it easier to parse. Suggested by: Peter Zijlstra <[email protected]>

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(-)
Signature · 1 line
1.8.5.1