From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753071AbcLLWJN (ORCPT ); Mon, 12 Dec 2016 17:09:13 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:43097 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751713AbcLLWJM (ORCPT ); Mon, 12 Dec 2016 17:09:12 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Hari Bathini Cc: ast@fb.com, peterz@infradead.org, lkml , acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, daniel@iogearbox.net, rostedt@goodmis.org, Ananth N Mavinakayanahalli , sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com References: <148156671980.4651.13017595439842763683.stgit@hbathini.in.ibm.com> <148156680219.4651.12310355352884515738.stgit@hbathini.in.ibm.com> Date: Tue, 13 Dec 2016 11:06:07 +1300 In-Reply-To: <148156680219.4651.12310355352884515738.stgit@hbathini.in.ibm.com> (Hari Bathini's message of "Mon, 12 Dec 2016 23:50:08 +0530") Message-ID: <878trkajlc.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1cGYmT-000269-P7;;;mid=<878trkajlc.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=101.100.131.98;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18k57zY7PB2s5SnfRNALJy/7tlnc5315lI= X-SA-Exim-Connect-IP: 101.100.131.98 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4998] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Hari Bathini X-Spam-Relay-Country: X-Spam-Timing: total 763 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 3.3 (0.4%), b_tie_ro: 2.3 (0.3%), parse: 1.20 (0.2%), extract_message_metadata: 4.5 (0.6%), get_uri_detail_list: 1.89 (0.2%), tests_pri_-1000: 18 (2.4%), tests_pri_-950: 2.1 (0.3%), tests_pri_-900: 1.64 (0.2%), tests_pri_-400: 72 (9.4%), check_bayes: 70 (9.2%), b_tokenize: 14 (1.8%), b_tok_get_all: 15 (2.0%), b_comp_prob: 14 (1.8%), b_tok_touch_all: 3.7 (0.5%), b_finish: 8 (1.0%), tests_pri_0: 595 (78.0%), check_dkim_signature: 1.58 (0.2%), check_dkim_adsp: 5 (0.7%), tests_pri_500: 22 (2.9%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hari Bathini 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 > --- > 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