Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 432cb528 authored by Ram Chandrasekar's avatar Ram Chandrasekar Committed by Kyle Yan
Browse files

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: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 8f2bc230
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
}
+32 −1
Original line number Diff line number Diff line
/*
 * 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)