summaryrefslogtreecommitdiff
path: root/drivers/soc/qcom/icc-bwmon.c
diff options
context:
space:
mode:
authorShivnandan Kumar <quic_kshivnan@quicinc.com>2024-07-08 13:17:34 +0300
committerBjorn Andersson <andersson@kernel.org>2024-08-01 06:22:47 +0300
commitdc8c4a8aee49e42cf13e32e123de127122dc516f (patch)
treef5cd27d60f31d7b2457a6d80ec53efc61a269619 /drivers/soc/qcom/icc-bwmon.c
parent99a7b371eef63507c1761e367382d78ebec0a5ab (diff)
downloadlinux-dc8c4a8aee49e42cf13e32e123de127122dc516f.tar.xz
soc: qcom: icc-bwmon: Add tracepoints in bwmon_intr_thread
Add tracepoint for tracing the measured traffic in kbps, up_kbps and down_kbps in bwmon. This information is valuable for understanding what bwmon hw measures at the system cache level and at the DDR level which is helpful in debugging bwmon behavior. Signed-off-by: Shivnandan Kumar <quic_kshivnan@quicinc.com> Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Link: https://lore.kernel.org/r/20240708101734.1999795-1-quic_kshivnan@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers/soc/qcom/icc-bwmon.c')
-rw-r--r--drivers/soc/qcom/icc-bwmon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
index e7851974084b..f9235bc3aa3b 100644
--- a/drivers/soc/qcom/icc-bwmon.c
+++ b/drivers/soc/qcom/icc-bwmon.c
@@ -17,6 +17,8 @@
#include <linux/pm_opp.h>
#include <linux/regmap.h>
#include <linux/sizes.h>
+#define CREATE_TRACE_POINTS
+#include "trace_icc-bwmon.h"
/*
* The BWMON samples data throughput within 'sample_ms' time. With three
@@ -645,9 +647,10 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
struct icc_bwmon *bwmon = dev_id;
unsigned int irq_enable = 0;
struct dev_pm_opp *opp, *target_opp;
- unsigned int bw_kbps, up_kbps, down_kbps;
+ unsigned int bw_kbps, up_kbps, down_kbps, meas_kbps;
bw_kbps = bwmon->target_kbps;
+ meas_kbps = bwmon->target_kbps;
target_opp = dev_pm_opp_find_bw_ceil(bwmon->dev, &bw_kbps, 0);
if (IS_ERR(target_opp) && PTR_ERR(target_opp) == -ERANGE)
@@ -679,6 +682,7 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
bwmon_clear_irq(bwmon);
bwmon_enable(bwmon, irq_enable);
+ trace_qcom_bwmon_update(dev_name(bwmon->dev), meas_kbps, up_kbps, down_kbps);
if (bwmon->target_kbps == bwmon->current_kbps)
goto out;