* [GIT PULL 0/2] perf/urgent fixes
@ 2015-07-13 19:19 Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 1/2] perf symbols: Store if there is a filter in place Arnaldo Carvalho de Melo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-13 19:19 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Michael Petlan, Namhyung Kim, Stephane Eranian,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit a833581e372a4adae2319d8dc379493edbc444e9:
x86, perf: Fix static_key bug in load_mm_cr4() (2015-07-10 10:24:38 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
for you to fetch changes up to 9c0fa8dd3d58de8b688fda758eea1719949c7f0a:
perf hists browser: Take the --comm, --dsos, etc filters into account (2015-07-13 16:06:09 -0300)
----------------------------------------------------------------
perf/urgent fix:
User visible:
- Fix 'perf report' and 'perf top' handling of the '--dsos DSO-LIST',
'--comms COMM-LIST' and '--symbols SYM-LIST' command line options,
that were segfaulting due to not considering those lists as filters
in the hists browser TUI code. (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf symbols: Store if there is a filter in place
perf hists browser: Take the --comm, --dsos, etc filters into account
tools/perf/ui/browsers/hists.c | 2 +-
tools/perf/util/symbol.c | 2 ++
tools/perf/util/symbol.h | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] perf symbols: Store if there is a filter in place
2015-07-13 19:19 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2015-07-13 19:19 ` Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 2/2] perf hists browser: Take the --comm, --dsos, etc filters into account Arnaldo Carvalho de Melo
2015-07-15 11:34 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-13 19:19 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
From: Arnaldo Carvalho de Melo <acme@redhat.com>
When setting yup the symbols library we setup several filter lists,
for dsos, comms, symbols, etc, and there is code that, if there are
filters, do certain operations, like recalculate the number of non
filtered histogram entries in the top/report TUI.
But they were considering just the "Zoom" filters, when they need to
take into account as well the above mentioned filters (perf top --comms,
--dsos, etc).
So store in symbol_conf.has_filter true if any of those filters is in
place.
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>
Link: http://lkml.kernel.org/n/tip-f5edfmhq69vfvs1kmikq1wep@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol.c | 2 ++
tools/perf/util/symbol.h | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 48b588c6951a..60f11414bb5c 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1911,6 +1911,8 @@ int setup_list(struct strlist **list, const char *list_str,
pr_err("problems parsing %s list\n", list_name);
return -1;
}
+
+ symbol_conf.has_filter = true;
return 0;
}
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index bef47ead1d9b..b98ce51af142 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -105,7 +105,8 @@ struct symbol_conf {
demangle_kernel,
filter_relative,
show_hist_headers,
- branch_callstack;
+ branch_callstack,
+ has_filter;
const char *vmlinux_name,
*kallsyms_name,
*source_prefix,
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] perf hists browser: Take the --comm, --dsos, etc filters into account
2015-07-13 19:19 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 1/2] perf symbols: Store if there is a filter in place Arnaldo Carvalho de Melo
@ 2015-07-13 19:19 ` Arnaldo Carvalho de Melo
2015-07-15 11:34 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-13 19:19 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
From: Arnaldo Carvalho de Melo <acme@redhat.com>
At some point:
commit 2c86c7ca7606
Author: Namhyung Kim <namhyung@kernel.org>
Date: Mon Mar 17 18:18:54 2014 -0300
perf report: Merge al->filtered with hist_entry->filtered
We stopped dropping samples for things filtered via the --comms, --dsos,
--symbols, etc, i.e. things marked as filtered in the symbol resolution
routines (thread__find_addr_map(), perf_event__preprocess_sample(),
etc).
But then, in:
commit 268397cb2a47
Author: Namhyung Kim <namhyung@kernel.org>
Date: Tue Apr 22 14:49:31 2014 +0900
perf top/tui: Update nr_entries properly after a filter is applied
We don't take into account entries that were filtered in
perf_event__preprocess_sample() and friends, which leads to
inconsistency in the browser seek routines, that expects the number of
hist_entry->filtered entries to match what it thinks is the number of
unfiltered, browsable entries.
So, for instance, when we do:
perf top --symbols ___non_existent_symbol___
the hist_browser__nr_entries() routine thinks there are no filters in
place, uses the hists->nr_entries but all entries are filtered, leading
to a segfault.
Tested with:
perf top --symbols malloc,free --percentage=relative
Freezing, by pressing 'f', at any time and doing the math on the
percentages ends up with 100%, ditto for:
perf top --dsos libpthread-2.20.so,libxul.so --percentage=relative
Both were segfaulting, all fixed now.
More work needed to do away with checking if filters are in place, we
should just use the nr_non_filtered_samples counter, no need to
conditionally use it or hists.nr_filter, as what the browser does is
just show unfiltered stuff. An audit of how it is being accounted is
needed, this is the minimal fix.
Reported-by: Michael Petlan <mpetlan@redhat.com>
Fixes: 268397cb2a47 ("perf top/tui: Update nr_entries properly after a filter is applied")
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>
Link: http://lkml.kernel.org/n/tip-6w01d5q97qk0d64kuojme5in@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/hists.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 7629bef2fd79..fa67613976a8 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -48,7 +48,7 @@ static struct rb_node *hists__filter_entries(struct rb_node *nd,
static bool hist_browser__has_filter(struct hist_browser *hb)
{
- return hists__has_filter(hb->hists) || hb->min_pcnt;
+ return hists__has_filter(hb->hists) || hb->min_pcnt || symbol_conf.has_filter;
}
static int hist_browser__get_folding(struct hist_browser *browser)
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [GIT PULL 0/2] perf/urgent fixes
2015-07-13 19:19 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 1/2] perf symbols: Store if there is a filter in place Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 2/2] perf hists browser: Take the --comm, --dsos, etc filters into account Arnaldo Carvalho de Melo
@ 2015-07-15 11:34 ` Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2015-07-15 11:34 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern,
Frederic Weisbecker, Jiri Olsa, Michael Petlan, Namhyung Kim,
Stephane Eranian, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit a833581e372a4adae2319d8dc379493edbc444e9:
>
> x86, perf: Fix static_key bug in load_mm_cr4() (2015-07-10 10:24:38 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
>
> for you to fetch changes up to 9c0fa8dd3d58de8b688fda758eea1719949c7f0a:
>
> perf hists browser: Take the --comm, --dsos, etc filters into account (2015-07-13 16:06:09 -0300)
>
> ----------------------------------------------------------------
> perf/urgent fix:
>
> User visible:
>
> - Fix 'perf report' and 'perf top' handling of the '--dsos DSO-LIST',
> '--comms COMM-LIST' and '--symbols SYM-LIST' command line options,
> that were segfaulting due to not considering those lists as filters
> in the hists browser TUI code. (Arnaldo Carvalho de Melo)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
> perf symbols: Store if there is a filter in place
> perf hists browser: Take the --comm, --dsos, etc filters into account
>
> tools/perf/ui/browsers/hists.c | 2 +-
> tools/perf/util/symbol.c | 2 ++
> tools/perf/util/symbol.h | 3 ++-
> 3 files changed, 5 insertions(+), 2 deletions(-)
Pulled, thanks Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-15 11:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 19:19 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 1/2] perf symbols: Store if there is a filter in place Arnaldo Carvalho de Melo
2015-07-13 19:19 ` [PATCH 2/2] perf hists browser: Take the --comm, --dsos, etc filters into account Arnaldo Carvalho de Melo
2015-07-15 11:34 ` [GIT PULL 0/2] perf/urgent 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).