From dcedf3c5386e5aeeda556c1ad60bbbabe5285139 Mon Sep 17 00:00:00 2001 From: Taniya Das Date: Mon, 26 Aug 2019 21:21:21 +0530 Subject: [PATCH] trace: Add new trace event for DCVSH Add trace to capture DCVSH updates to sched. Change-Id: I57201ab0e41931cffe121c6ab18c46b1f26f250e Signed-off-by: Taniya Das --- drivers/cpufreq/qcom-cpufreq-hw.c | 5 +++++ include/trace/events/dcvsh.h | 35 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 include/trace/events/dcvsh.h diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 4100b5e1be77..a1d3fb324151 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -18,6 +18,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include + #define LUT_MAX_ENTRIES 40U #define LUT_SRC GENMASK(31, 30) #define LUT_L_VAL GENMASK(7, 0) @@ -106,6 +109,8 @@ static unsigned long limits_mitigation_notify(struct cpufreq_qcom *c) else { sched_update_cpu_freq_min_max(&c->related_cpus, 0, c->table[i].frequency); + trace_dcvsh_freq(cpumask_first(&c->related_cpus), + c->table[i].frequency); return c->table[i].frequency; } } diff --git a/include/trace/events/dcvsh.h b/include/trace/events/dcvsh.h new file mode 100644 index 000000000000..37cb49a061bc --- /dev/null +++ b/include/trace/events/dcvsh.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM dcvsh + +#if !defined(_TRACE_DCVSH_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_DCVSH_H + +#include + +TRACE_EVENT(dcvsh_freq, + TP_PROTO(unsigned long cpu, unsigned long freq), + + TP_ARGS(cpu, freq), + + TP_STRUCT__entry( + __field(unsigned long, cpu) + __field(unsigned long, freq) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->freq = freq; + ), + + TP_printk("cpu:%lu max frequency:%lu", __entry->cpu, __entry->freq) +); + +#endif /* _TRACE_DCVSH_H */ + +/* This part must be outside protection */ +#include