Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1540694

Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report

From ebiederm@xmission.com (Eric W. Biederman)
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report
Date 2016-12-12 23:10 +0100
Message-ID <sNGXf-1pE-15@gated-at.bofh.it> (permalink)
References <sNDwm-7Ir-13@gated-at.bofh.it> <sNDwm-7Ir-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] perf: add support for analyzing events for containers Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-12 19:30 +0100
  [PATCH v3 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-12 19:30 +0100
    Re: [PATCH v3 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-12 23:00 +0100
  [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-12 19:30 +0100
    Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report ebiederm@xmission.com (Eric W. Biederman) - 2016-12-12 23:10 +0100
      Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf  report Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-13 20:10 +0100
        Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report ebiederm@xmission.com (Eric W. Biederman) - 2016-12-13 21:10 +0100
          Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf  report Peter Zijlstra <peterz@infradead.org> - 2016-12-14 12:00 +0100
            Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf  report Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-14 18:10 +0100
            Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report ebiederm@xmission.com (Eric W. Biederman) - 2016-12-14 18:30 +0100
  [PATCH v3 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-12 19:30 +0100
    Re: [PATCH v3 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-12 19:40 +0100
      Re: [PATCH v3 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-13 19:50 +0100
        Re: [PATCH v3 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-13 21:10 +0100

csiph-web