From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932968AbdBHNI5 (ORCPT ); Wed, 8 Feb 2017 08:08:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59160 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754535AbdBHNIy (ORCPT ); Wed, 8 Feb 2017 08:08:54 -0500 Date: Wed, 8 Feb 2017 13:57:17 +0100 From: Jiri Olsa 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 , ebiederm@xmission.com, sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com Subject: Re: [PATCH v6 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info Message-ID: <20170208125717.GA22166@krava> References: <148654265580.27983.8822211570127163843.stgit@hbathini.in.ibm.com> <148654270963.27983.11333098688761605858.stgit@hbathini.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <148654270963.27983.11333098688761605858.stgit@hbathini.in.ibm.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 08 Feb 2017 12:57:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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