[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170314142949.GA12825@kernel.org>
Date: Tue, 14 Mar 2017 11:29:49 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Hari Bathini <hbathini@...ux.vnet.ibm.com>
Cc: ast@...com, peterz@...radead.org,
lkml <linux-kernel@...r.kernel.org>,
alexander.shishkin@...ux.intel.com, mingo@...hat.com,
daniel@...earbox.net, rostedt@...dmis.org,
Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
ebiederm@...ssion.com, sargun@...gun.me,
Aravinda Prasad <aravinda@...ux.vnet.ibm.com>,
brendan.d.gregg@...il.com, jolsa@...hat.com
Subject: Re: [PATCH v8 4/6] perf tools: Add print support for namespace events
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
Powered by blists - more mailing lists