瀏覽代碼

qcacmn: Send kernel time to userspace

Send kernel timestamp to userspace via a
new vendor attribute
QCA_WLAN_VENDOR_ATTR_DIAG_KERNEL_TIMESTAMP.

Change-Id: Iec957f0516c06369e0d2991d96936cb1f7fff5f4
CRs-Fixed: 3150781
abhinav kumar 3 年之前
父節點
當前提交
1e20923d2b
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 13 0
      qdf/inc/qdf_time.h
  2. 1 0
      qdf/linux/src/qdf_trace.c

+ 13 - 0
qdf/inc/qdf_time.h

@@ -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
@@ -336,6 +337,18 @@ static inline int64_t qdf_ktime_to_ms(qdf_ktime_t ktime)
 	return __qdf_ktime_to_ms(ktime);
 }
 
+/**
+ * qdf_ktime_to_us - Convert the qdf_ktime_t object into microseconds
+ * @ktime: time as qdf_ktime_t object
+ *
+ * Return: qdf_ktime_t in microseconds
+ */
+
+static inline int64_t qdf_ktime_to_us(qdf_ktime_t ktime)
+{
+	return __qdf_time_ktime_to_us(ktime);
+}
+
 /**
  * qdf_ktime_to_ns - Convert the qdf_ktime_t object into nanoseconds
  * @ktime: time as qdf_ktime_t object

+ 1 - 0
qdf/linux/src/qdf_trace.c

@@ -1826,6 +1826,7 @@ void qdf_fill_wlan_connectivity_log(enum qdf_proto_type type,
 	uint8_t pkt_type;
 
 	log_buf.timestamp_us = qdf_get_time_of_the_day_ms() * 1000;
+	log_buf.ktime_us = qdf_ktime_to_us(qdf_ktime_get());
 	log_buf.vdev_id = vdev_id;
 	if (type == QDF_PROTO_TYPE_DHCP) {
 		log_buf.log_subtype = qdf_subtype_to_wlan_main_tag(subtype);