diff --git a/qdf/inc/qdf_lock.h b/qdf/inc/qdf_lock.h index 363113598b..0870141b5e 100644 --- a/qdf/inc/qdf_lock.h +++ b/qdf/inc/qdf_lock.h @@ -90,13 +90,13 @@ do { \ uint64_t BEFORE_LOCK_time; \ uint64_t AFTER_LOCK_time; \ bool BEFORE_LOCK_is_locked = was_locked; \ - BEFORE_LOCK_time = qdf_get_log_timestamp(); \ + BEFORE_LOCK_time = qdf_get_log_timestamp_lightweight(); \ do {} while (0) #define AFTER_LOCK(lock, func) \ lock->stats.acquired_by = func; \ - AFTER_LOCK_time = qdf_get_log_timestamp(); \ + AFTER_LOCK_time = qdf_get_log_timestamp_lightweight(); \ lock->stats.acquired++; \ lock->stats.last_acquired = AFTER_LOCK_time; \ if (BEFORE_LOCK_is_locked) { \ @@ -121,11 +121,11 @@ do { \ do { \ uint64_t BEFORE_LOCK_time; \ uint64_t AFTER_LOCK_time; \ - BEFORE_LOCK_time = qdf_get_log_timestamp(); \ + BEFORE_LOCK_time = qdf_get_log_timestamp_lightweight(); \ do {} while (0) #define AFTER_TRYLOCK(lock, trylock_return, func) \ - AFTER_LOCK_time = qdf_get_log_timestamp(); \ + AFTER_LOCK_time = qdf_get_log_timestamp_lightweight(); \ if (trylock_return) { \ lock->stats.acquired++; \ lock->stats.last_acquired = AFTER_LOCK_time; \ @@ -138,7 +138,7 @@ do { \ /* max_hold_time in US */ #define BEFORE_UNLOCK(lock, max_hold_time) \ do {\ - uint64_t held_time = qdf_get_log_timestamp() - \ + uint64_t held_time = qdf_get_log_timestamp_lightweight() - \ lock->stats.last_acquired; \ lock->stats.held_time += held_time; \ \ diff --git a/qdf/inc/qdf_time.h b/qdf/inc/qdf_time.h index 31fb1c8be9..3dfbfcc9a1 100644 --- a/qdf/inc/qdf_time.h +++ b/qdf/inc/qdf_time.h @@ -281,6 +281,21 @@ static inline uint64_t qdf_log_timestamp_to_usecs(uint64_t time) return time; } + +/** + * qdf_get_log_timestamp_lightweight - get time stamp for logging + * For adrastea this API returns QTIMER tick which is needed to synchronize + * host and fw log timestamps + * For ROME and other discrete solution this API returns system boot time stamp + * + * Return: + * QTIMER ticks(19.2MHz) for adrastea + * System tick for rome and other 3rd party platform solutions + */ +static inline uint64_t qdf_get_log_timestamp_lightweight(void) +{ + return __qdf_get_log_timestamp(); +} #else #define QDF_LOG_TIMESTAMP_UNIT KERNEL_LOG #define QDF_LOG_TIMESTAMP_CYCLES_PER_10_US 10 @@ -290,6 +305,14 @@ static inline uint64_t qdf_log_timestamp_to_usecs(uint64_t time) /* timestamps are already in micro seconds */ return time; } + +static inline uint64_t qdf_get_log_timestamp_lightweight(void) +{ + uint64_t timestamp_us; + + timestamp_us = __qdf_system_ticks_to_msecs(qdf_system_ticks()) * 1000; + return timestamp_us; +} #endif /* end of MSM_PLATFORM */ static inline void qdf_log_timestamp_to_secs(uint64_t time, uint64_t *secs,