2019-11-09 02:48:59

by Andi Kleen

[permalink] [raw]
Subject: Re: [QUESTION]perf stat: comment of miss ratio

> Relevant code is checked to make sure that the ratio is calculated by
>
> L1-dcache-load-misses/L1-dcache-loads, data "7.58%=30249/399189*100%" also
>
> proves this conclusion.
>
> So, I'm not sure why we use "of all L1-dcache hits" here to describe miss
> ratio,

Yes you're right it should be "of all L1-dcache accesses"

Please send a patch to fix the string and also check if this isn't wrong with some other
ratio too.

-Andi


2019-11-09 03:20:43

by Qi Liu

[permalink] [raw]
Subject: Re: [QUESTION]perf stat: comment of miss ratio



On 2019/11/9 10:47, Andi Kleen wrote:
>> Relevant code is checked to make sure that the ratio is calculated by
>>
>> L1-dcache-load-misses/L1-dcache-loads, data "7.58%=30249/399189*100%" also
>>
>> proves this conclusion.
>>
>> So, I'm not sure why we use "of all L1-dcache hits" here to describe miss
>> ratio,
>
> Yes you're right it should be "of all L1-dcache accesses"
>
> Please send a patch to fix the string and also check if this isn't wrong with some other
> ratio too.
>
> -Andi
>
> .
>
Hi Andi:
Thanks for your reply firstly.
I check the code and find that "of all...hits" is also used to describe miss ratio of
L1-icache, dTLB cache, iTLB cache, LL-cache. Relevant code as follow:

stat-shadow.c:509: out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-dcache hits", ratio);
stat-shadow.c:530: out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-icache hits", ratio);
stat-shadow.c:550: out->print_metric(config, out->ctx, color, "%7.2f%%", "of all dTLB cache hits", ratio);
stat-shadow.c:570: out->print_metric(config, out->ctx, color, "%7.2f%%", "of all iTLB cache hits", ratio);
stat-shadow.c:590: out->print_metric(config, out->ctx, color, "%7.2f%%", "of all LL-cache hits", ratio);
stat-shadow.c:875: print_metric(config, ctxp, NULL, NULL, "of all L1-dcache hits", 0);
stat-shadow.c:885: print_metric(config, ctxp, NULL, NULL, "of all L1-icache hits", 0);
stat-shadow.c:895: print_metric(config, ctxp, NULL, NULL, "of all dTLB cache hits", 0);
stat-shadow.c:905: print_metric(config, ctxp, NULL, NULL, "of all iTLB cache hits", 0);
stat-shadow.c:915: print_metric(config, ctxp, NULL, NULL, "of all LL-cache hits", 0);

So, may I send a patch to fix all these strings?

Thanks,
liuqi


2019-11-09 18:48:29

by Andi Kleen

[permalink] [raw]
Subject: Re: [QUESTION]perf stat: comment of miss ratio

> So, may I send a patch to fix all these strings?

Yes, probably needed for all of them.

-Andi

2019-11-13 10:47:50

by John Garry

[permalink] [raw]
Subject: Re: [QUESTION]perf stat: comment of miss ratio

On 09/11/2019 02:47, Andi Kleen wrote:
>> Relevant code is checked to make sure that the ratio is calculated by
>>
>> L1-dcache-load-misses/L1-dcache-loads, data "7.58%=30249/399189*100%" also
>>
>> proves this conclusion.
>>
>> So, I'm not sure why we use "of all L1-dcache hits" here to describe miss
>> ratio,
>
> Yes you're right it should be "of all L1-dcache accesses"
>
> Please send a patch to fix the string and also check if this isn't wrong with some other
> ratio too.
>

" 399,189 L1-dcache-loads # 246.396 M/sec
30,249 L1-dcache-load-misses # 7.58% of all L1-dcache
hits (18.04%)"


If accesses and loads are equivalent, could we use consistent terminology?

Thanks,
John