From ef39b965bebd97d940b2ab1c24014d1726b743a5 Mon Sep 17 00:00:00 2001 From: Jiani Liu Date: Thu, 30 May 2019 13:24:59 +0800 Subject: [PATCH] qcacld-3.0: Add qtime & host_time in __hdd_wlan_tsf_show Add qtime & host_time in __hdd_wlan_tsf_show, so that "cat tsf" will print out qtime and host_time at the instant. Change-Id: I4da440f92b7415440f9064a49777c3c3680ac1b1 CRs-Fixed: 2461503 --- core/hdd/src/wlan_hdd_tsf.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index f79ce52f9910..7e97f6d2b5cd 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -928,7 +928,7 @@ static ssize_t __hdd_wlan_tsf_show(struct device *dev, struct hdd_station_ctx *hdd_sta_ctx; struct hdd_adapter *adapter; struct hdd_context *hdd_ctx; - uint64_t tsf_sync_qtime; + uint64_t tsf_sync_qtime, host_time, reg_qtime, qtime; ssize_t size; struct net_device *net_dev = container_of(dev, struct net_device, dev); @@ -955,17 +955,25 @@ static ssize_t __hdd_wlan_tsf_show(struct device *dev, tsf_sync_qtime = adapter->last_tsf_sync_soc_time; do_div(tsf_sync_qtime, NSEC_PER_USEC); + reg_qtime = qdf_get_log_timestamp(); + host_time = hdd_get_monotonic_host_time(hdd_ctx); + + qtime = qdf_log_timestamp_to_usecs(reg_qtime); + do_div(host_time, NSEC_PER_USEC); + if (adapter->device_mode == QDF_STA_MODE || adapter->device_mode == QDF_P2P_CLIENT_MODE) { - size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM\n", + size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM %llu %llu\n", buf, adapter->last_target_time, tsf_sync_qtime, - hdd_sta_ctx->conn_info.bssid.bytes); + hdd_sta_ctx->conn_info.bssid.bytes, + qtime, host_time); } else { - size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM\n", + size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM %llu %llu\n", buf, adapter->last_target_time, tsf_sync_qtime, - adapter->mac_addr.bytes); + adapter->mac_addr.bytes, + qtime, host_time); } return size;