drivers: thermal: Add ftrace events for LMH DCVSh mitigation

LMH DCVSh driver receives interrupt from hardware whenever there is a
new mitigation frequency decision is made in hardware.

Add ftrace event to print the hardware mitigation frequency value from
driver.

Change-Id: Ib357ee3c3a461613bfd1268ec8f98973c2982c10
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This commit is contained in:
Ram Chandrasekar 2016-05-18 12:01:31 -06:00 committed by Kyle Yan
parent 8f2bc2304c
commit 432cb528fd
2 changed files with 37 additions and 1 deletions

View file

@ -32,6 +32,10 @@
#include "thermal_core.h"
#define CREATE_TRACE_POINTS
#define LMH_DCVS_TRACE
#include <trace/trace_thermal.h>
#define MSM_LIMITS_DCVSH 0x10
#define MSM_LIMITS_NODE_DCVS 0x44435653
@ -97,6 +101,7 @@ static uint32_t msm_lmh_mitigation_notify(struct msm_lmh_dcvs_hw *hw)
val = readl_relaxed(hw->osm_hw_reg);
dcvsh_get_frequency(val, max_limit);
sched_update_cpu_freq_min_max(&hw->core_map, 0, max_limit);
trace_lmh_dcvs_freq(cpumask_first(&hw->core_map), max_limit);
return max_limit;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -112,6 +112,37 @@ TRACE_EVENT(lmh_debug_data,
)
);
#elif defined(LMH_DCVS_TRACE)
DECLARE_EVENT_CLASS(msm_lmh_dcvs_print,
TP_PROTO(int cpu, long max_freq),
TP_ARGS(
cpu, max_freq
),
TP_STRUCT__entry(
__field(int, cpu)
__field(long, max_freq)
),
TP_fast_assign(
__entry->cpu = cpu;
__entry->max_freq = max_freq;
),
TP_printk(
"cpu:%d max frequency:%ld",
__entry->cpu, __entry->max_freq
)
);
DEFINE_EVENT(msm_lmh_dcvs_print, lmh_dcvs_freq,
TP_PROTO(int cpu, long max_freq),
TP_ARGS(cpu, max_freq)
);
#elif defined(TRACE_MSM_THERMAL)