title: How to find number of TLB misses in a code snippet?
body: <p>How can I calculate number of TLB misses in a code like the following code snippet assuming the page size is 1KB:</p>
  
  <pre><code>int i;
  int p[1024];
  for (i=0; i&lt;1024; i++)
      p[i]=0;
  </code></pre>
  
  <p>I am interested in knowing the general rules to be able to calculate number of TLB misses in almost every given code snippet beside knowing the #TLB misses for this one.</p>