Messages in this thread | | | From | (Eric W. Biederman) | Date | Tue, 13 Dec 2016 11:06:07 +1300 | Subject | Re: [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
| |