IO driver: Log the total system latency up to the IO transfer

This commit is contained in:
Lorenz Meier
2015-01-07 17:16:15 +01:00
parent 7682160713
commit 4712c75dea
+3
View File
@@ -263,6 +263,7 @@ private:
perf_counter_t _perf_update; ///<local performance counter for status updates
perf_counter_t _perf_write; ///<local performance counter for PWM control writes
perf_counter_t _perf_chan_count; ///<local performance counter for channel number changes
perf_counter_t _perf_system_latency; ///< total system latency
/* cached IO state */
uint16_t _status; ///< Various IO status flags
@@ -494,6 +495,7 @@ PX4IO::PX4IO(device::Device *interface) :
_perf_update(perf_alloc(PC_ELAPSED, "io update")),
_perf_write(perf_alloc(PC_ELAPSED, "io write")),
_perf_chan_count(perf_alloc(PC_COUNT, "io rc #")),
_perf_system_latency(perf_alloc_once(PC_ELAPSED, "sys_latency")),
_status(0),
_alarms(0),
_t_actuator_controls_0(-1),
@@ -1086,6 +1088,7 @@ int
PX4IO::io_set_control_groups()
{
int ret = io_set_control_state(0);
perf_end(_perf_system_latency);
/* send auxiliary control groups */
(void)io_set_control_state(1);