summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/edp/sysedp_dynamic_capping.c11
-rw-r--r--include/trace/events/sysedp.h26
2 files changed, 36 insertions, 1 deletions
diff --git a/drivers/edp/sysedp_dynamic_capping.c b/drivers/edp/sysedp_dynamic_capping.c
index 0d361c2e1b56..cccc93d5386f 100644
--- a/drivers/edp/sysedp_dynamic_capping.c
+++ b/drivers/edp/sysedp_dynamic_capping.c
@@ -25,6 +25,7 @@
#include <linux/workqueue.h>
#include <linux/platform_data/tegra_edp.h>
#include <linux/debugfs.h>
+#include <trace/events/sysedp.h>
#include "sysedp_internal.h"
@@ -120,6 +121,7 @@ static void apply_caps(struct tegra_sysedp_devcap *devcap)
{
struct freqcap new;
int r;
+ int do_trace = 0;
core_policy.cpu = get_cpufreq_lim(devcap->cpu_power +
cpu_power_balance);
@@ -130,19 +132,26 @@ static void apply_caps(struct tegra_sysedp_devcap *devcap)
new.gpu = forced_caps.gpu ?: core_policy.gpu;
new.emc = forced_caps.emc ?: core_policy.emc;
- if (new.cpu != cur_caps.cpu)
+ if (new.cpu != cur_caps.cpu) {
pm_qos_update_request(&cpufreq_qos, new.cpu);
+ do_trace = 1;
+ }
if (new.emc != cur_caps.emc) {
r = clk_set_rate(emc_cap_clk, new.emc * 1000);
WARN_ON(r);
+ do_trace = 1;
}
if (new.gpu != cur_caps.gpu) {
r = clk_set_rate(gpu_cap_clk, new.gpu * 1000);
WARN_ON(r && (r != -ENOENT));
+ do_trace = 1;
}
+ if (do_trace)
+ trace_sysedp_dynamic_capping(new.cpu, new.gpu,
+ new.emc, gpu_busy);
pr_caps(&cur_caps, &new, devcap->cpu_power);
cur_caps = new;
}
diff --git a/include/trace/events/sysedp.h b/include/trace/events/sysedp.h
index 511eea50ed02..b4ce538812b1 100644
--- a/include/trace/events/sysedp.h
+++ b/include/trace/events/sysedp.h
@@ -65,6 +65,32 @@ TRACE_EVENT(sysedp_set_avail_budget,
TP_printk("%umW -> %umW", __entry->old, __entry->new)
);
+TRACE_EVENT(sysedp_dynamic_capping,
+
+ TP_PROTO(unsigned int cpu, unsigned int gpu,
+ unsigned int emc, bool favor_gpu),
+
+ TP_ARGS(cpu, gpu, emc, favor_gpu),
+
+ TP_STRUCT__entry(
+ __field(unsigned int, cpu)
+ __field(unsigned int, gpu)
+ __field(unsigned int, emc)
+ __field(bool, favor_gpu)
+ ),
+
+ TP_fast_assign(
+ __entry->cpu = cpu;
+ __entry->gpu = gpu;
+ __entry->emc = emc;
+ __entry->favor_gpu = favor_gpu;
+ ),
+
+ TP_printk("CPU %u, GPU %u, EMC %u, favor_gpu=%d",
+ __entry->cpu / 1000, __entry->gpu / 1000,
+ __entry->emc / 1000, __entry->favor_gpu)
+ );
+
#endif /* _TRACE_SYSEDP_H */
/* This part must be outside protection */