T hacks: time_meas: add a periodic tracing mode
Useful to debug realtime issues, for example when calling a periodical routine, if it's not programmed carefully enough, it may be that the first call takes way longer than the next ones (for example it uses some memory that is not mapped in the process, leading to many page faults the first time it's executed). Having a periodic log for the timing of this routine with min/avg/max/count will reveal that a call is way longer than average and will help in finding where exactly in the code the time is spent, thanks to the ease of use of the T tracer; you put T(T_XX, T_INT(1)) just before the code you want to measure, you put T(T_XX, T_INT(0)) just after and time_meas will show the delta time between those events. Then you cut the routine in smaller pieces, measure with T(1)/T(0), and you finally reach the small guilty part that takes too long.
parent
44637de3
No related branches found
No related tags found
Please register or sign in to comment