Re: [QUESTION]perf stat: comment of miss ratio

From: Qi Liu
Date: Fri Nov 08 2019 - 22:19:45 EST




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