Commit Graph

4 Commits

Author SHA1 Message Date
Lucas De Marchi 4a18108600 AP_HAL_Linux: rename min, max and avg fields
These were probably named otherwise in order not to conflict with
min/max macros from math.h. We don't have this problem anymore.
2016-06-23 19:08:14 -03:00
Lucas De Marchi b8e3e549c7 AP_HAL_Linux: Perf: add debug method
Test code for integration with another thread to pull data from internal
perf counters.  Since we are using the timer thread here, there's no
retry mechanism and we only print that data can be corrupted.
2016-06-23 19:08:14 -03:00
Lucas De Marchi 1727418dc9 AP_HAL_Linux: Perf: make lttng use internal fields
Instead of creating a new object Perf_Lttng copying the necessaries
fields, just make a tighter integration with the internal perf counters
and re-use the same fields.
2016-06-23 19:06:30 -03:00
Lucas De Marchi 619ce23799 AP_HAL_Linux: Perf: rework integration with other tools
The idea is to leave the internal perf enabled all the time, like it is
in PX4, and then allow the integration with lttng on top. Next step
would be to runtime enable/disable only the perf counters we are
interested in.

This also changes the structure so it's easy to allow another thread to
pull data from the Perf object. A rw lock protects from addition of new
counters and an atomic unsigned int allows other threads to do a
lockless copy of the data.

In order for this to work the allocation was changed to use a single
memory pool instead of returning a calloc'ed data for each perf counter.
Since most of our counters are of ' elapsed' type, don't bother using a
smaller struct for the 'count' type
2016-06-23 19:06:30 -03:00