lkml.org 
[lkml]   [2019]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/9] perf/core: Add PERF_RECORD_CGROUP event
On Fri, Dec 20, 2019 at 10:33:35AM +0100, Peter Zijlstra wrote:
> On Fri, Dec 20, 2019 at 01:32:45PM +0900, Namhyung Kim wrote:
> > To support cgroup tracking, add CGROUP event to save a link between
> > cgroup path and inode number. The attr.cgroup bit was also added to
> > enable cgroup tracking from userspace.
> >
> > This event will be generated when a new cgroup becomes active.
> > Userspace might need to synthesize those events for existing cgroups.
> >
> > Cc: Tejun Heo <tj@kernel.org>
> > Cc: Li Zefan <lizefan@huawei.com>
> > Cc: Johannes Weiner <hannes@cmpxchg.org>
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>
> TJ, is this the right thing to do? ISTR you had concerns on this topic
> on the past.

Yeah, cgroup->id is now the same as ino (on 64bit ino matchines) and
fhandle and uniquely identifies a cgroup instance in that boot
instance. That said, id -> path mapping can be done from userspace by
passing the cgroup id to open_by_handle_at(2) and then reading the
symlink in /proc/self/fd, so this event isn't necessary per-se if the
goal is mapping back ids to paths.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2019-12-20 16:16    [W:0.058 / U:11.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site