mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jin, Yao" <yao.jin@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
	mingo@redhat.com, alexander.shishkin@linux.intel.com,
	Linux-kernel@vger.kernel.org, ak@linux.intel.com,
	kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio
Date: Tue, 15 Oct 2019 22:53:18 +0800	[thread overview]
Message-ID: <6882f3ae-0f8d-5a01-7fd5-5b9f9c93f9ac@linux.intel.com> (raw)
In-Reply-To: <20191015084102.GA10951@krava>



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,
>> +	PERF_HPP_REPORT__BLOCK_RANGE,
>> +	PERF_HPP_REPORT__BLOCK_DSO,
>> +	PERF_HPP_REPORT__BLOCK_MAX_INDEX
>> +};
>> +
>> +static struct block_fmt block_fmts[PERF_HPP_REPORT__BLOCK_MAX_INDEX];
>> +
>> +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 Cycles%",
>> +		.width = 15,
>> +	},
>> +	[PERF_HPP_REPORT__BLOCK_LBR_CYCLES] = {
>> +		.name = "Sampled Cycles",
>> +		.width = 14,
>> +	},
>> +	[PERF_HPP_REPORT__BLOCK_CYCLES_PCT] = {
>> +		.name = "Avg Cycles%",
>> +		.width = 11,
>> +	},
>> +	[PERF_HPP_REPORT__BLOCK_AVG_CYCLES] = {
>> +		.name = "Avg Cycles",
>> +		.width = 10,
>> +	},
>> +	[PERF_HPP_REPORT__BLOCK_RANGE] = {
>> +		.name = "[Program Block Range]",
>> +		.width = 70,
>> +	},
>> +	[PERF_HPP_REPORT__BLOCK_DSO] = {
>> +		.name = "Shared Object",
>> +		.width = 20,
>> +	}
>>   };
> 
> so we already have support for multiple columns,
> why don't you add those as 'struct sort_entry' objects?
> 

For 'struct sort_entry' objects, do you mean I should reuse the 
"sort_dso" which has been implemented yet in util/sort.c?

For other columns, it looks we can't reuse the existing sort_entry objects.

> SNIP
> 
>> +{
>> +	struct block_hist *bh = &rep->block_hist;
>> +
>> +	get_block_hists(hists, bh, rep);
>> +	symbol_conf.report_individual_block = true;
>> +	hists__fprintf(&bh->block_hists, true, 0, 0, 0,
>> +		       stdout, true);
>> +	hists__delete_entries(&bh->block_hists);
>> +	return 0;
>> +}
>> +
>>   static int perf_evlist__tty_browse_hists(struct evlist *evlist,
>>   					 struct report *rep,
>>   					 const char *help)
>> @@ -500,6 +900,12 @@ static int perf_evlist__tty_browse_hists(struct evlist *evlist,
>>   			continue;
>>   
>>   		hists__fprintf_nr_sample_events(hists, rep, evname, stdout);
>> +
>> +		if (rep->total_cycles) {
>> +			hists__fprintf_all_blocks(hists, rep);
> 
> so this call kicks all the block info setup/count/print, right?
> 

Yes, all in this call.

> I thingk it shouldn't be in the output code, but in the code before..
> from what I see you could count block_info counts during the sample
> processing, no?
>

In sample processing, we just get all symbols and account the cycles per 
symbol. We need to create/count the block_info at some points after the 
sample processing.

Maybe it's not very good to put block info setup/count/print in a call, 
but it's really not easy to process the block_info during the sample 
processing.

Thanks
Jin Yao

> jirka
> 

  reply	other threads:[~2019-10-15 14:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15  5:33 [PATCH v2 0/5] perf report: Support sorting all blocks by cycles Jin Yao
2019-10-15  5:33 ` [PATCH v2 1/5] perf util: Create new block.h/block.c for block related functions Jin Yao
2019-10-21 16:08   ` Jiri Olsa
2019-10-15  5:33 ` [PATCH v2 2/5] perf util: Count the total cycles of all samples Jin Yao
2019-10-15  5:33 ` [PATCH v2 3/5] perf report: Sort by sampled cycles percent per block for stdio Jin Yao
2019-10-15  8:41   ` Jiri Olsa
2019-10-15 14:53     ` Jin, Yao [this message]
2019-10-16 10:15       ` Jiri Olsa
2019-10-16 10:51         ` Jin, Yao
2019-10-16 12:53           ` Jiri Olsa
2019-10-16 13:09             ` Jin, Yao
2019-10-21  6:56             ` Jin, Yao
2019-10-21 14:04               ` Jiri Olsa
2019-10-21 16:07                 ` Jiri Olsa
2019-10-21 16:07   ` Jiri Olsa
2019-10-22  0:57     ` Jin, Yao
2019-10-21 16:08   ` Jiri Olsa
2019-10-22  1:04     ` Jin, Yao
2019-10-15  5:33 ` [PATCH v2 4/5] perf report: Support --percent-limit for total_cycles Jin Yao
2019-10-15  5:33 ` [PATCH v2 5/5] perf report: Sort by sampled cycles percent per block for tui Jin Yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6882f3ae-0f8d-5a01-7fd5-5b9f9c93f9ac@linux.intel.com \
    --to=yao.jin@linux.intel.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®