lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79f0c49a-5f63-5ed7-bb37-fe5f0c0af1e1@linux.intel.com>
Date:   Wed, 19 Apr 2017 08:32:27 +0800
From:   "Jin, Yao" <yao.jin@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v4 5/5] perf report: Show branch type in callchain entry



On 4/19/2017 2:53 AM, Jiri Olsa wrote:
> On Wed, Apr 12, 2017 at 06:21:06AM +0800, Jin Yao wrote:
>
> SNIP
>
>>   static int counts_str_build(char *bf, int bfsize,
>>   			     u64 branch_count, u64 predicted_count,
>>   			     u64 abort_count, u64 cycles_count,
>> -			     u64 iter_count, u64 samples_count)
>> +			     u64 iter_count, u64 samples_count,
>> +			     struct branch_type_stat *brtype_stat)
>>   {
>> -	double predicted_percent = 0.0;
>> -	const char *null_str = "";
>> -	char iter_str[32];
>> -	char cycle_str[32];
>> -	char *istr, *cstr;
>>   	u64 cycles;
>> +	int printed, i = 0;
>>   
>>   	if (branch_count == 0)
>>   		return scnprintf(bf, bfsize, " (calltrace)");
>>   
>> +	printed = branch_type_str(brtype_stat, bf, bfsize);
>> +	if (printed)
>> +		i++;
>> +
>>   	cycles = cycles_count / branch_count;
>> +	if (cycles) {
>> +		if (i++)
>> +			printed += scnprintf(bf + printed, bfsize - printed,
>> +				" cycles:%" PRId64 "", cycles);
>> +		else
>> +			printed += scnprintf(bf + printed, bfsize - printed,
>> +				" (cycles:%" PRId64 "", cycles);
>> +	}
>>   
>>   	if (iter_count && samples_count) {
>> -		if (cycles > 0)
>> -			scnprintf(iter_str, sizeof(iter_str),
>> -				 " iterations:%" PRId64 "",
>> -				 iter_count / samples_count);
>> +		if (i++)
>> +			printed += scnprintf(bf + printed, bfsize - printed,
>> +				" iterations:%" PRId64 "",
>> +				iter_count / samples_count);
>>   		else
>> -			scnprintf(iter_str, sizeof(iter_str),
>> -				 "iterations:%" PRId64 "",
>> -				 iter_count / samples_count);
>> -		istr = iter_str;
> could you please put the change from using iter_str
> to bf into separate patch before the actual branch
> display change?
>
> it's hard to see if anything is broken ;-)
>
> thanks,
> jirka
Got it, I will separate the patches.

Thanks
Jin Yao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ