diff --git a/qdf/inc/qdf_mc_timer.h b/qdf/inc/qdf_mc_timer.h index d5862074d7..6864a5514c 100644 --- a/qdf/inc/qdf_mc_timer.h +++ b/qdf/inc/qdf_mc_timer.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2014-2019, 2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -72,6 +73,8 @@ typedef struct qdf_mc_timer_s { qdf_mutex_t lock; QDF_TIMER_TYPE type; QDF_TIMER_STATE state; + qdf_time_t timer_start_jiffies; + qdf_time_t timer_end_jiffies; } qdf_mc_timer_t; diff --git a/qdf/linux/src/qdf_mc_timer.c b/qdf/linux/src/qdf_mc_timer.c index 6926702481..b7e342e7c7 100644 --- a/qdf/linux/src/qdf_mc_timer.c +++ b/qdf/linux/src/qdf_mc_timer.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -692,6 +693,12 @@ QDF_STATUS qdf_mc_timer_start(qdf_mc_timer_t *timer, uint32_t expiration_time) timer->state = QDF_TIMER_STATE_RUNNING; + /* Save the jiffies value in a per-timer context in qdf_mc_timer_t + * It will help the debugger to know the exact time at which the host + * starts the QDF timer. + */ + timer->timer_start_jiffies = jiffies; + /* get the thread ID on which the timer is being started */ timer->platform_info.thread_id = current->pid; diff --git a/scheduler/src/scheduler_api.c b/scheduler/src/scheduler_api.c index 0a2764b593..d4e07e98cb 100644 --- a/scheduler/src/scheduler_api.c +++ b/scheduler/src/scheduler_api.c @@ -605,6 +605,13 @@ void scheduler_mc_timer_callback(qdf_mc_timer_t *timer) if (!timer) return; + /* + * Save the jiffies value in a per-timer context in qdf_mc_timer_t. + * It will help the debugger to know the exact time at which the host + * stops/expiry of the QDF timer. + */ + timer->timer_end_jiffies = jiffies; + qdf_spin_lock_irqsave(&timer->platform_info.spinlock); switch (timer->state) {