Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-21 Thread Jin, Yao
On 10/22/2019 12:08 AM, Jiri Olsa wrote: On Tue, Oct 15, 2019 at 01:33:48PM +0800, Jin Yao wrote: SNIP + cycles += bi->cycles_aggr / bi->num_aggr; + + he_block = hists__add_entry_block(&bh->block_hists, +

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-21 Thread Jin, Yao
On 10/22/2019 12:07 AM, Jiri Olsa wrote: On Tue, Oct 15, 2019 at 01:33:48PM +0800, Jin Yao wrote: SNIP --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -51,6 +51,7 @@ #include "util/util.h" // perf_tip() #include "ui/ui.h" #include "ui/progress.h" +#include "util

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-21 Thread Jiri Olsa
On Mon, Oct 21, 2019 at 04:04:39PM +0200, Jiri Olsa wrote: > On Mon, Oct 21, 2019 at 02:56:57PM +0800, Jin, Yao wrote: > > SNIP > > > > > Does it seem like what the c2c does? > > > > > > well c2c has its own data output with multiline column titles, > > > hence it has its own separate dimension

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-21 Thread Jiri Olsa
On Tue, Oct 15, 2019 at 01:33:48PM +0800, Jin Yao wrote: SNIP > --- a/tools/perf/builtin-report.c > +++ b/tools/perf/builtin-report.c > @@ -51,6 +51,7 @@ > #include "util/util.h" // perf_tip() > #include "ui/ui.h" > #include "ui/progress.h" > +#include "util/block.h" > > #include > #inclu

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-21 Thread Jiri Olsa
On Tue, Oct 15, 2019 at 01:33:48PM +0800, Jin Yao wrote: SNIP > + cycles += bi->cycles_aggr / bi->num_aggr; > + > + he_block = hists__add_entry_block(&bh->block_hists, > + &al, bi); > +

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-21 Thread Jiri Olsa
On Mon, Oct 21, 2019 at 02:56:57PM +0800, Jin, Yao wrote: SNIP > > > Does it seem like what the c2c does? > > > > well c2c has its own data output with multiline column titles, > > hence it has its own separate dimension stuff, but your code > > output is within the standard perf report right? s

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-20 Thread Jin, Yao
On 10/16/2019 8:53 PM, Jiri Olsa wrote: On Wed, Oct 16, 2019 at 06:51:07PM +0800, Jin, Yao wrote: On 10/16/2019 6:15 PM, Jiri Olsa wrote: On Tue, Oct 15, 2019 at 10:53:18PM +0800, Jin, Yao wrote: SNIP +static struct block_header_column{ + const char *name; + int width; +} bl

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-16 Thread Jin, Yao
On 10/16/2019 8:53 PM, Jiri Olsa wrote: On Wed, Oct 16, 2019 at 06:51:07PM +0800, Jin, Yao wrote: On 10/16/2019 6:15 PM, Jiri Olsa wrote: On Tue, Oct 15, 2019 at 10:53:18PM +0800, Jin, Yao wrote: SNIP +static struct block_header_column{ + const char *name; + int width; +} bl

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-16 Thread Jiri Olsa
On Wed, Oct 16, 2019 at 06:51:07PM +0800, Jin, Yao wrote: > > > On 10/16/2019 6:15 PM, Jiri Olsa wrote: > > On Tue, Oct 15, 2019 at 10:53:18PM +0800, Jin, Yao wrote: > > > > SNIP > > > > > > > +static struct block_header_column{ > > > > > + const char *name; > > > > > + int width; > > >

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-16 Thread Jin, Yao
On 10/16/2019 6:15 PM, Jiri Olsa wrote: On Tue, Oct 15, 2019 at 10:53:18PM +0800, Jin, Yao wrote: SNIP +static struct block_header_column{ + const char *name; + int width; +} block_columns[PERF_HPP_REPORT__BLOCK_MAX_INDEX] = { + [PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_COV] =

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-16 Thread Jiri Olsa
On Tue, Oct 15, 2019 at 10:53:18PM +0800, Jin, Yao wrote: SNIP > > > +static struct block_header_column{ > > > + const char *name; > > > + int width; > > > +} block_columns[PERF_HPP_REPORT__BLOCK_MAX_INDEX] = { > > > + [PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_COV] = { > > > + .name = "Sampled

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-15 Thread Jin, Yao
On 10/15/2019 4:41 PM, Jiri Olsa wrote: On Tue, Oct 15, 2019 at 01:33:48PM +0800, Jin Yao wrote: SNIP +enum { + PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_COV, + PERF_HPP_REPORT__BLOCK_LBR_CYCLES, + PERF_HPP_REPORT__BLOCK_CYCLES_PCT, + PERF_HPP_REPORT__BLOCK_AVG_CYCLES, +

Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-15 Thread Jiri Olsa
On Tue, Oct 15, 2019 at 01:33:48PM +0800, Jin Yao wrote: SNIP > +enum { > + PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_COV, > + PERF_HPP_REPORT__BLOCK_LBR_CYCLES, > + PERF_HPP_REPORT__BLOCK_CYCLES_PCT, > + PERF_HPP_REPORT__BLOCK_AVG_CYCLES, > + PERF_HPP_REPORT__BLOCK_RANGE, > + P

[PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio

2019-10-14 Thread Jin Yao
It would be useful to support sorting for all blocks by the sampled cycles percent per block. This is useful to concentrate on the globally hottest blocks. This patch implements a new sort option "total_cycles" which sorts all blocks by 'Sampled Cycles%'. The 'Sampled Cycles%' is the percent that