[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 13 Dec 2016 11:06:07 +1300
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Hari Bathini <hbathini@...ux.vnet.ibm.com>
Cc: ast@...com, peterz@...radead.org,
lkml <linux-kernel@...r.kernel.org>, acme@...nel.org,
alexander.shishkin@...ux.intel.com, mingo@...hat.com,
daniel@...earbox.net, rostedt@...dmis.org,
Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
sargun@...gun.me, Aravinda Prasad <aravinda@...ux.vnet.ibm.com>,
brendan.d.gregg@...il.com
Subject: Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report
Hari Bathini <hbathini@...ux.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@...ux.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
Powered by blists - more mailing lists