* [GIT PULL 0/8] perf/core improvements and fixes
@ 2015-10-13 19:41 Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 1/8] perf symbols: Try the .debug/ DSO cache as a last resort Arnaldo Carvalho de Melo
` (8 more replies)
0 siblings, 9 replies; 10+ 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] 10+ messages in thread
* [PATCH 1/8] perf symbols: Try the .debug/ DSO cache as a last resort
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-13 19:41 ` [PATCH 2/8] perf ui browsers: Remove help messages about use of right and arrow keys Arnaldo Carvalho de Melo
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ 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,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Namhyung Kim, Stephane Eranian, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Not as the first attempt at finding a vmlinux for the running kernel,
this way we get a more informative filename to present in tools, it will
check that the build-id is the same as the one previously loaded in the
DSO in dso->build_id, reading from /sys/kernel/notes, for instance.
E.g. in the annotation TUI, going from 'perf top', for the scsi_sg_alloc
kernel function, in the first line:
Before:
scsi_sg_alloc /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1
After:
scsi_sg_alloc /lib/modules/4.3.0-rc1+/build/vmlinux
And:
# ls -la /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1
lrwxrwxrwx. 1 root root 81 Sep 22 16:11 /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1 -> ../../home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
# file ~/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
/root/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=282777c262e6b3c0451375163c9a81c893218ab1, not stripped
#
The same as:
# file /lib/modules/4.3.0-rc1+/build/vmlinux
/lib/modules/4.3.0-rc1+/build/vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=282777c262e6b3c0451375163c9a81c893218ab1, not stripped
Furthermore:
# sha256sum /lib/modules/4.3.0-rc1+/build/vmlinux
e7a789bbdc61029ec09140c228e1dd651271f38ef0b8416c0b7d5ff727b98be2 /lib/modules/4.3.0-rc1+/build/vmlinux
# sha256sum ~/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
e7a789bbdc61029ec09140c228e1dd651271f38ef0b8416c0b7d5ff727b98be2 /root/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
[root@zoo new]#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-9y42ikzq3jisiddoi6f07n8z@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index bcda43bee4d4..e7bf0c46918d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1607,6 +1607,15 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map,
int i, err = 0;
char *filename = NULL;
+ pr_debug("Looking at the vmlinux_path (%d entries long)\n",
+ vmlinux_path__nr_entries + 1);
+
+ for (i = 0; i < vmlinux_path__nr_entries; ++i) {
+ err = dso__load_vmlinux(dso, map, vmlinux_path[i], false, filter);
+ if (err > 0)
+ goto out;
+ }
+
if (!symbol_conf.ignore_vmlinux_buildid)
filename = dso__build_id_filename(dso, NULL, 0);
if (filename != NULL) {
@@ -1615,15 +1624,6 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map,
goto out;
free(filename);
}
-
- pr_debug("Looking at the vmlinux_path (%d entries long)\n",
- vmlinux_path__nr_entries + 1);
-
- for (i = 0; i < vmlinux_path__nr_entries; ++i) {
- err = dso__load_vmlinux(dso, map, vmlinux_path[i], false, filter);
- if (err > 0)
- break;
- }
out:
return err;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/8] perf ui browsers: Remove help messages about use of right and arrow keys
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 1/8] perf symbols: Try the .debug/ DSO cache as a last resort Arnaldo Carvalho de Melo
@ 2015-10-13 19:41 ` Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 3/8] perf hists browser: Inform how to reset the symbol filter Arnaldo Carvalho de Melo
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ 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,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Namhyung Kim, Stephane Eranian, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
They were repurposed for horizontal scrolling, so use just ENTER/ESC in
the help messages.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: c6c3c02dea40 ("perf hists browser: Implement horizontal scrolling")
Link: http://lkml.kernel.org/n/tip-n5ar4qg8fs12ax4vhr3rxhxj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/annotate.c | 6 +++---
tools/perf/ui/browsers/hists.c | 8 ++++----
tools/perf/ui/browsers/map.c | 2 +-
tools/perf/ui/browsers/scripts.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 29739b347599..bec0b62d8e38 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -768,8 +768,8 @@ static int annotate_browser__run(struct annotate_browser *browser,
"UP/DOWN/PGUP\n"
"PGDN/SPACE Navigate\n"
"q/ESC/CTRL+C Exit\n\n"
- "-> Go to target\n"
- "<- Exit\n"
+ "ENTER Go to target\n"
+ "ESC Exit\n"
"H Cycle thru hottest instructions\n"
"j Toggle showing jump to target arrows\n"
"J Toggle showing number of jump sources on targets\n"
@@ -1056,7 +1056,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
goto out_free_offsets;
}
- ui_helpline__push("Press <- or ESC to exit");
+ ui_helpline__push("Press ESC to exit");
notes = symbol__annotation(sym);
browser.start = map__rip_2objdump(map, sym->start);
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 9b7346a881cf..eea16278d038 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1496,7 +1496,7 @@ do_zoom_thread(struct hist_browser *browser, struct popup_action *act)
thread__zput(browser->hists->thread_filter);
ui_helpline__pop();
} else {
- ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"",
+ ui_helpline__fpush("To zoom out press ESC or ENTER + \"Zoom out of %s(%d) thread\"",
thread->comm_set ? thread__comm_str(thread) : "",
thread->tid);
browser->hists->thread_filter = thread__get(thread);
@@ -1540,7 +1540,7 @@ do_zoom_dso(struct hist_browser *browser, struct popup_action *act)
} else {
if (map == NULL)
return 0;
- ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"",
+ ui_helpline__fpush("To zoom out press ESC or ENTER + \"Zoom out of %s DSO\"",
__map__is_kernel(map) ? "the Kernel" : map->dso->short_name);
browser->hists->dso_filter = map->dso;
perf_hpp__set_elide(HISTC_DSO, true);
@@ -1761,8 +1761,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
"For multiple event sessions:\n\n" \
"TAB/UNTAB Switch events\n\n" \
"For symbolic views (--sort has sym):\n\n" \
- "-> Zoom into DSO/Threads & Annotate current symbol\n" \
- "<- Zoom out\n" \
+ "ENTER Zoom into DSO/Threads & Annotate current symbol\n" \
+ "ESC Zoom out\n" \
"a Annotate current symbol\n" \
"C Collapse all callchains\n" \
"d Zoom into current DSO\n" \
diff --git a/tools/perf/ui/browsers/map.c b/tools/perf/ui/browsers/map.c
index 8c154c7d4669..80912778bb6d 100644
--- a/tools/perf/ui/browsers/map.c
+++ b/tools/perf/ui/browsers/map.c
@@ -72,7 +72,7 @@ static int map_browser__run(struct map_browser *browser)
int key;
if (ui_browser__show(&browser->b, browser->map->dso->long_name,
- "Press <- or ESC to exit, %s / to search",
+ "Press ESC to exit, %s / to search",
verbose ? "" : "restart with -v to use") < 0)
return -1;
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index e13b48d705ef..ad6b6ee3770e 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -89,7 +89,7 @@ static int script_browser__run(struct perf_script_browser *browser)
int key;
if (ui_browser__show(&browser->b, browser->script_name,
- "Press <- or ESC to exit") < 0)
+ "Press ESC to exit") < 0)
return -1;
while (1) {
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/8] perf hists browser: Inform how to reset the symbol filter
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 1/8] perf symbols: Try the .debug/ DSO cache as a last resort Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 2/8] perf ui browsers: Remove help messages about use of right and arrow keys Arnaldo Carvalho de Melo
@ 2015-10-13 19:41 ` Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 4/8] perf callchain: Use debug_frame if eh_frame is unusable Arnaldo Carvalho de Melo
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ 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,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Namhyung Kim, Stephane Eranian, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
When in the hists browser, i.e. in 'perf report' or in 'perf top', it is
possible to press '/' and specify a substring to filter by symbol name.
Clarify how to remove a filter by making the prompt be:
Please enter the name of symbol you want to see.
To remove the filter later, press / + ENTER
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-vbq2b0kyufwy6p0ctkfswcoe@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/hists.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index eea16278d038..772834912c7c 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1889,7 +1889,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
continue;
case '/':
if (ui_browser__input_window("Symbol to show",
- "Please enter the name of symbol you want to see",
+ "Please enter the name of symbol you want to see.\n"
+ "To remove the filter later, press / + ENTER.",
buf, "ENTER: OK, ESC: Cancel",
delay_secs * 2) == K_ENTER) {
hists->symbol_filter_str = *buf ? buf : NULL;
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/8] perf callchain: Use debug_frame if eh_frame is unusable
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2015-10-13 19:41 ` [PATCH 3/8] perf hists browser: Inform how to reset the symbol filter Arnaldo Carvalho de Melo
@ 2015-10-13 19:41 ` Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 5/8] perf callchains: Fix unw_word_t pointer casts Arnaldo Carvalho de Melo
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-13 19:41 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Rabin Vincent, Peter Zijlstra, Rabin Vincent,
Arnaldo Carvalho de Melo
From: Rabin Vincent <rabin.vincent@axis.com>
When NO_LIBUNWIND_DEBUG_FRAME=0, use the .debug_frame if the .eh_frame
doesn't contain the approprate unwind tables.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabinv@axis.com>
Link: http://lkml.kernel.org/r/1443379079-29133-3-git-send-email-rabin.vincent@axis.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/unwind-libunwind.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 4c00507ee3fd..ea993f6c7e0c 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -330,6 +330,7 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
struct map *map;
unw_dyn_info_t di;
u64 table_data, segbase, fde_count;
+ int ret = -EINVAL;
map = find_map(ip, ui);
if (!map || !map->dso)
@@ -348,13 +349,14 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
di.u.rti.table_data = map->start + table_data;
di.u.rti.table_len = fde_count * sizeof(struct table_entry)
/ sizeof(unw_word_t);
- return dwarf_search_unwind_table(as, ip, &di, pi,
- need_unwind_info, arg);
+ ret = dwarf_search_unwind_table(as, ip, &di, pi,
+ need_unwind_info, arg);
}
#ifndef NO_LIBUNWIND_DEBUG_FRAME
/* Check the .debug_frame section for unwinding info */
- if (!read_unwind_spec_debug_frame(map->dso, ui->machine, &segbase)) {
+ if (ret < 0 &&
+ !read_unwind_spec_debug_frame(map->dso, ui->machine, &segbase)) {
int fd = dso__data_get_fd(map->dso, ui->machine);
int is_exec = elf_is_exec(fd, map->dso->name);
unw_word_t base = is_exec ? 0 : map->start;
@@ -370,7 +372,7 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
}
#endif
- return -EINVAL;
+ return ret;
}
static int access_fpreg(unw_addr_space_t __maybe_unused as,
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/8] perf callchains: Fix unw_word_t pointer casts
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2015-10-13 19:41 ` [PATCH 4/8] perf callchain: Use debug_frame if eh_frame is unusable Arnaldo Carvalho de Melo
@ 2015-10-13 19:41 ` Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 6/8] perf hists browser: Add 'm' key for context menu display Arnaldo Carvalho de Melo
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-13 19:41 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Rabin Vincent, Peter Zijlstra, Rabin Vincent,
Arnaldo Carvalho de Melo
From: Rabin Vincent <rabin.vincent@axis.com>
unw_word_t is uint64_t even on 32-bit MIPS. Cast it to uintptr_t before
the cast to void *p to get rid of the following errors:
util/unwind-libunwind.c: In function 'access_mem':
util/unwind-libunwind.c:464:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
util/unwind-libunwind.c:475:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
make[3]: *** [util/unwind-libunwind.o] Error 1
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabinv@axis.com>
Link: http://lkml.kernel.org/r/1443379079-29133-1-git-send-email-rabin.vincent@axis.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/unwind-libunwind.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index ea993f6c7e0c..f729f9e99f99 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -463,7 +463,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
if (ret) {
pr_debug("unwind: access_mem %p not inside range"
" 0x%" PRIx64 "-0x%" PRIx64 "\n",
- (void *) addr, start, end);
+ (void *) (uintptr_t) addr, start, end);
*valp = 0;
return ret;
}
@@ -473,7 +473,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
offset = addr - start;
*valp = *(unw_word_t *)&stack->data[offset];
pr_debug("unwind: access_mem addr %p val %lx, offset %d\n",
- (void *) addr, (unsigned long)*valp, offset);
+ (void *) (uintptr_t) addr, (unsigned long)*valp, offset);
return 0;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/8] perf hists browser: Add 'm' key for context menu display
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2015-10-13 19:41 ` [PATCH 5/8] perf callchains: Fix unw_word_t pointer casts Arnaldo Carvalho de Melo
@ 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
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-13 19:41 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Namhyung Kim, David Ahern, Jiri Olsa,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Namhyung Kim <namhyung@kernel.org>
With horizontal scrolling, the left/right arrow keys are used to scroll
columns and ENTER/ESC keys are used to enter/exit menu. However if
callchain is recorded, the ENTER key is used to toggle callchain
expansion so there's no way to display menu. Use 'm' key to display the
menu for this case.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1444694521-8136-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/hists.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 772834912c7c..e5afb8936040 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1769,6 +1769,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
"E Expand all callchains\n" \
"F Toggle percentage of filtered entries\n" \
"H Display column headers\n" \
+ "m Display context menu\n" \
"S Zoom into current Processor Socket\n" \
/* help messages are sorted by lexical order of the hotkey */
@@ -1935,6 +1936,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
continue;
case K_ENTER:
case K_RIGHT:
+ case 'm':
/* menu */
break;
case K_ESC:
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ 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
` (5 preceding siblings ...)
2015-10-13 19:41 ` [PATCH 6/8] perf hists browser: Add 'm' key for context menu display Arnaldo Carvalho de Melo
@ 2015-10-13 19:41 ` Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 8/8] tools build: Fix cross compile build Arnaldo Carvalho de Melo
2015-10-14 13:09 ` [GIT PULL 0/8] perf/core improvements and fixes Ingo Molnar
8 siblings, 0 replies; 10+ 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] 10+ messages in thread
* [PATCH 8/8] tools build: Fix cross compile build
2015-10-13 19:41 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (6 preceding siblings ...)
2015-10-13 19:41 ` [PATCH 7/8] tools include: Fix strict-aliasing rules breakage 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
8 siblings, 0 replies; 10+ 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, David Ahern, Namhyung Kim,
Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@redhat.com>
He Kuang the new fixdep tool breaks cross compiling. The reason is it
wouldn't get compiled under host arch, but under cross arch and failed
to run.
We need to add support for host side tools build, meanwhile disabling
fixdep usage for cross arch builds.
Reported-by: He Kuang <hekuang@huawei.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20151013124358.GB9467@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Makefile.include | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
index 6572bb023543..4e09ad617a60 100644
--- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include
@@ -1,6 +1,10 @@
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+ifdef CROSS_COMPILE
+fixdep:
+else
fixdep:
$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
+endif
.PHONY: fixdep
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ 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
` (7 preceding siblings ...)
2015-10-13 19:41 ` [PATCH 8/8] tools build: Fix cross compile build Arnaldo Carvalho de Melo
@ 2015-10-14 13:09 ` Ingo Molnar
8 siblings, 0 replies; 10+ 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] 10+ messages in thread
end of thread, other threads:[~2015-10-14 13:09 UTC | newest]
Thread overview: 10+ 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 1/8] perf symbols: Try the .debug/ DSO cache as a last resort Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 2/8] perf ui browsers: Remove help messages about use of right and arrow keys Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 3/8] perf hists browser: Inform how to reset the symbol filter Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 4/8] perf callchain: Use debug_frame if eh_frame is unusable Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 5/8] perf callchains: Fix unw_word_t pointer casts Arnaldo Carvalho de Melo
2015-10-13 19:41 ` [PATCH 6/8] perf hists browser: Add 'm' key for context menu display 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-13 19:41 ` [PATCH 8/8] tools build: Fix cross compile build 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).