* [GIT PULL 0/8] perf/core improvements and fixes
@ 2015-10-13 19:41 Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 7/8] tools include: Fix strict-aliasing rules breakage Arnaldo Carvalho de Melo
2015-10-14 13:09 ` [GIT PULL 0/8] perf/core improvements and fixes Ingo Molnar
0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-13 19:41 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
Borislav Petkov, David Ahern, Frederic Weisbecker, He Kuang,
Jiri Olsa, linux-next, Martin Liska, Namhyung Kim, Peter Zijlstra,
Rabin Vincent, Stephane Eranian, Wang Nan,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling.
- Arnaldo
BTW.: There are several outstanding patchkits needing review and processing,
I'll be out this week for a conference, will try and speed up processing next
week.
The following changes since commit 0e537fef24d64f7bf3ef61a27edf64a8d9a5424c:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-10-08 10:52:44 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
for you to fetch changes up to 3a70fcd3a4db56731f67f0189514953c74257944:
tools build: Fix cross compile build (2015-10-13 11:59:43 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Use the alternative with the most descriptive filename containing
a vmlinux file for a given build-id, providing a better title line
for tools such as 'annotate' (Arnaldo Carvalho de Melo)
- Remove help messages about previous right and left arrow keybidings, that
were repurposed for horizontal scrolling (Arnaldo Carvalho de Melo)
- Inform how to reset the symbol filter in the hists browser (top & report)
(Arnaldo Carvalho de Melo)
- Add 'm' key for context menu display in the hists browser, that became
inacessible with the repurposing of the right arrow key for horizontal
scrolling (Namhyung Kim)
- Use debug_frame for callchains if eh_frame is unusable (Rabin Vicent)
Build fixes:
- Fix strict-aliasing breakage with gcc 4.4 in the READ_ONCE/WRITE_ONCE code
adopted from the kernel tree, that builds with -fno-strict-aliasing while
tools/perf/ uses -Wstrict-aliasing=3 (Jiri Olsa)
- Fix unw_word_t pointer casts in code using libunwind for callchains,
fixing the build in at least 32-bit MIPS systems (Rabin Vicent)
- Workaround cross compile build problems related to fixdep (Jiri Olsa)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
perf symbols: Try the .debug/ DSO cache as a last resort
perf ui browsers: Remove help messages about use of right and arrow keys
perf hists browser: Inform how to reset the symbol filter
Jiri Olsa (2):
tools include: Fix strict-aliasing rules breakage
tools build: Fix cross compile build
Namhyung Kim (1):
perf hists browser: Add 'm' key for context menu display
Rabin Vincent (2):
perf callchain: Use debug_frame if eh_frame is unusable
perf callchains: Fix unw_word_t pointer casts
tools/build/Makefile.include | 4 ++++
tools/include/linux/compiler.h | 32 ++++++++++++++++++++++++--------
tools/perf/ui/browsers/annotate.c | 6 +++---
tools/perf/ui/browsers/hists.c | 13 ++++++++-----
tools/perf/ui/browsers/map.c | 2 +-
tools/perf/ui/browsers/scripts.c | 2 +-
tools/perf/util/symbol.c | 18 +++++++++---------
tools/perf/util/unwind-libunwind.c | 14 ++++++++------
8 files changed, 58 insertions(+), 33 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 7/8] tools include: Fix strict-aliasing rules breakage
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2015-10-13 19:41 ` Arnaldo Carvalho de Melo
2015-10-14 13:09 ` [GIT PULL 0/8] perf/core improvements and fixes Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-13 19:41 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, Jiri Olsa, Adrian Hunter, Andi Kleen,
Martin Liska, Peter Zijlstra, Rabin Vincent, linux-next,
Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@redhat.com>
Vinson reported build breakage with gcc 4.4 due to strict-aliasing.
CC util/annotate.o
cc1: warnings being treated as errors
util/annotate.c: In function ‘disasm__purge’:
linux-next/tools/include/linux/compiler.h:66: error: dereferencing
pointer ‘res.41’ does break strict-aliasing rules
The reason is READ_ONCE/WRITE_ONCE code we took from kernel sources. They
intentionaly break aliasing rules. While this is ok for kernel because it's
built with -fno-strict-aliasing, it breaks perf which is build with
-Wstrict-aliasing=3.
Using extra __may_alias__ type to allow aliasing in this case.
Reported-and-tested-by: Vinson Lee <vlee@twopensource.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Martin Liska <mliska@suse.cz>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabin@rab.in>
Cc: linux-next@vger.kernel.org
Link: http://lkml.kernel.org/r/20151013085214.GB2705@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/include/linux/compiler.h | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 9098083869c8..fa7208a32d76 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -43,13 +43,29 @@
#include <linux/types.h>
+/*
+ * Following functions are taken from kernel sources and
+ * break aliasing rules in their original form.
+ *
+ * While kernel is compiled with -fno-strict-aliasing,
+ * perf uses -Wstrict-aliasing=3 which makes build fail
+ * under gcc 4.4.
+ *
+ * Using extra __may_alias__ type to allow aliasing
+ * in this case.
+ */
+typedef __u8 __attribute__((__may_alias__)) __u8_alias_t;
+typedef __u16 __attribute__((__may_alias__)) __u16_alias_t;
+typedef __u32 __attribute__((__may_alias__)) __u32_alias_t;
+typedef __u64 __attribute__((__may_alias__)) __u64_alias_t;
+
static __always_inline void __read_once_size(const volatile void *p, void *res, int size)
{
switch (size) {
- case 1: *(__u8 *)res = *(volatile __u8 *)p; break;
- case 2: *(__u16 *)res = *(volatile __u16 *)p; break;
- case 4: *(__u32 *)res = *(volatile __u32 *)p; break;
- case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
+ case 1: *(__u8_alias_t *) res = *(volatile __u8_alias_t *) p; break;
+ case 2: *(__u16_alias_t *) res = *(volatile __u16_alias_t *) p; break;
+ case 4: *(__u32_alias_t *) res = *(volatile __u32_alias_t *) p; break;
+ case 8: *(__u64_alias_t *) res = *(volatile __u64_alias_t *) p; break;
default:
barrier();
__builtin_memcpy((void *)res, (const void *)p, size);
@@ -60,10 +76,10 @@ static __always_inline void __read_once_size(const volatile void *p, void *res,
static __always_inline void __write_once_size(volatile void *p, void *res, int size)
{
switch (size) {
- case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
- case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
- case 4: *(volatile __u32 *)p = *(__u32 *)res; break;
- case 8: *(volatile __u64 *)p = *(__u64 *)res; break;
+ case 1: *(volatile __u8_alias_t *) p = *(__u8_alias_t *) res; break;
+ case 2: *(volatile __u16_alias_t *) p = *(__u16_alias_t *) res; break;
+ case 4: *(volatile __u32_alias_t *) p = *(__u32_alias_t *) res; break;
+ case 8: *(volatile __u64_alias_t *) p = *(__u64_alias_t *) res; break;
default:
barrier();
__builtin_memcpy((void *)p, (const void *)res, size);
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [GIT PULL 0/8] perf/core improvements and fixes
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 7/8] tools include: Fix strict-aliasing rules breakage Arnaldo Carvalho de Melo
@ 2015-10-14 13:09 ` Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2015-10-14 13:09 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
David Ahern, Frederic Weisbecker, He Kuang, Jiri Olsa, linux-next,
Martin Liska, Namhyung Kim, Peter Zijlstra, Rabin Vincent,
Stephane Eranian, Wang Nan, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling.
>
> - Arnaldo
>
> BTW.: There are several outstanding patchkits needing review and processing,
> I'll be out this week for a conference, will try and speed up processing next
> week.
>
> The following changes since commit 0e537fef24d64f7bf3ef61a27edf64a8d9a5424c:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-10-08 10:52:44 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>
> for you to fetch changes up to 3a70fcd3a4db56731f67f0189514953c74257944:
>
> tools build: Fix cross compile build (2015-10-13 11:59:43 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Use the alternative with the most descriptive filename containing
> a vmlinux file for a given build-id, providing a better title line
> for tools such as 'annotate' (Arnaldo Carvalho de Melo)
>
> - Remove help messages about previous right and left arrow keybidings, that
> were repurposed for horizontal scrolling (Arnaldo Carvalho de Melo)
>
> - Inform how to reset the symbol filter in the hists browser (top & report)
> (Arnaldo Carvalho de Melo)
>
> - Add 'm' key for context menu display in the hists browser, that became
> inacessible with the repurposing of the right arrow key for horizontal
> scrolling (Namhyung Kim)
>
> - Use debug_frame for callchains if eh_frame is unusable (Rabin Vicent)
>
> Build fixes:
>
> - Fix strict-aliasing breakage with gcc 4.4 in the READ_ONCE/WRITE_ONCE code
> adopted from the kernel tree, that builds with -fno-strict-aliasing while
> tools/perf/ uses -Wstrict-aliasing=3 (Jiri Olsa)
>
> - Fix unw_word_t pointer casts in code using libunwind for callchains,
> fixing the build in at least 32-bit MIPS systems (Rabin Vicent)
>
> - Workaround cross compile build problems related to fixdep (Jiri Olsa)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (3):
> perf symbols: Try the .debug/ DSO cache as a last resort
> perf ui browsers: Remove help messages about use of right and arrow keys
> perf hists browser: Inform how to reset the symbol filter
>
> Jiri Olsa (2):
> tools include: Fix strict-aliasing rules breakage
> tools build: Fix cross compile build
>
> Namhyung Kim (1):
> perf hists browser: Add 'm' key for context menu display
>
> Rabin Vincent (2):
> perf callchain: Use debug_frame if eh_frame is unusable
> perf callchains: Fix unw_word_t pointer casts
>
> tools/build/Makefile.include | 4 ++++
> tools/include/linux/compiler.h | 32 ++++++++++++++++++++++++--------
> tools/perf/ui/browsers/annotate.c | 6 +++---
> tools/perf/ui/browsers/hists.c | 13 ++++++++-----
> tools/perf/ui/browsers/map.c | 2 +-
> tools/perf/ui/browsers/scripts.c | 2 +-
> tools/perf/util/symbol.c | 18 +++++++++---------
> tools/perf/util/unwind-libunwind.c | 14 ++++++++------
> 8 files changed, 58 insertions(+), 33 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-14 13:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 7/8] tools include: Fix strict-aliasing rules breakage Arnaldo Carvalho de Melo
2015-10-14 13:09 ` [GIT PULL 0/8] perf/core improvements and fixes Ingo Molnar
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).