From 0fbf4c60b4adf3553df5febab9d9439a57d8524e Mon Sep 17 00:00:00 2001 From: Shreyas K K Date: Wed, 14 Apr 2021 20:28:30 +0530 Subject: [PATCH 1/4] drivers: qcom: Rename MSM_BOOT_TIME_MARKER Prefix MSM_BOOT_TIME_MARKER with QGKI to differentiate it as a vendor-specific config. Change-Id: Icf369a4b217722d997706d30ffaceaf08b3e8ee1 Signed-off-by: Shreyas K K --- drivers/soc/qcom/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 79fbcf918a78..a445b42b937a 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -395,9 +395,9 @@ config MSM_BOOT_STATS This figures are reported in mpm sleep clock cycles and have a resolution of 31 bits as 1 bit is used as an overflow check. -config MSM_BOOT_TIME_MARKER +config QGKI_MSM_BOOT_TIME_MARKER bool "Use MSM boot time marker reporting" - depends on MSM_BOOT_STATS + depends on MSM_BOOT_STATS && QGKI help Use this to mark msm boot kpi for measurement. An instrumentation for boot time measurement. From 5b9c90fb861d2af7ad080701c9f1547a88596336 Mon Sep 17 00:00:00 2001 From: Shreyas K K Date: Thu, 15 Apr 2021 14:23:09 +0530 Subject: [PATCH 2/4] drivers: Update boot marker config name Boot marker config name is changed from CONFIG_MSM_BOOT_TIME_MARKER to CONFIG_QGKI_MSM_BOOT_TIME_MARKER. Update the same. Change-Id: I2eaebf14821388cf28a064f9ec961e33c23d2577 Signed-off-by: Shreyas K K --- arch/arm/configs/vendor/sdxlemur.config | 2 +- arch/arm64/configs/vendor/gen3auto_QGKI.config | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 8 ++++---- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- drivers/soc/qcom/boot_stats.c | 2 +- drivers/soc/qcom/hab/hab_os.h | 2 +- include/soc/qcom/boot_stats.h | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/arm/configs/vendor/sdxlemur.config b/arch/arm/configs/vendor/sdxlemur.config index 96cb79f64b88..c1f0ec12f846 100644 --- a/arch/arm/configs/vendor/sdxlemur.config +++ b/arch/arm/configs/vendor/sdxlemur.config @@ -3,7 +3,7 @@ CONFIG_ARCH_SDXLEMUR=y CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y CONFIG_HWSPINLOCK_QCOM=y CONFIG_MSM_BOOT_STATS=y -CONFIG_MSM_BOOT_TIME_MARKER=y +CONFIG_QGKI_MSM_BOOT_TIME_MARKER=y CONFIG_QCOM_SMEM=y CONFIG_SLIMBUS=y CONFIG_IPC_LOGGING=y diff --git a/arch/arm64/configs/vendor/gen3auto_QGKI.config b/arch/arm64/configs/vendor/gen3auto_QGKI.config index 6500a1b246da..fb4142ea0b3e 100644 --- a/arch/arm64/configs/vendor/gen3auto_QGKI.config +++ b/arch/arm64/configs/vendor/gen3auto_QGKI.config @@ -63,7 +63,7 @@ CONFIG_PINCTRL_SX150X=y CONFIG_ADSPRPC_QGKI=y CONFIG_QCOM_APCS_IPC=y CONFIG_BLK_DEV_LOOP_MIN_COUNT=16 -CONFIG_MSM_BOOT_TIME_MARKER=y +CONFIG_QGKI_MSM_BOOT_TIME_MARKER=y CONFIG_BRIDGE_NF_EBTABLES=y CONFIG_BRIDGE_EBT_BROUTE=y CONFIG_BRIDGE=y diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index a7ef075dc115..4fadccc2f603 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -405,7 +405,7 @@ static int qcom_ethqos_add_ipaddr(struct ip_params *ip_info, } else { ETHQOSINFO("Assigned IPv4 address: %s\r\n", ip_info->ipv4_addr_str); -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER place_marker("M - Etherent Assigned IPv4 address"); #endif } @@ -453,7 +453,7 @@ static int qcom_ethqos_add_ipv6addr(struct ip_params *ip_info, } else { ETHQOSDBG("Assigned IPv6 address: %s\r\n", ip_info->ipv6_addr_str); -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER place_marker("M - Ethernet Assigned IPv6 address"); #endif } @@ -1537,7 +1537,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) "qcom,emac-smmu-embedded")) return emac_emb_smmu_cb_probe(pdev); -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER place_marker("M - Ethernet probe start"); #endif @@ -1684,7 +1684,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) /*Set early eth parameters*/ ethqos_set_early_eth_param(priv, ethqos); } -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER place_marker("M - Ethernet probe end"); #endif diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 02456e23ceb5..1974ea84b852 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -22,7 +22,7 @@ #include #include #include -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER #include #endif diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 9cf20f1c295a..a436e1242414 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -997,7 +997,7 @@ static void stmmac_mac_link_up(struct phylink_config *config, priv->eee_enabled = stmmac_eee_init(priv); stmmac_set_eee_pls(priv, priv->hw, true); } -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER if ((phy && phy->link == 1) && !priv->boot_kpi) { place_marker("M - Ethernet is Ready.Link is UP"); priv->boot_kpi = true; @@ -1998,7 +1998,7 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue) priv->dev->stats.tx_packets++; priv->xstats.tx_pkt_n++; priv->xstats.q_tx_pkt_n[queue]++; -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER if (priv->dev->stats.tx_packets == 1) place_marker("M - Ethernet first packet transmitted"); #endif @@ -3783,7 +3783,7 @@ read_again: napi_gro_receive(&ch->rx_napi, skb); priv->dev->stats.rx_packets++; -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER if (priv->dev->stats.rx_packets == 1) place_marker("M - Ethernet first packet received"); #endif diff --git a/drivers/soc/qcom/boot_stats.c b/drivers/soc/qcom/boot_stats.c index b60151247397..b31940c00017 100644 --- a/drivers/soc/qcom/boot_stats.c +++ b/drivers/soc/qcom/boot_stats.c @@ -36,7 +36,7 @@ static void __iomem *mpm_counter_base; static uint32_t mpm_counter_freq; static struct boot_stats __iomem *boot_stats; -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER struct boot_marker { char marker_name[BOOT_MARKER_MAX_LEN]; diff --git a/drivers/soc/qcom/hab/hab_os.h b/drivers/soc/qcom/hab/hab_os.h index f15f2a3f933b..0703c7aaf9ad 100644 --- a/drivers/soc/qcom/hab/hab_os.h +++ b/drivers/soc/qcom/hab/hab_os.h @@ -41,7 +41,7 @@ #include #include -#if IS_ENABLED(CONFIG_MSM_BOOT_TIME_MARKER) +#if IS_ENABLED(CONFIG_QGKI_MSM_BOOT_TIME_MARKER) #include #else static inline unsigned long long msm_timer_get_sclk_ticks(void) diff --git a/include/soc/qcom/boot_stats.h b/include/soc/qcom/boot_stats.h index b2a60c295327..33837571c5c7 100644 --- a/include/soc/qcom/boot_stats.h +++ b/include/soc/qcom/boot_stats.h @@ -4,7 +4,7 @@ #ifndef __QCOM_BOOT_STATS_H__ #define __QCOM_BOOT_STATS_H__ -#ifdef CONFIG_MSM_BOOT_TIME_MARKER +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER void place_marker(const char *name); void destroy_marker(const char *name); static inline int boot_marker_enabled(void) { return 1; } From 9858593476d88f3fe910584230808abd3b94767d Mon Sep 17 00:00:00 2001 From: Shreyas K K Date: Tue, 6 Apr 2021 19:23:25 +0530 Subject: [PATCH 3/4] init: main: Add boot marker to measure kernel boot KPI Add boot marker to measure the time taken for the kernel boot. Change-Id: I9705d919467137fdae2f97cfdefb16b519e6af3c Signed-off-by: Shreyas K K --- init/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init/main.c b/init/main.c index 60ec1a7b35c9..719dcc311297 100644 --- a/init/main.c +++ b/init/main.c @@ -103,6 +103,10 @@ #define CREATE_TRACE_POINTS #include +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER +#include +#endif + static int kernel_init(void *); extern void init_IRQ(void); @@ -1130,6 +1134,10 @@ static int __ref kernel_init(void *unused) rcu_end_inkernel_boot(); +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER + place_marker("M - DRIVER Kernel Boot Done"); +#endif + if (ramdisk_execute_command) { ret = run_init_process(ramdisk_execute_command); if (!ret) From fcbb5c5e0d288e4cf80b5a002e32de95da453d59 Mon Sep 17 00:00:00 2001 From: Shreyas K K Date: Fri, 9 Apr 2021 17:33:13 +0530 Subject: [PATCH 4/4] drivers: qcom: Add boot stat entries for kernel load start and end The bootloader adds IMEM entries for kernel load start and end timestamps. Capture the same in the kernel as part of boot stats. This allows to measure the Bootloader KPI values. Change-Id: I2c1862d0f662a6d59aed7bb40e1d7d84ef686c14 Signed-off-by: Shreyas K K --- drivers/soc/qcom/boot_stats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/soc/qcom/boot_stats.c b/drivers/soc/qcom/boot_stats.c index b31940c00017..0e4055671aa5 100644 --- a/drivers/soc/qcom/boot_stats.c +++ b/drivers/soc/qcom/boot_stats.c @@ -30,6 +30,10 @@ struct boot_stats { uint32_t bootloader_end; uint32_t bootloader_display; uint32_t bootloader_load_kernel; +#ifdef CONFIG_QGKI_MSM_BOOT_TIME_MARKER + uint32_t bootloader_load_kernel_start; + uint32_t bootloader_load_kernel_end; +#endif }; static void __iomem *mpm_counter_base;