1

Is there a way I can perform timing analysis of functions and blocks in GNU Radio.

Normally I would use timespec and then place them at several points where I want to check the time consumed.

For example :

ret=clock_gettime(CLOCK_REALTIME,&tin);

purrrr();

ret=clock_gettime(CLOCK_REALTIME,&tout);

time_cons = tout.tv_sec * 1000000000 + tout.tv_nsec - tin.tv_sec * 1000000000 - tin.tv_nsec 

Do we have something more efficient and handy than this in GNU Radio?

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
Newbie
  • 11
  • 4

1 Answers1

1

Yes! That's exactly what the performance counters were implemented for. You cab query those using Control Port. For info on how to use them, see the doxygen page. You might even want to export your own performance indicators!

Another, popular, choice would simply using the powers of perf. If you search for "perf record" and my name on the mailing list, you'll find quite a few usage examples.

In short: put what you want to benchmark in a function, run perf record -ag abcd on it, and then analyze the result using perf report.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Hey Marcus, thanks for replying. I also posted this query on mailing list but strangely it has not been accepted yet since yesterday ! Don't know whats the issue. Hence I posted it here! – Newbie Jan 27 '17 at 13:57
  • It's totally OK to ask here! Nothing bad about that. I just wanted to show you that in the archives, I have examples of how it's done. Click the link! – Marcus Müller Jan 27 '17 at 13:59
  • I'm in contact with the mailing list admins. There's nothing "hanging" anywhere. Are you sure you used the email address that you're subscribed with? Your email address might have "bounced" mailing list emails a couple of times, in which case it might have been removed from the list, so please check on https://lists.gnu.org/mailman/listinfo/discuss-gnuradio – Marcus Müller Jan 27 '17 at 14:11
  • Marcus, Yes you were right. I missed the warning mails and now I am unsubscribed from the mailing list. Whom shall I contact to re-enable my subscription ? Sumit – Newbie Jan 27 '17 at 16:40
  • simply re-register on https://lists.gnu.org/mailman/listinfo/discuss-gnuradio , @sumitstop – Marcus Müller Jan 27 '17 at 18:26