mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
nvethernet: suspend/resume time profiling
Add suspend/resume time to the debugfs so that tests can be written to monitor the SC7 KPI Bug 4202840 Change-Id: I92531277ab7149269186f8c61237931de99a3368 Signed-off-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3300390 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
This commit is contained in:
committed by
Jon Hunter
parent
b5a64188d3
commit
1960558372
@@ -25,6 +25,24 @@
|
||||
#include <soc/tegra/fuse.h>
|
||||
#include <soc/tegra/fuse-helper.h>
|
||||
#include <soc/tegra/virt/hv-ivc.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
static u64 ether_get_systime_us(void)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
return ktime_to_us(ktime_get_boottime());
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
struct timespec ts;
|
||||
get_monotonic_boottime(&ts);
|
||||
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
||||
#else
|
||||
struct timeval tv;
|
||||
do_gettimeofday(&tv);
|
||||
return ((u64)tv.tv_sec * 1000000) + tv.tv_usec;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief ether_get_free_timestamp_node - get free node for timestmap info for SKB
|
||||
@@ -7821,10 +7839,17 @@ int ether_suspend_noirq(struct device *dev)
|
||||
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
|
||||
struct osi_ioctl ioctl_data = {};
|
||||
unsigned int i = 0, chan = 0;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
u64 t0, t1;
|
||||
#endif
|
||||
|
||||
if (!netif_running(ndev))
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
t0 = ether_get_systime_us();
|
||||
#endif
|
||||
|
||||
tasklet_kill(&pdata->lane_restart_task);
|
||||
|
||||
/* stop workqueue */
|
||||
@@ -7873,6 +7898,10 @@ int ether_suspend_noirq(struct device *dev)
|
||||
pm_runtime_put_sync(pdata->dev);
|
||||
memset(&pdata->ptp_config, 0, sizeof(sizeof(struct hwtstamp_config)));
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
t1 = ether_get_systime_us();
|
||||
pdata->suspend_profile_time = (t1 - t0);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7881,9 +7910,15 @@ int ether_resume_noirq(struct device *dev)
|
||||
struct net_device *ndev = dev_get_drvdata(dev);
|
||||
struct ether_priv_data *pdata = netdev_priv(ndev);
|
||||
int ret = 0;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
u64 t0, t1;
|
||||
#endif
|
||||
|
||||
if (!netif_running(ndev))
|
||||
return 0;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
t0 = ether_get_systime_us();
|
||||
#endif
|
||||
|
||||
if (!device_may_wakeup(&ndev->dev) &&
|
||||
gpio_is_valid(pdata->phy_reset) &&
|
||||
@@ -7898,6 +7933,10 @@ int ether_resume_noirq(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
t1 = ether_get_systime_us();
|
||||
pdata->resume_profile_time = (t1 - t0);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -653,6 +653,10 @@ struct ether_priv_data {
|
||||
struct dentry *dbgfs_desc_dump;
|
||||
/** Register dump debug fs pointer */
|
||||
struct dentry *dbgfs_reg_dump;
|
||||
/** Holds the time in usec for suspend routine completion */
|
||||
u64 suspend_profile_time;
|
||||
/** Holds the time in usec for resume routine completion */
|
||||
u64 resume_profile_time;
|
||||
#endif
|
||||
#ifdef MACSEC_SUPPORT
|
||||
/** MACsec priv data */
|
||||
|
||||
@@ -4137,6 +4137,10 @@ static int ether_create_debugfs(struct ether_priv_data *pdata)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
debugfs_create_u64("suspend_profile_time", 0644, pdata->dbgfs_dir,
|
||||
&pdata->suspend_profile_time);
|
||||
debugfs_create_u64("resume_profile_time", 0644, pdata->dbgfs_dir,
|
||||
&pdata->resume_profile_time);
|
||||
exit:
|
||||
kfree(buf);
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user