diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-13 11:00:47 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-13 11:00:47 +0100 |
commit | fd46f8951ea78de4525f1db5f0f7e0988b6685a0 (patch) | |
tree | 83a35a6a02afe59e3b699ce4de29ceff0a90ad7d /src/drivers/mpu6000/mpu6000.cpp | |
parent | 6398fcfed9447109a34345ceac9df565f6bff183 (diff) | |
parent | 78b603bb3532e927e617fe1946a1090b509e72ad (diff) | |
download | px4-firmware-fd46f8951ea78de4525f1db5f0f7e0988b6685a0.tar.gz px4-firmware-fd46f8951ea78de4525f1db5f0f7e0988b6685a0.tar.bz2 px4-firmware-fd46f8951ea78de4525f1db5f0f7e0988b6685a0.zip |
Merged master into nuttx_bringup
Diffstat (limited to 'src/drivers/mpu6000/mpu6000.cpp')
-rw-r--r-- | src/drivers/mpu6000/mpu6000.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/drivers/mpu6000/mpu6000.cpp b/src/drivers/mpu6000/mpu6000.cpp index 6cac28a7d..168b34ea9 100644 --- a/src/drivers/mpu6000/mpu6000.cpp +++ b/src/drivers/mpu6000/mpu6000.cpp @@ -251,6 +251,8 @@ private: perf_counter_t _bad_registers; perf_counter_t _good_transfers; perf_counter_t _reset_retries; + perf_counter_t _system_latency_perf; + perf_counter_t _controller_latency_perf; uint8_t _register_wait; uint64_t _reset_wait; @@ -491,6 +493,8 @@ MPU6000::MPU6000(int bus, const char *path_accel, const char *path_gyro, spi_dev _bad_registers(perf_alloc(PC_COUNT, "mpu6000_bad_registers")), _good_transfers(perf_alloc(PC_COUNT, "mpu6000_good_transfers")), _reset_retries(perf_alloc(PC_COUNT, "mpu6000_reset_retries")), + _system_latency_perf(perf_alloc_once(PC_ELAPSED, "sys_latency")), + _controller_latency_perf(perf_alloc_once(PC_ELAPSED, "ctrl_latency")), _register_wait(0), _reset_wait(0), _accel_filter_x(MPU6000_ACCEL_DEFAULT_RATE, MPU6000_ACCEL_DEFAULT_DRIVER_FILTER_FREQ), @@ -1731,6 +1735,9 @@ MPU6000::measure() _gyro->parent_poll_notify(); if (!(_pub_blocked)) { + /* log the time of this report */ + perf_begin(_controller_latency_perf); + perf_begin(_system_latency_perf); /* publish it */ orb_publish(_accel_orb_id, _accel_topic, &arb); } |