title: Get total CPU usage of an app from simpleperf recording
body: <p>I'm using simpleperf to profile my Android application, as I found the Android Profiler to be very limited. </p>
  
  <p>I'm recording a sample using</p>
  
  <pre><code>./app_profiler.py -p com.foo.myapp -r "-e task-clock:u -f 1000 -g"
  </code></pre>
  
  <p>This then allows me to nicely display the CPU usage of all my threads <em>relative to the whole app</em>. Is there a way to show me how much of the available CPU power was actually used? I.e. report <em>absolute</em> usage numbers?</p>
  
  <p>Some options I found to be less than ideal:</p>
  
  <ul>
  <li><code>top</code> shows it live, but doesn't give a good average (same as the Android Profiler)</li>
  <li><code>simpleperf stat</code> to shows it very nicely, but runs independently of the <code>simpleperf record</code></li>
  <li>Add <code>--duration 60</code> to the record command and then divide the reported milliseconds for <code>task-clock</code> by that amount. This however seems to be off by up to +/-50%! And I have to know in advance how long to record.</li>
  </ul>
  
  <p>The normal <code>perf</code> tool has a <code>perf stat record</code> command that displays stats based on a recording, which seems exactly like what I'm looking for, but simpleperf doesn't support that.</p>