Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-22 Thread Taeung Song
On 03/21/2017 11:21 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Mar 21, 2017 at 11:14:07AM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: And, I tested by perf-stat on the same situation as below. $ perf stat -e

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-22 Thread Taeung Song
On 03/21/2017 11:21 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Mar 21, 2017 at 11:14:07AM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: And, I tested by perf-stat on the same situation as below. $ perf stat -e

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-21 Thread Taeung Song
Hi, On 03/21/2017 11:21 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Mar 21, 2017 at 11:14:07AM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: And, I tested by perf-stat on the same situation as below. $ perf stat -e

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-21 Thread Taeung Song
Hi, On 03/21/2017 11:21 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Mar 21, 2017 at 11:14:07AM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: And, I tested by perf-stat on the same situation as below. $ perf stat -e

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-21 Thread Arnaldo Carvalho de Melo
Em Tue, Mar 21, 2017 at 11:14:07AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: > > And, > > I tested by perf-stat on the same situation as below. > > > > $ perf stat -e "{cycles,page-faults,branch-misses}" ./old > 6623856 > >

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-21 Thread Arnaldo Carvalho de Melo
Em Tue, Mar 21, 2017 at 11:14:07AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: > > And, > > I tested by perf-stat on the same situation as below. > > > > $ perf stat -e "{cycles,page-faults,branch-misses}" ./old > 6623856 > >

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-21 Thread Arnaldo Carvalho de Melo
Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: > And, > I tested by perf-stat on the same situation as below. > > $ perf stat -e "{cycles,page-faults,branch-misses}" ./old6623856 Please always try to spell out all the steps needed to get to some result, for instance, in

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-21 Thread Arnaldo Carvalho de Melo
Em Tue, Mar 21, 2017 at 07:20:20AM +0900, Taeung Song escreveu: > And, > I tested by perf-stat on the same situation as below. > > $ perf stat -e "{cycles,page-faults,branch-misses}" ./old6623856 Please always try to spell out all the steps needed to get to some result, for instance, in

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-20 Thread Taeung Song
And, I tested by perf-stat on the same situation as below. $ perf stat -e "{cycles,page-faults,branch-misses}" ./old sum' is zero.. util/annotate.c:1660~1661 1660h = annotation__histogram(notes, evidx + k); 1661src_line->samples[k].percent = 100.0 * h->addr[i] / h->sum;

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-20 Thread Taeung Song
And, I tested by perf-stat on the same situation as below. $ perf stat -e "{cycles,page-faults,branch-misses}" ./old sum' is zero.. util/annotate.c:1660~1661 1660h = annotation__histogram(notes, evidx + k); 1661src_line->samples[k].percent = 100.0 * h->addr[i] / h->sum;

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-20 Thread Taeung Song
Hi Arnaldo :) Here the perf.data is, https://www.dropbox.com/s/nr4nnv8g3cipluf/perf.data?dl=1=1 I tested as below. $ perf record -e "{cycles,page-faults,branch-misses}" ./old /dev/null | grep -i nan | head -3 29.04-nan1.52 old_pack_knapsack.c:34 28.27-nan0.00

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-20 Thread Taeung Song
Hi Arnaldo :) Here the perf.data is, https://www.dropbox.com/s/nr4nnv8g3cipluf/perf.data?dl=1=1 I tested as below. $ perf record -e "{cycles,page-faults,branch-misses}" ./old /dev/null | grep -i nan | head -3 29.04-nan1.52 old_pack_knapsack.c:34 28.27-nan0.00

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-20 Thread Arnaldo Carvalho de Melo
Em Mon, Mar 20, 2017 at 11:56:55AM +0900, Taeung Song escreveu: > Currently perf-annotate with --print-line can print > -nan(0x8) because of division by zero > when calculating percent. > > So if a sum of samples is zero, skip calculating percent. Tried to reproduce it here,

Re: [PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-20 Thread Arnaldo Carvalho de Melo
Em Mon, Mar 20, 2017 at 11:56:55AM +0900, Taeung Song escreveu: > Currently perf-annotate with --print-line can print > -nan(0x8) because of division by zero > when calculating percent. > > So if a sum of samples is zero, skip calculating percent. Tried to reproduce it here,

[PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-19 Thread Taeung Song
Currently perf-annotate with --print-line can print -nan(0x8) because of division by zero when calculating percent. So if a sum of samples is zero, skip calculating percent. Before: $ perf annotate --stdio -l Sorted summary for file /home/taeung/workspace/a.out

[PATCH 2/4] perf annotate: Avoid division by zero when calculating percent

2017-03-19 Thread Taeung Song
Currently perf-annotate with --print-line can print -nan(0x8) because of division by zero when calculating percent. So if a sum of samples is zero, skip calculating percent. Before: $ perf annotate --stdio -l Sorted summary for file /home/taeung/workspace/a.out