[lkml]   [2016]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info
Hari Bathini <> writes:

> This patch updates perf tool to examine PERF_RECORD_NAMESPACES events
> emitted by the kernel when fork, clone, setns or unshare are invoked.
> Also, it synthesizes PERF_RECORD_NAMESPACES events for processes that
> were running prior to invocation of perf record, the data for which
> is taken from /proc/$PID/ns. These changes make way for analyzing
> events with regard to namespaces.

> diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
> index 8d363d5..a73bc8e 100644
> --- a/tools/perf/util/event.h
> +++ b/tools/perf/util/event.h
> @@ -39,6 +39,13 @@ struct comm_event {
> char comm[16];
> };
> +struct namespaces_event {
> + struct perf_event_header header;
> + u32 pid, tid;
> + u64 dev_num;
> + u64 inode_num[NAMESPACES_MAX];
> +};

This suffers from the same issue I pointed out with the
kernel interface. We need one device number per inode.
Today we only have one device number but that may change in
the future. These are st_dev and st_inode from stat, and
you need both of them per namespace to be unique.

I do not want to get into a situation where I have to implement a
namespace of namespaces in the future.


 \ /
  Last update: 2016-12-12 22:55    [W:0.084 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site