Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1584841 > unrolled thread

[PATCH 04/18] perf session: Fix DEBUG=1 build with clang

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2017-02-20 20:20 +0100
Last post2017-02-20 20:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 04/18] perf session: Fix DEBUG=1 build with clang Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-20 20:20 +0100

#1584841 — [PATCH 04/18] perf session: Fix DEBUG=1 build with clang

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-02-20 20:20 +0100
Subject[PATCH 04/18] perf session: Fix DEBUG=1 build with clang
Message-ID<td1F7-h6-9@gated-at.bofh.it>
From: Arnaldo Carvalho de Melo <acme@redhat.com>

The struct branch_stack->branch_stack.cycles field is a u64 :16
bitfield, and this somehow confuses clang 4.0 when checking the
arguments of a printf format, so cast the :16 to unsigned short to help
it.

Silences this:

  util/session.c:935:4: error: format specifies type 'unsigned short' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat]
                          e->flags.cycles,
                          ^~~~~~~~~~~~~~~
  1 error generated.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-eo2t4uhlbne105z72tvyzkp1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/session.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 4cdbc8f5f14d..1dd617d116b5 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -932,7 +932,7 @@ static void branch_stack__printf(struct perf_sample *sample)
 
 		printf("..... %2"PRIu64": %016" PRIx64 " -> %016" PRIx64 " %hu cycles %s%s%s%s %x\n",
 			i, e->from, e->to,
-			e->flags.cycles,
+			(unsigned short)e->flags.cycles,
 			e->flags.mispred ? "M" : " ",
 			e->flags.predicted ? "P" : " ",
 			e->flags.abort ? "A" : " ",
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web