2 Replies Latest reply on Mar 7, 2012 11:27 AM by ioanolt

    What is the formula for IC fetch rate, IC miss rate and IC miss ratio

    ioanolt

      I am looking at an Instruction cache report and I see the following info:

       

      Ret inst  : 378

      IC fetches  : 128

      IC misses  : 187

      IC fetch rate : 3.98

      IC miss rate : 0.75

      IC miss ratio : 1.23

      From what I understand, the IC fetch rate, IC miss rate and IC miss ratio are all calculated based on the IC fetches and IC misses counters. Is that true? If yes, what is the formula that was used?

       

      Thanks!

      -Ioan

        • Re: What is the formula for IC fetch rate, IC miss rate and IC miss ratio

          Hi Loan,

           

          IC fetch rate = IC fetches / Retired instructions

          IC miss rate = IC misses / Retired instructions

          IC miss ratio = IC misses / IC fetches

          The calculations are normalized by the event counts.  For example, if you used the "Investigate instruction access" configuration, the Retired instructions event takes a sample every 250000 events, but the IC misses event takes a sample every 25000 events.

           

          What profile configuration, CodeAnalyst version, and CPU family did you use to get the sample counts?  Those calculations look wrong.

           

          Thanks,

          -=Frank

          1 of 1 people found this helpful
            • Re: What is the formula for IC fetch rate, IC miss rate and IC miss ratio
              ioanolt

              Thanks Frank.

               

              Actually, I think I know what's going on.

               

              The numbers that I gave in the post are for the entire process. If I expand the the tree all the way I could see that the calculations for individual lines look good (just like your formula) but the aggregates (function, process) are all wrong.

               

              The problem seems to be the way CodeAnalyst aggregates individual lines. Currently, it sums up everything, both raw counters (IC fetches, IC misses) and calculated values (IC fetch rate, IC miss rate, IC miss ratio). Instead, it should sum up raw counters and re-apply the formulas for calculated values.

               

              Put in math language, Code Analyst is doing this:

               

              AggregateValue = x1/y1 + x2/y2 + ... + xn/yn

               

              What it should be doing is:

               

              AggregateValue = (x1 + x2 + ... + xn) / (y1 + y2 + ... + yn).

               

              I hope it makes sense.

               

              Thanks!

              Ioan