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]
Date:   Thu, 10 May 2018 08:29:23 +0800
From:   "Jin, Yao" <yao.jin@...ux.intel.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     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
Subject: Re: [PATCH] perf annotate: Display multiple events for --stdio



On 5/10/2018 12:42 AM, Arnaldo Carvalho de Melo wrote:
> Em Wed, May 09, 2018 at 11:57:15PM +0800, Jin Yao escreveu:
>> When we perform following command lines:
>>
>> perf record -e "{cycles,branches}" ./div
>> perf annotate main --stdio
>>
>> Only shows one event "cycles" and the displaying format is not correct.
>>
>>   Percent         |      Source code & Disassembly of div for cycles (44550 samples)
>> -----------------------------------------------------------------------------------
> 
> Please indent command output (two spaces before all lines) to avoid
> scripts breaking due to mistaking lines starting with --- as the end of
> the patch.
> 
> Applying.
> 
> - Arnaldo
> 

Breaking the scripts? Oh, very sorry about that, I will be careful next 
time.

Thanks
Jin Yao

>>                   :
>>                   :
>>                   :
>>                   :            Disassembly of section .text:
>>                   :
>>                   :            00000000004004b0 <main>:
>>                   :            main():
>>                   :
>>                   :                    return i;
>>                   :            }
>>                   :
>>                   :            int main(void)
>>                   :            {
>>      0.00 :   4004b0:       push   %rbx
>>                   :                    int i;
>>                   :                    int flag;
>>                   :                    volatile double x = 1212121212, y = 121212;
>>                   :
>>                   :                    s_randseed = time(0);
>>      0.00 :   4004b1:       xor    %edi,%edi
>>                   :                    srand(s_randseed);
>>      0.00 :   4004b3:       mov    $0x77359400,%ebx
>>                   :
>>                   :                    return i;
>>                   :            }
>>                   :
>>
>> The issue is the value of nr_percent is hardcoded to 1.
>> This patch fixes it.
>>
>> With this patch, the output is:
>>
>>   Percent         |      Source code & Disassembly of div for cycles (44550 samples)
>> -----------------------------------------------------------------------------------
>>                   :
>>                   :
>>                   :
>>                   :            Disassembly of section .text:
>>                   :
>>                   :            00000000004004b0 <main>:
>>                   :            main():
>>                   :
>>                   :                    return i;
>>                   :            }
>>                   :
>>                   :            int main(void)
>>                   :            {
>>      0.00    0.00 :   4004b0:       push   %rbx
>>                   :                    int i;
>>                   :                    int flag;
>>                   :                    volatile double x = 1212121212, y = 121212;
>>                   :
>>                   :                    s_randseed = time(0);
>>      0.00    0.00 :   4004b1:       xor    %edi,%edi
>>                   :                    srand(s_randseed);
>>      0.00    0.00 :   4004b3:       mov    $0x77359400,%ebx
>>                   :
>>                   :                    return i;
>>                   :            }
>>
>> Signed-off-by: Jin Yao <yao.jin@...ux.intel.com>
>> ---
>>   tools/perf/util/annotate.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
>> index 536ee14..5d74a30 100644
>> --- a/tools/perf/util/annotate.c
>> +++ b/tools/perf/util/annotate.c
>> @@ -1263,6 +1263,9 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start
>>   				max_percent = sample->percent;
>>   		}
>>   
>> +		if (al->samples_nr > nr_percent)
>> +			nr_percent = al->samples_nr;
>> +
>>   		if (max_percent < min_pcnt)
>>   			return -1;
>>   
>> -- 
>> 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ