From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 2/2] perf, tools: Remove use of BUILD_BUG_ON
Date: Mon, 17 Nov 2014 17:58:55 -0800 [thread overview]
Message-ID: <1416275935-20971-2-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1416275935-20971-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
BUILD_BUG_ON relies on the gcc optimizer, so it breaks
the build with DEBUG=1 which doesn't use -O2.
Turn the BUILD_BUG_ON into a runtime check again.
Also fix the check to check for 255, not 127.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/machine.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 5c4d7f8..a24909b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1446,8 +1446,7 @@ static int remove_loops(struct branch_entry *l, int nr)
memset(chash, NO_ENTRY, sizeof(chash));
- BUILD_BUG_ON_MSG(PERF_MAX_BRANCH_DEPTH > 127,
- "Please upgrade the type of the hash table from unsigned char");
+ BUG_ON(PERF_MAX_BRANCH_DEPTH > 255);
for (i = 0; i < nr; i++) {
int h = hash_64(l[i].from, CHASHBITS) % CHASHSZ;
--
1.9.3
next prev parent reply other threads:[~2014-11-18 1:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 1:58 [PATCH 1/2] perf, tools: In branch stack mode use address history sorting Andi Kleen
2014-11-18 1:58 ` Andi Kleen [this message]
2014-12-08 6:53 ` [tip:perf/core] perf report: " tip-bot for Andi Kleen
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=1416275935-20971-2-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®