From: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
To: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
ast@fb.com, lkml <linux-kernel@vger.kernel.org>,
acme@kernel.org, alexander.shishkin@linux.intel.com,
mingo@redhat.com, sargun@sargun.me,
Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
daniel@iogearbox.net
Subject: Re: [PATCH 1/2] perf: add container identifier entry in perf sample data
Date: Fri, 26 Aug 2016 09:35:02 +0530 [thread overview]
Message-ID: <20160826040502.GD29746@in.ibm.com> (raw)
In-Reply-To: <de5c94bf-ac4b-877d-1cb7-d938c0ed9b1b@linux.vnet.ibm.com>
On Thu, Aug 25, 2016 at 10:50:18PM +0530, Hari Bathini wrote:
>
>
> On Thursday 25 August 2016 06:31 PM, Peter Zijlstra wrote:
> >On Thu, Aug 25, 2016 at 05:27:54PM +0530, Hari Bathini wrote:
> >
> >>diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> >>index c66a485..fb4f902 100644
> >>--- a/include/uapi/linux/perf_event.h
> >>+++ b/include/uapi/linux/perf_event.h
> >>@@ -139,8 +139,9 @@ enum perf_event_sample_format {
> >> PERF_SAMPLE_IDENTIFIER = 1U << 16,
> >> PERF_SAMPLE_TRANSACTION = 1U << 17,
> >> PERF_SAMPLE_REGS_INTR = 1U << 18,
> >>+ PERF_SAMPLE_CID = 1U << 19,
> >>- PERF_SAMPLE_MAX = 1U << 19, /* non-ABI */
> >>+ PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */
> >> };
> >This forgets to update the comment that goes with PERF_RECORD_SAMPLE.
> >This patch would also need an update to the manpage:
> >
> > http://git.kernel.org/cgit/docs/man-pages/man-pages.git/tree/man2/perf_event_open.2
> >
> > http://www.man7.org/linux/man-pages/man2/perf_event_open.2.html
> >
> >>+ if (sample_type & PERF_SAMPLE_CID) {
> >>+ int size = sizeof(u64);
> >>+
> >>+ /*
> >>+ * Container identifier for a given task.
> >>+ * Using cgroup namespace inode number for this.
> >>+ */
> >>+ data->cid_entry.cid = current->nsproxy->cgroup_ns->ns.inum;
> >>+ data->cid_entry.reserved = 0;
> >>+ header->size += size;
> >>+ }
> >> }
> >Does this compile with CONFIG_CGROUP=n ?
> >
>
> My bad. Will update..
> Actually, on second thought, how about using inode number of some
> other namespace that any container would have (mount, probably?)..
I am not sure about every implementation of 'containers' but I would
think that the cgroup namespace is the right choice here. Mount
namespaces can be potentially shared between containers AFAIK.
Ananth
prev parent reply other threads:[~2016-08-26 4:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 11:57 [PATCH 1/2] perf: add container identifier entry in perf sample data Hari Bathini
2016-08-25 11:58 ` [PATCH 2/2] perf tool: add container identifier entry related changes Hari Bathini
2016-08-25 13:04 ` Peter Zijlstra
2016-08-25 17:22 ` Hari Bathini
2016-08-25 13:01 ` [PATCH 1/2] perf: add container identifier entry in perf sample data Peter Zijlstra
2016-08-25 17:20 ` Hari Bathini
2016-08-25 17:31 ` Peter Zijlstra
2016-08-26 4:05 ` Ananth N Mavinakayanahalli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160826040502.GD29746@in.ibm.com \
--to=ananth@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=aravinda@linux.vnet.ibm.com \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=hbathini@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=sargun@sargun.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox