From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung.kim@lge.com>
Subject: [PATCH 2/8] tools include: Define likely/unlikely in linux/compiler.h
Date: Thu, 9 Jan 2014 23:00:53 +0900 [thread overview]
Message-ID: <1389276059-8829-3-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1389276059-8829-1-git-send-email-namhyung@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/include/linux/compiler.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 0135ccf2a00c..fbc6665c6d53 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -27,4 +27,12 @@
# define __weak __attribute__((weak))
#endif
+#ifndef likely
+# define likely(x) __builtin_expect(!!(x), 1)
+#endif
+
+#ifndef unlikely
+# define unlikely(x) __builtin_expect(!!(x), 0)
+#endif
+
#endif /* _TOOLS_LINUX_COMPILER_H */
--
1.7.9.2
next prev parent reply other threads:[~2014-01-09 14:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 14:00 [PATCHSET 0/8] tools lib traceevent: Get rid of *die finally!! (v3) Namhyung Kim
2014-01-09 14:00 ` [PATCH 1/8] tools include: Move perf's linux/compiler.h to a generic place Namhyung Kim
2014-01-14 16:40 ` [tip:perf/core] tools include: Move perf's linux/ compiler.h " tip-bot for Namhyung Kim
2014-01-09 14:00 ` Namhyung Kim [this message]
2014-01-14 16:40 ` [tip:perf/core] tools include: Define likely/unlikely in linux/ compiler.h tip-bot for Namhyung Kim
2014-01-09 14:00 ` [PATCH 3/8] tools include: Move perf's bug.h to a generic place Namhyung Kim
2014-01-14 16:40 ` [tip:perf/core] tools include: Move perf' s " tip-bot for Namhyung Kim
2014-01-09 14:00 ` [PATCH 4/8] tools include: Include <linux/compiler.h> from asm/bug.h Namhyung Kim
2014-01-14 16:41 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-09 14:00 ` [PATCH 5/8] tools lib traceevent: Add state member to struct trace_seq Namhyung Kim
2014-01-09 14:00 ` [PATCH 6/8] tools lib traceevent: Check return value of realloc() Namhyung Kim
2014-01-09 14:00 ` [PATCH 7/8] tools lib traceevent: Get rid of malloc_or_die() in trace_seq_init() Namhyung Kim
2014-01-09 14:00 ` [PATCH 8/8] tools lib traceevent: Get rid of die() finally!! Namhyung Kim
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=1389276059-8829-3-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=acme@ghostprotocols.net \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=rostedt@goodmis.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