linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH perf/core] perf intel-pt: Fix clang build failure in intel_pt_synth_pebs_sample
@ 2020-05-13 23:47 Gustavo A. R. Silva
  2020-05-14  0:56 ` Ian Rogers
  2020-05-14 13:10 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 16+ messages in thread
From: Gustavo A. R. Silva @ 2020-05-13 23:47 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers
  Cc: linux-kernel, Gustavo A. R. Silva

Fix the following build failure generated with command 
$ make CC=clang HOSTCC=clang -C tools/ perf:

util/intel-pt.c:1802:24: error: field 'br_stack' with variable sized type 'struct branch_stack' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
                        struct branch_stack br_stack;
                                            ^
1 error generated.

Fix this by reordering the members of struct br.

Clang version 11.0.0 was used.

Fixes: f283f293a60d ("perf tools: Replace zero-length array with flexible-array")
Reported-by: Ian Rogers <irogers@google.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Here to fix what I break. :)

 tools/perf/util/intel-pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index f17b1e769ae4..b34179e3926f 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1799,8 +1799,8 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq)
 
 	if (sample_type & PERF_SAMPLE_BRANCH_STACK) {
 		struct {
-			struct branch_stack br_stack;
 			struct branch_entry entries[LBRS_MAX];
+			struct branch_stack br_stack;
 		} br;
 
 		if (items->mask[INTEL_PT_LBR_0_POS] ||
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-05-20  1:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 23:47 [PATCH perf/core] perf intel-pt: Fix clang build failure in intel_pt_synth_pebs_sample Gustavo A. R. Silva
2020-05-14  0:56 ` Ian Rogers
2020-05-14 13:10 ` Arnaldo Carvalho de Melo
2020-05-14 15:06   ` Gustavo A. R. Silva
2020-05-14 19:06     ` Ian Rogers
2020-05-14 22:09       ` Gustavo A. R. Silva
2020-05-14 22:46         ` Ian Rogers
2020-05-15  0:10           ` Gustavo A. R. Silva
2020-05-15  0:09             ` Ian Rogers
2020-05-15  0:29               ` Gustavo A. R. Silva
2020-05-15 16:41             ` Arnaldo Carvalho de Melo
2020-05-15 16:43               ` Arnaldo Carvalho de Melo
2020-05-15 17:09                 ` Gustavo A. R. Silva
2020-05-16 12:35               ` Adrian Hunter
2020-05-19 19:12                 ` Gustavo A. R. Silva
2020-05-20  1:42                 ` Arnaldo Carvalho de Melo

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).