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

Commit b739167a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: lpm-levels: Modify ftrace events to track latency/sleep time"

parents 38179ea4 657b6e3f
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -360,6 +360,8 @@ static int cpu_power_select(struct cpuidle_device *dev,
	if (modified_time_us && !dev->cpu)
		msm_pm_set_timer(modified_time_us);

	trace_cpu_power_select(best_level, sleep_us, latency_us, next_event_us);

	return best_level;
}

@@ -811,10 +813,10 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
	sched_set_cpu_cstate(smp_processor_id(), idx + 1,
		pwr_params->energy_overhead, pwr_params->latency_us);

	cpu_prepare(cluster, idx, true);
	trace_cpu_idle_enter(idx);

	cpu_prepare(cluster, idx, true);
	cluster_prepare(cluster, cpumask, idx, true);
	trace_cpu_idle_enter(idx);
	lpm_stats_cpu_enter(idx);

	if (idx > 0 && !use_psci) {
@@ -829,7 +831,6 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
	}

	lpm_stats_cpu_exit(idx, success);
	trace_cpu_idle_exit(idx, success);
	cluster_unprepare(cluster, cpumask, idx, true);
	cpu_unprepare(cluster, idx, true);

@@ -838,10 +839,11 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
	time = ktime_to_ns(ktime_get()) - time;
	do_div(time, 1000);
	dev->last_residency = (int)time;
	trace_cpu_idle_exit(idx, success);

exit:
	local_irq_enable();
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
	local_irq_enable();
	return idx;
}

+27 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2014-2015, 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
@@ -18,6 +18,31 @@

#include <linux/tracepoint.h>

TRACE_EVENT(cpu_power_select,

	TP_PROTO(int index, u32 sleep_us, u32 latency, u32 next_event_us),

	TP_ARGS(index, sleep_us, latency, next_event_us),

	TP_STRUCT__entry(
		__field(int, index)
		__field(u32, sleep_us)
		__field(u32, latency)
		__field(u32, next_event_us)
	),

	TP_fast_assign(
		__entry->index = index;
		__entry->sleep_us = sleep_us;
		__entry->latency = latency;
		__entry->next_event_us = next_event_us;
	),

	TP_printk("idx:%d sleep_time:%u latency:%u next_event:%u",
		__entry->index, __entry->sleep_us, __entry->latency,
		__entry->next_event_us)
);

TRACE_EVENT(cpu_idle_enter,

	TP_PROTO(int index),
@@ -35,6 +60,7 @@ TRACE_EVENT(cpu_idle_enter,
	TP_printk("idx:%d",
		__entry->index)
);

TRACE_EVENT(cpu_idle_exit,

	TP_PROTO(int index, bool success),