linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>
Cc: linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: [PATCH perf/core] perf intel-pt: Fix clang build failure in intel_pt_synth_pebs_sample
Date: Wed, 13 May 2020 18:47:38 -0500	[thread overview]
Message-ID: <20200513234738.GA21211@embeddedor> (raw)

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


             reply	other threads:[~2020-05-13 23:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 23:47 Gustavo A. R. Silva [this message]
2020-05-14  0:56 ` [PATCH perf/core] perf intel-pt: Fix clang build failure in intel_pt_synth_pebs_sample 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

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=20200513234738.GA21211@embeddedor \
    --to=gustavoars@kernel.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=gustavo@embeddedor.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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).