Re: [PATCH v6 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info

From: Jiri Olsa
Date: Wed Feb 08 2017 - 08:08:58 EST


On Wed, Feb 08, 2017 at 02:01:49PM +0530, Hari Bathini wrote:

SNIP

> +size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp)
> +{
> + size_t ret = 0;
> + struct perf_ns_link_info *ns_link_info;
> + u32 nr_namespaces, idx;
> +
> + ns_link_info = event->namespaces.link_info;
> + nr_namespaces = event->namespaces.nr_namespaces;
> +
> + ret += fprintf(fp, " %d/%d - nr_namespaces: %u [",
> + event->namespaces.pid,
> + event->namespaces.tid,
> + nr_namespaces);
> +
> + for (idx = 0; idx < nr_namespaces; idx++)
> + ret += fprintf(fp, "%s: %lu/0x%lx%s", ns_link_info[idx].name,
> + (u64)ns_link_info[idx].dev,
> + (u64)ns_link_info[idx].ino,
> + ((idx + 1) != nr_namespaces) ? ", " : "]\n\n");

could you please shape the output the same way we do
for other events, currently you display namespaces like:

0 0x1848 [0xd0]: PERF_RECORD_NAMESPACES 3006/3006 - nr_namespaces: 7 [net: 3/0xf0000081, uts: 3/0xeffffffe, ipc: 3/0xefffffff, pid: 3/0xeffffffc, user: 3/0xeffffffd, mnt: 3/0xf0000000, cgroup: 3/0xeffffffb]

it also screws the less output of perf report -D for me..

usually we do multiple lines output, like:

1941502405539 0x1f48 [0x28]: PERF_RECORD_SAMPLE(IP, 0x2): 3006/3006: 0x55d47fdf2436 period: 422589 addr: 0
... thread: ls:3006
...... dso: /usr/bin/ls


thanks,
jirka