title: Analyzing execution times with perf script
body: <p>I'm trying to measure exact execution time/cycles for specific functions with oerf tool. I added events for entering and returning from each function by using perf probe. I can see the functions with perf script like so:</p>
  
  <pre><code>  perf script --header -F comm,pid,tid,cpu,time,event
  </code></pre>
  
  <p>This is what I get:</p>
  
  <pre><code>  kpktgend_1 33688/33688 [001] 151433.505544: probe:pktgen_alloc_skb:
    kpktgend_1 33688/33688 [001] 151433.505545: probe:pktgen_alloc_skb_1:
    kpktgend_1 33688/33688 [001] 151433.505546: probe:mlx5e_xmit:
    kpktgend_1 33688/33688 [001] 151433.505546: probe:mlx5e_xmit_1:
    kpktgend_1 33688/33688 [001] 151433.505547: probe:pktgen_alloc_skb:
    kpktgend_1 33688/33688 [001] 151433.505547: probe:pktgen_alloc_skb_1:
    kpktgend_1 33688/33688 [001] 151433.505548: probe:mlx5e_xmit:
    kpktgend_1 33688/33688 [001] 151433.505549: probe:mlx5e_xmit_1:
  </code></pre>
  
  <p>Each "event" is entry point to the function and "event"_1 is the return point from the function.
  This is pretty close to what I want, as you can see I get the timing of the calls.</p>
  
  <p>Three questions:</p>
  
  <ol>
  <li>What is the format of the time? Is it seconds? This might seem so as I expect mlx5e_xmit to take less than a microsecond.</li>
  <li>Can I get a better resolution? I need the exact time and as you can see above some functions start and end on the same timestamp.</li>
  <li>Can I get number of cycles instead of time? This would give me the best resolution.</li>
  </ol>