diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-20 21:10:33 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-20 21:10:33 +0100 |
commit | 3ad9dd030c01e233a78aebfd2e20e67168962255 (patch) | |
tree | 8f2ee5f1d61be35efc230a6a5e76eeba7502659a /src/drivers/px4io/px4io.cpp | |
parent | 8c518aa23710ba0b9ad0c7ad2c03428ce8ddb290 (diff) | |
download | px4-firmware-3ad9dd030c01e233a78aebfd2e20e67168962255.tar.gz px4-firmware-3ad9dd030c01e233a78aebfd2e20e67168962255.tar.bz2 px4-firmware-3ad9dd030c01e233a78aebfd2e20e67168962255.zip |
Added performance counter for write IOCTL
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index e898b3e60..9e84bf929 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -244,7 +244,8 @@ private: int _mavlink_fd; ///<mavlink file descriptor. This is opened by class instantiation and Doesn't appear to be usable in main thread. int _thread_mavlink_fd; ///<mavlink file descriptor for thread. - perf_counter_t _perf_update; ///<local performance counter + perf_counter_t _perf_update; ///<local performance counter for status updates + perf_counter_t _perf_write; ///<local performance counter for PWM control writes /* cached IO state */ uint16_t _status; ///<Various IO status flags @@ -459,6 +460,7 @@ PX4IO::PX4IO(device::Device *interface) : _mavlink_fd(-1), _thread_mavlink_fd(-1), _perf_update(perf_alloc(PC_ELAPSED, "px4io update")), + _perf_write(perf_alloc(PC_ELAPSED, "px4io write")), _status(0), _alarms(0), _t_actuators(-1), @@ -2155,7 +2157,10 @@ PX4IO::write(file * /*filp*/, const char *buffer, size_t len) count = _max_actuators; if (count > 0) { + + perf_begin(_perf_write); int ret = io_reg_set(PX4IO_PAGE_DIRECT_PWM, 0, (uint16_t *)buffer, count); + perf_end(_perf_write); if (ret != OK) return ret; |