Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751951AbdCNOau (ORCPT ); Tue, 14 Mar 2017 10:30:50 -0400 Received: from mail.kernel.org ([198.145.29.136]:45974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbdCNO3z (ORCPT ); Tue, 14 Mar 2017 10:29:55 -0400 Date: Tue, 14 Mar 2017 11:29:49 -0300 From: Arnaldo Carvalho de Melo To: Hari Bathini Cc: ast@fb.com, peterz@infradead.org, lkml , 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, jolsa@redhat.com Subject: Re: [PATCH v8 4/6] perf tools: Add print support for namespace events Message-ID: <20170314142949.GA12825@kernel.org> References: <148891921533.25309.8328657213311313206.stgit@hbathini.in.ibm.com> <148891931914.25309.9322505014996282758.stgit@hbathini.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <148891931914.25309.9322505014996282758.stgit@hbathini.in.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1587 Lines: 41 Em Wed, Mar 08, 2017 at 02:11:59AM +0530, Hari Bathini escreveu: > +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\n\t\t[", > + event->namespaces.pid, > + event->namespaces.tid, > + nr_namespaces); > + > + for (idx = 0; idx < nr_namespaces; idx++) { > + if (idx && (idx % 4 == 0)) > + ret += fprintf(fp, "\n\t\t "); > + > + ret += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx, > + perf_ns__name(idx), (u64)ns_link_info[idx].dev, > + (u64)ns_link_info[idx].ino, > + ((idx + 1) != nr_namespaces) ? ", " : "]\n"); Fails in some environments, such as debian:experimental-x-mipsel: CC /tmp/build/perf/util/evlist.o util/event.c: In function 'perf_event__fprintf_namespaces': util/event.c:1129:33: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'long long unsigned int' [-Werror=format=] ret += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx, ^ util/event.c:1129:39: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'long long unsigned int' [-Werror=format=] ret += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx, ^ CC /tmp/build/perf/builtin-list.o ------------------- Fixing this up to use PRIu64... - Arnaldo