Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1278900
| From | Namhyung Kim <namhyung@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] perf hist: Do not skip elided fields when processing samples |
| Date | 2015-11-27 18:40 +0100 |
| Message-ID | <qzva1-5TV-9@gated-at.bofh.it> (permalink) |
| References | <qzva1-5TV-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
If user gives a filter, perf marks the corresponding column elided and
omits the output. But it should process and aggregates samples using
the field, otherwise samples will be aggregated as if the column was not
there resulted in incorrect output.
For example, I'd like to set a filter on native_write_msr_safe. The
original overhead of the function is negligible.
$ perf report | grep native_write_msr_safe
0.00% swapper [kernel.vmlinux] native_write_msr_safe
0.00% perf [kernel.vmlinux] native_write_msr_safe
However adding -S option gives different output.
$ perf report -S native_write_msr_safe --percentage absolute | \
> grep -e swapper -e perf
51.47% swapper [kernel.vmlinux]
4.14% perf [kernel.vmlinux]
Since it aggregated samples using comm and dso only. In fact, the above
values are same when it sorts with -s comm,dso.
$ perf report -s comm,dso | grep -e swapper -e perf
51.47% swapper [kernel.vmlinux]
4.14% perf [kernel.vmlinux]
This resulted in TUI failure with -ERANGE since it tries to increase
sample hit count for annotation with wrong symbols due to incorrect
aggregation.
This patch fixes it not to skip elided fields when comparing samples
in order to insert them to the hists.
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/hist.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 4fd37d6708cb..6e8e0ee9ec37 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -924,9 +924,6 @@ hist_entry__cmp(struct hist_entry *left, struct hist_entry *right)
int64_t cmp = 0;
perf_hpp__for_each_sort_list(fmt) {
- if (perf_hpp__should_skip(fmt))
- continue;
-
cmp = fmt->cmp(fmt, left, right);
if (cmp)
break;
@@ -942,9 +939,6 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
int64_t cmp = 0;
perf_hpp__for_each_sort_list(fmt) {
- if (perf_hpp__should_skip(fmt))
- continue;
-
cmp = fmt->collapse(fmt, left, right);
if (cmp)
break;
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 2/3] perf hist: Do not skip elided fields when processing samples Namhyung Kim <namhyung@kernel.org> - 2015-11-27 18:40 +0100 Re: [PATCH 2/3] perf hist: Do not skip elided fields when processing samples Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-28 02:00 +0100 [tip:perf/core] perf hists: Do not skip elided fields when processing samples tip-bot for Namhyung Kim <tipbot@zytor.com> - 2015-11-29 09:00 +0100
csiph-web