Newbie
Newbie

Reputation: 11

Timing analysis of blocks in GNU Radio

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?

Upvotes: 1

Views: 326

Answers (1)

Marcus Müller
Marcus Müller

Reputation: 36442

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.

Upvotes: 1

Related Questions