title: What free tools can I use to profile C code on Windows?
body: <p>I'm a high-school student doing some C things where I'd like to profile my code to see where the actual performance bottlenecks are. I don't have much money, so I'd prefer free tools.</p>
  
  <p>I like to use the MinGW/GCC compiler toolchain. This is not something I'm stuck with, but I'd prefer tools that are capable of working with this.</p>
  
  <p>Features I need:</p>
  
  <ul>
  <li>See how much total time is spent in a certain function.</li>
  </ul>
  
  <p>Features I'd like:</p>
  
  <ul>
  <li>See how much time a line of code takes.</li>
  <li>Cross-platform (being able to use the same software on Linux &amp; Mac)</li>
  <li>See how often a function gets called (and how long each call takes on average).</li>
  <li>See what causes the time spent (cache misses, branch mispredictions, etc).</li>
  </ul>
  
  <p>I've tried using <code>gprof</code>, but I couldn't get it to work (it only shows <code>main</code> in the profile), and I've heard bad things about it, so what are my options?</p>