lkml.org 
[lkml]   [2016]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report
Hari Bathini <hbathini@linux.vnet.ibm.com> writes:

> This patch introduces a cgroup identifier entry field in perf report to
> identify or distinguish data of different cgroups. It uses the unique
> inode number of cgroup namespace, included in perf data with the new
> PERF_RECORD_NAMESPACES event, as cgroup identifier. With the assumption
> that each container is created with it's own cgroup namespace, this
> allows assessment/analysis of multiple containers at once.

In the large this sounds reasonable.

The details are wrong. The cgroup id needs to be device
number + inode number, not just inode number.

Eric

> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
> ---
> tools/perf/util/hist.c | 4 ++++
> tools/perf/util/hist.h | 1 +
> tools/perf/util/sort.c | 22 ++++++++++++++++++++++
> tools/perf/util/sort.h | 2 ++
> 4 files changed, 29 insertions(+)
>
> diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> @@ -573,9 +575,11 @@ __hists__add_entry(struct hists *hists,
> bool sample_self,
> struct hist_entry_ops *ops)
> {
> + struct namespaces *ns = thread__namespaces(al->thread);
> struct hist_entry entry = {
> .thread = al->thread,
> .comm = thread__comm(al->thread),
> + .cgroup_id = ns ? ns->inode_num[CGROUP_NS_INDEX] : 0,
> .ms = {
> .map = al->map,
> .sym = al->sym,

Eric

\
 
 \ /
  Last update: 2016-12-12 23:09    [W:0.129 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site