linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: ast@fb.com, peterz@infradead.org,
	lkml <linux-kernel@vger.kernel.org>,
	alexander.shishkin@linux.intel.com, mingo@redhat.com,
	daniel@iogearbox.net, rostedt@goodmis.org,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	ebiederm@xmission.com, sargun@sargun.me,
	Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
	brendan.d.gregg@gmail.com, jolsa@redhat.com
Subject: Re: [PATCH v8 4/6] perf tools: Add print support for namespace events
Date: Tue, 14 Mar 2017 11:29:49 -0300	[thread overview]
Message-ID: <20170314142949.GA12825@kernel.org> (raw)
In-Reply-To: <148891931914.25309.9322505014996282758.stgit@hbathini.in.ibm.com>

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

  reply	other threads:[~2017-03-14 14:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 20:41 [PATCH v8 0/6] perf: Add support for analyzing events for containers Hari Bathini
2017-03-07 20:41 ` [PATCH v8 1/6] perf: Add PERF_RECORD_NAMESPACES to include namespaces related info Hari Bathini
2017-03-13 19:52   ` Arnaldo Carvalho de Melo
2017-03-15 18:39   ` [tip:perf/core] " tip-bot for Hari Bathini
2017-03-07 20:41 ` [PATCH v8 2/6] perf tools: " Hari Bathini
2017-03-15 18:39   ` [tip:perf/core] " tip-bot for Hari Bathini
2017-03-07 20:41 ` [PATCH v8 3/6] perf record: Synthesize namespace events for current processes Hari Bathini
2017-03-14 13:34   ` Arnaldo Carvalho de Melo
2017-03-15 18:40   ` [tip:perf/core] " tip-bot for Hari Bathini
2017-03-07 20:41 ` [PATCH v8 4/6] perf tools: Add print support for namespace events Hari Bathini
2017-03-14 14:29   ` Arnaldo Carvalho de Melo [this message]
2017-03-07 20:42 ` [PATCH v8 5/6] perf script: Add script " Hari Bathini
2017-03-15 18:40   ` [tip:perf/core] " tip-bot for Hari Bathini
2017-03-07 20:42 ` [PATCH v8 6/6] perf tools: Add cgroup identifier sort order keyword Hari Bathini
2017-03-15 18:41   ` [tip:perf/core] perf tools: Add 'cgroup_id' " tip-bot for Hari Bathini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170314142949.GA12825@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=ast@fb.com \
    --cc=brendan.d.gregg@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=ebiederm@xmission.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sargun@sargun.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).