* [PATCH] perf report: Fix branch stack mode cannot be set
@ 2015-02-15 2:33 He Kuang
2015-02-27 9:58 ` He Kuang
2015-02-28 9:35 ` [tip:perf/core] " tip-bot for He Kuang
0 siblings, 2 replies; 4+ messages in thread
From: He Kuang @ 2015-02-15 2:33 UTC (permalink / raw)
To: a.p.zijlstra, paulus, mingo, acme; +Cc: wangnan0, linux-kernel
When perf.data file be abtained by using 'perf record -b', perf report
should use branch stack mode to generate output. But this function is
broken by improper comparison between boolean and constant -1.
before this patch:
$perf report -b -i perf.data
Samples: 16 of event 'cycles', Event count (approx.): 3171896
Overhead Command Shared Object Symbol
13.59% ls [kernel.kallsyms] [k] prio_tree_remove
13.16% ls [kernel.kallsyms] [k] change_pte_range
12.09% ls [kernel.kallsyms] [k] page_fault
12.02% ls [kernel.kallsyms] [k] zap_pte_range
...
after this patch:
$perf report -b -i perf.data
Samples: 256 of event 'cycles', Event count (approx.): 256
Overhead Command Source Shared Object Source Symbol Target Shared Object Target Symbol
9.38% ls [unknown] [k] 0000000000000000 [unknown] [k] 0000000000000000
6.25% ls libc-2.19.so [.] _dl_addr libc-2.19.so [.] _dl_addr
6.25% ls [kernel.kallsyms] [k] zap_pte_range [kernel.kallsyms] [k] zap_pte_range
6.25% ls [kernel.kallsyms] [k] change_pte_range [kernel.kallsyms] [k] change_pte_range
0.39% ls [kernel.kallsyms] [k] prio_tree_remove [kernel.kallsyms] [k] prio_tree_remove
...
Signed-off-by: He Kuang <hekuang@huawei.com>
---
tools/perf/builtin-report.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2f91094..ecc453b 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -766,7 +766,7 @@ repeat:
* 0/1 means the user chose a mode.
*/
if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) &&
- branch_call_mode == -1) {
+ !branch_call_mode) {
sort__mode = SORT_MODE__BRANCH;
symbol_conf.cumulate_callchain = false;
}
--
2.2.0.33.gc18b867
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] perf report: Fix branch stack mode cannot be set
2015-02-15 2:33 [PATCH] perf report: Fix branch stack mode cannot be set He Kuang
@ 2015-02-27 9:58 ` He Kuang
2015-02-27 16:31 ` Arnaldo Carvalho de Melo
2015-02-28 9:35 ` [tip:perf/core] " tip-bot for He Kuang
1 sibling, 1 reply; 4+ messages in thread
From: He Kuang @ 2015-02-27 9:58 UTC (permalink / raw)
To: a.p.zijlstra, paulus, mingo, acme; +Cc: wangnan0, linux-kernel
ping..
在 2015/2/15 10:33, He Kuang 写道:
> When perf.data file be abtained by using 'perf record -b', perf report
> should use branch stack mode to generate output. But this function is
> broken by improper comparison between boolean and constant -1.
>
> before this patch:
> $perf report -b -i perf.data
> Samples: 16 of event 'cycles', Event count (approx.): 3171896
> Overhead Command Shared Object Symbol
> 13.59% ls [kernel.kallsyms] [k] prio_tree_remove
> 13.16% ls [kernel.kallsyms] [k] change_pte_range
> 12.09% ls [kernel.kallsyms] [k] page_fault
> 12.02% ls [kernel.kallsyms] [k] zap_pte_range
> ...
>
> after this patch:
> $perf report -b -i perf.data
> Samples: 256 of event 'cycles', Event count (approx.): 256
> Overhead Command Source Shared Object Source Symbol Target Shared Object Target Symbol
> 9.38% ls [unknown] [k] 0000000000000000 [unknown] [k] 0000000000000000
> 6.25% ls libc-2.19.so [.] _dl_addr libc-2.19.so [.] _dl_addr
> 6.25% ls [kernel.kallsyms] [k] zap_pte_range [kernel.kallsyms] [k] zap_pte_range
> 6.25% ls [kernel.kallsyms] [k] change_pte_range [kernel.kallsyms] [k] change_pte_range
> 0.39% ls [kernel.kallsyms] [k] prio_tree_remove [kernel.kallsyms] [k] prio_tree_remove
> ...
>
> Signed-off-by: He Kuang <hekuang@huawei.com>
> ---
> tools/perf/builtin-report.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 2f91094..ecc453b 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -766,7 +766,7 @@ repeat:
> * 0/1 means the user chose a mode.
> */
> if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) &&
> - branch_call_mode == -1) {
> + !branch_call_mode) {
> sort__mode = SORT_MODE__BRANCH;
> symbol_conf.cumulate_callchain = false;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf report: Fix branch stack mode cannot be set
2015-02-27 9:58 ` He Kuang
@ 2015-02-27 16:31 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-27 16:31 UTC (permalink / raw)
To: He Kuang; +Cc: a.p.zijlstra, paulus, mingo, wangnan0, linux-kernel
Em Fri, Feb 27, 2015 at 05:58:44PM +0800, He Kuang escreveu:
> ping..
Thanks, applied to perf/core.
- Arnaldo
> 在 2015/2/15 10:33, He Kuang 写道:
> >When perf.data file be abtained by using 'perf record -b', perf report
> >should use branch stack mode to generate output. But this function is
> >broken by improper comparison between boolean and constant -1.
> >
> >before this patch:
> >$perf report -b -i perf.data
> >Samples: 16 of event 'cycles', Event count (approx.): 3171896
> >Overhead Command Shared Object Symbol
> > 13.59% ls [kernel.kallsyms] [k] prio_tree_remove
> > 13.16% ls [kernel.kallsyms] [k] change_pte_range
> > 12.09% ls [kernel.kallsyms] [k] page_fault
> > 12.02% ls [kernel.kallsyms] [k] zap_pte_range
> >...
> >
> >after this patch:
> >$perf report -b -i perf.data
> >Samples: 256 of event 'cycles', Event count (approx.): 256
> >Overhead Command Source Shared Object Source Symbol Target Shared Object Target Symbol
> > 9.38% ls [unknown] [k] 0000000000000000 [unknown] [k] 0000000000000000
> > 6.25% ls libc-2.19.so [.] _dl_addr libc-2.19.so [.] _dl_addr
> > 6.25% ls [kernel.kallsyms] [k] zap_pte_range [kernel.kallsyms] [k] zap_pte_range
> > 6.25% ls [kernel.kallsyms] [k] change_pte_range [kernel.kallsyms] [k] change_pte_range
> > 0.39% ls [kernel.kallsyms] [k] prio_tree_remove [kernel.kallsyms] [k] prio_tree_remove
> >...
> >
> >Signed-off-by: He Kuang <hekuang@huawei.com>
> >---
> > tools/perf/builtin-report.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> >index 2f91094..ecc453b 100644
> >--- a/tools/perf/builtin-report.c
> >+++ b/tools/perf/builtin-report.c
> >@@ -766,7 +766,7 @@ repeat:
> > * 0/1 means the user chose a mode.
> > */
> > if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) &&
> >- branch_call_mode == -1) {
> >+ !branch_call_mode) {
> > sort__mode = SORT_MODE__BRANCH;
> > symbol_conf.cumulate_callchain = false;
> > }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] perf report: Fix branch stack mode cannot be set
2015-02-15 2:33 [PATCH] perf report: Fix branch stack mode cannot be set He Kuang
2015-02-27 9:58 ` He Kuang
@ 2015-02-28 9:35 ` tip-bot for He Kuang
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for He Kuang @ 2015-02-28 9:35 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, a.p.zijlstra, mingo, wangnan0, tglx, hpa, paulus,
acme, hekuang
Commit-ID: fefd2d9619de3bf0bf02a8622e9f445c3d19cc3f
Gitweb: http://git.kernel.org/tip/fefd2d9619de3bf0bf02a8622e9f445c3d19cc3f
Author: He Kuang <hekuang@huawei.com>
AuthorDate: Sun, 15 Feb 2015 10:33:37 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 27 Feb 2015 15:52:42 -0300
perf report: Fix branch stack mode cannot be set
When perf.data file is obtained using 'perf record -b', perf report
should use branch stack mode to generate output. But this function is
broken by improper comparison between boolean and constant -1.
before this patch:
$ perf report -b -i perf.data
Samples: 16 of event 'cycles', Event count (approx.): 3171896
Overhead Command Shared Object Symbol
13.59% ls [kernel.kallsyms] [k] prio_tree_remove
13.16% ls [kernel.kallsyms] [k] change_pte_range
12.09% ls [kernel.kallsyms] [k] page_fault
12.02% ls [kernel.kallsyms] [k] zap_pte_range
...
after this patch:
$ perf report -b -i perf.data
Samples: 256 of event 'cycles', Event count (approx.): 256
Overhead Command Source Shared Object Source Symbol Target Shared Object Target Symbol
9.38% ls [unknown] [k] 0000000000000000 [unknown] [k] 0000000000000000
6.25% ls libc-2.19.so [.] _dl_addr libc-2.19.so [.] _dl_addr
6.25% ls [kernel.kallsyms] [k] zap_pte_range [kernel.kallsyms] [k] zap_pte_range
6.25% ls [kernel.kallsyms] [k] change_pte_range [kernel.kallsyms] [k] change_pte_range
0.39% ls [kernel.kallsyms] [k] prio_tree_remove [kernel.kallsyms] [k] prio_tree_remove
...
Signed-off-by: He Kuang <hekuang@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1423967617-28879-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-report.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0ba5f07..fb35034 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -768,7 +768,7 @@ repeat:
* 0/1 means the user chose a mode.
*/
if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) &&
- branch_call_mode == -1) {
+ !branch_call_mode) {
sort__mode = SORT_MODE__BRANCH;
symbol_conf.cumulate_callchain = false;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-28 9:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-15 2:33 [PATCH] perf report: Fix branch stack mode cannot be set He Kuang
2015-02-27 9:58 ` He Kuang
2015-02-27 16:31 ` Arnaldo Carvalho de Melo
2015-02-28 9:35 ` [tip:perf/core] " tip-bot for He Kuang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox