[for-next][PATCH 7/7] tracing, thermal: Hide cpu cooling trace events when not in use

Steven Rostedt
2017-10-18T13:29:19Z

[-- Attachment #1: 0007-tracing-thermal-Hide-cpu-cooling-trace-events-when-n.patch --]
[-- Type: text/plain, Size: 1430 bytes --]

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

As trace events when defined create data structures and functions to
process them, defining trace events when not using them is a waste of
memory.

The trace events thermal_power_cpu_get_power and
thermal_power_cpu_limit are only used when CONFIG_CPU_THERMAL is set.
Make those events only defined when that is set as well.

Link: http://lkml.kernel.org/r/20171013102309.2c4ef81a@gandalf.local.home

Cc: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Javi Merino <javi.merino@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
include/trace/events/thermal.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h
index 1fdacdb94e77..8af8f130950e 100644
--- a/include/trace/events/thermal.h
+++ b/include/trace/events/thermal.h
@@ -90,6 +90,7 @@ TRACE_EVENT(thermal_zone_trip,
show_tzt_type(__entry->trip_type))
);

+#ifdef CONFIG_CPU_THERMAL
TRACE_EVENT(thermal_power_cpu_get_power,
TP_PROTO(const struct cpumask *cpus, unsigned long freq, u32 *load,
size_t load_len, u32 dynamic_power, u32 static_power),
@@ -147,6 +148,7 @@ TRACE_EVENT(thermal_power_cpu_limit,
__get_bitmask(cpumask), __entry->freq, __entry->cdev_state,
__entry->power)
);
+#endif /* CONFIG_CPU_THERMAL */

#ifdef CONFIG_DEVFREQ_THERMAL
TRACE_EVENT(thermal_power_devfreq_get_power,
--
2.13.2