Explorar o código

qcacmn: Save jiffies value for QDF timer

Save the jiffies value in a per-timer context
in qdf_mc_timer_t while processing qdf_mc_timer_start
and scheduler_mc_timer_callback. It will help the
debugger to know the exact time gap between the
start and stop/expiry of the QDF timer.

Change-Id: Ia79011971184de9390632253417ee35dc7d26cf8
CRs-Fixed: 3283746
abhinav kumar %!s(int64=2) %!d(string=hai) anos
pai
achega
2888b71da7
Modificáronse 3 ficheiros con 17 adicións e 0 borrados
  1. 3 0
      qdf/inc/qdf_mc_timer.h
  2. 7 0
      qdf/linux/src/qdf_mc_timer.c
  3. 7 0
      scheduler/src/scheduler_api.c

+ 3 - 0
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;
 
 

+ 7 - 0
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;
 

+ 7 - 0
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) {