thermal/core: Relocate the traces definition in thermal directory
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 7 Mar 2023 13:37:25 +0000 (14:37 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Sat, 1 Apr 2023 18:51:45 +0000 (20:51 +0200)
The traces are exported but only local to the thermal core code. On
the other side, the traces take the thermal zone device structure as
argument, thus they have to rely on the exported thermal.h header
file. As we want to move the structure to the private thermal core
header, first we have to relocate those traces to the same place as
many drivers do.

Cc: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20230307133735.90772-2-daniel.lezcano@linaro.org
12 files changed:
drivers/thermal/Makefile
drivers/thermal/cpufreq_cooling.c
drivers/thermal/devfreq_cooling.c
drivers/thermal/gov_fair_share.c
drivers/thermal/gov_power_allocator.c
drivers/thermal/gov_step_wise.c
drivers/thermal/thermal_core.c
drivers/thermal/thermal_helpers.c
drivers/thermal/thermal_trace.h [new file with mode: 0644]
drivers/thermal/thermal_trace_ipa.h [new file with mode: 0644]
include/trace/events/thermal.h [deleted file]
include/trace/events/thermal_power_allocator.h [deleted file]

index eed300e83d480eecde567cea5366585cf158141f..058664bc3ec097afac5257ae3f485672c63df9e0 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Makefile for sensor chip drivers.
 #
-
+CFLAGS_thermal_core.o          := -I$(src)
 obj-$(CONFIG_THERMAL)          += thermal_sys.o
 thermal_sys-y                  += thermal_core.o thermal_sysfs.o
 thermal_sys-y                  += thermal_trip.o thermal_helpers.o
@@ -16,6 +16,7 @@ thermal_sys-$(CONFIG_THERMAL_OF)              += thermal_of.o
 thermal_sys-$(CONFIG_THERMAL_ACPI)             += thermal_acpi.o
 
 # governors
+CFLAGS_gov_power_allocator.o                   := -I$(src)
 thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE)   += gov_fair_share.o
 thermal_sys-$(CONFIG_THERMAL_GOV_BANG_BANG)    += gov_bang_bang.o
 thermal_sys-$(CONFIG_THERMAL_GOV_STEP_WISE)    += gov_step_wise.o
index 9f8b438fcf8f826edcd7befb9fd52813ec971dd8..65ef08b30334321b041b7061d9b42216c397d795 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/thermal.h>
 #include <linux/units.h>
 
-#include <trace/events/thermal.h>
+#include "thermal_trace.h"
 
 /*
  * Cooling state <-> CPUFreq frequency
index 24b474925cd68e5e82fe6377e5c22b0bd0dc1317..262e62ab6cf2f280265d56bae61620019fd65f8f 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/thermal.h>
 #include <linux/units.h>
 
-#include <trace/events/thermal.h>
+#include "thermal_trace.h"
 
 #define SCALE_ERROR_MITIGATION 100
 
index aad7d5fe3a1483c3cfa06e5adaf153def653e792..03c2daeb6ee8bc7db2dfa4ba8c5537f07639bcb9 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include <linux/thermal.h>
-#include <trace/events/thermal.h>
+#include "thermal_trace.h"
 
 #include "thermal_core.h"
 
index 0eaf1527d3e320b73b514efc5a1a1eddde85e511..8642f1096b91c800ab0c223bc76ac13faeb5dcb7 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/thermal.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/thermal_power_allocator.h>
+#include "thermal_trace_ipa.h"
 
 #include "thermal_core.h"
 
index 31235e169c5a093dfac47786c2e0e216d12fc6dd..3d3067804df244c4b054489d4b8e2d9d3ef9bbbc 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <linux/thermal.h>
 #include <linux/minmax.h>
-#include <trace/events/thermal.h>
+#include "thermal_trace.h"
 
 #include "thermal_core.h"
 
index 5ae72f314683e004ec0bd9767c83ee25ae8034d2..ed628d21e1bc4a8472f65dab6d4ceed25fb0d09a 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/suspend.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/thermal.h>
+#include "thermal_trace.h"
 
 #include "thermal_core.h"
 #include "thermal_hwmon.h"
index 92e7e7fd7357b5a8b272a9fcc8e9f192b17748ef..cfba0965a22da0ba638a90f9075bae2915ee5c1f 100644 (file)
@@ -19,9 +19,8 @@
 #include <linux/string.h>
 #include <linux/sysfs.h>
 
-#include <trace/events/thermal.h>
-
 #include "thermal_core.h"
+#include "thermal_trace.h"
 
 int get_tz_trend(struct thermal_zone_device *tz, int trip)
 {
diff --git a/drivers/thermal/thermal_trace.h b/drivers/thermal/thermal_trace.h
new file mode 100644 (file)
index 0000000..459c8ce
--- /dev/null
@@ -0,0 +1,205 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM thermal
+
+#if !defined(_TRACE_THERMAL_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_THERMAL_H
+
+#include <linux/devfreq.h>
+#include <linux/thermal.h>
+#include <linux/tracepoint.h>
+
+TRACE_DEFINE_ENUM(THERMAL_TRIP_CRITICAL);
+TRACE_DEFINE_ENUM(THERMAL_TRIP_HOT);
+TRACE_DEFINE_ENUM(THERMAL_TRIP_PASSIVE);
+TRACE_DEFINE_ENUM(THERMAL_TRIP_ACTIVE);
+
+#define show_tzt_type(type)                                    \
+       __print_symbolic(type,                                  \
+                        { THERMAL_TRIP_CRITICAL, "CRITICAL"},  \
+                        { THERMAL_TRIP_HOT,      "HOT"},       \
+                        { THERMAL_TRIP_PASSIVE,  "PASSIVE"},   \
+                        { THERMAL_TRIP_ACTIVE,   "ACTIVE"})
+
+TRACE_EVENT(thermal_temperature,
+
+       TP_PROTO(struct thermal_zone_device *tz),
+
+       TP_ARGS(tz),
+
+       TP_STRUCT__entry(
+               __string(thermal_zone, tz->type)
+               __field(int, id)
+               __field(int, temp_prev)
+               __field(int, temp)
+       ),
+
+       TP_fast_assign(
+               __assign_str(thermal_zone, tz->type);
+               __entry->id = tz->id;
+               __entry->temp_prev = tz->last_temperature;
+               __entry->temp = tz->temperature;
+       ),
+
+       TP_printk("thermal_zone=%s id=%d temp_prev=%d temp=%d",
+               __get_str(thermal_zone), __entry->id, __entry->temp_prev,
+               __entry->temp)
+);
+
+TRACE_EVENT(cdev_update,
+
+       TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target),
+
+       TP_ARGS(cdev, target),
+
+       TP_STRUCT__entry(
+               __string(type, cdev->type)
+               __field(unsigned long, target)
+       ),
+
+       TP_fast_assign(
+               __assign_str(type, cdev->type);
+               __entry->target = target;
+       ),
+
+       TP_printk("type=%s target=%lu", __get_str(type), __entry->target)
+);
+
+TRACE_EVENT(thermal_zone_trip,
+
+       TP_PROTO(struct thermal_zone_device *tz, int trip,
+               enum thermal_trip_type trip_type),
+
+       TP_ARGS(tz, trip, trip_type),
+
+       TP_STRUCT__entry(
+               __string(thermal_zone, tz->type)
+               __field(int, id)
+               __field(int, trip)
+               __field(enum thermal_trip_type, trip_type)
+       ),
+
+       TP_fast_assign(
+               __assign_str(thermal_zone, tz->type);
+               __entry->id = tz->id;
+               __entry->trip = trip;
+               __entry->trip_type = trip_type;
+       ),
+
+       TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%s",
+               __get_str(thermal_zone), __entry->id, __entry->trip,
+               show_tzt_type(__entry->trip_type))
+);
+
+#ifdef CONFIG_CPU_THERMAL
+TRACE_EVENT(thermal_power_cpu_get_power_simple,
+       TP_PROTO(int cpu, u32 power),
+
+       TP_ARGS(cpu, power),
+
+       TP_STRUCT__entry(
+               __field(int, cpu)
+               __field(u32, power)
+       ),
+
+       TP_fast_assign(
+               __entry->cpu = cpu;
+               __entry->power = power;
+       ),
+
+       TP_printk("cpu=%d power=%u", __entry->cpu, __entry->power)
+);
+
+TRACE_EVENT(thermal_power_cpu_limit,
+       TP_PROTO(const struct cpumask *cpus, unsigned int freq,
+               unsigned long cdev_state, u32 power),
+
+       TP_ARGS(cpus, freq, cdev_state, power),
+
+       TP_STRUCT__entry(
+               __bitmask(cpumask, num_possible_cpus())
+               __field(unsigned int,  freq      )
+               __field(unsigned long, cdev_state)
+               __field(u32,           power     )
+       ),
+
+       TP_fast_assign(
+               __assign_bitmask(cpumask, cpumask_bits(cpus),
+                               num_possible_cpus());
+               __entry->freq = freq;
+               __entry->cdev_state = cdev_state;
+               __entry->power = power;
+       ),
+
+       TP_printk("cpus=%s freq=%u cdev_state=%lu power=%u",
+               __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,
+       TP_PROTO(struct thermal_cooling_device *cdev,
+                struct devfreq_dev_status *status, unsigned long freq,
+               u32 power),
+
+       TP_ARGS(cdev, status,  freq, power),
+
+       TP_STRUCT__entry(
+               __string(type,         cdev->type    )
+               __field(unsigned long, freq          )
+               __field(u32,           busy_time)
+               __field(u32,           total_time)
+               __field(u32,           power)
+       ),
+
+       TP_fast_assign(
+               __assign_str(type, cdev->type);
+               __entry->freq = freq;
+               __entry->busy_time = status->busy_time;
+               __entry->total_time = status->total_time;
+               __entry->power = power;
+       ),
+
+       TP_printk("type=%s freq=%lu load=%u power=%u",
+               __get_str(type), __entry->freq,
+               __entry->total_time == 0 ? 0 :
+                       (100 * __entry->busy_time) / __entry->total_time,
+               __entry->power)
+);
+
+TRACE_EVENT(thermal_power_devfreq_limit,
+       TP_PROTO(struct thermal_cooling_device *cdev, unsigned long freq,
+               unsigned long cdev_state, u32 power),
+
+       TP_ARGS(cdev, freq, cdev_state, power),
+
+       TP_STRUCT__entry(
+               __string(type,         cdev->type)
+               __field(unsigned int,  freq      )
+               __field(unsigned long, cdev_state)
+               __field(u32,           power     )
+       ),
+
+       TP_fast_assign(
+               __assign_str(type, cdev->type);
+               __entry->freq = freq;
+               __entry->cdev_state = cdev_state;
+               __entry->power = power;
+       ),
+
+       TP_printk("type=%s freq=%u cdev_state=%lu power=%u",
+               __get_str(type), __entry->freq, __entry->cdev_state,
+               __entry->power)
+);
+#endif /* CONFIG_DEVFREQ_THERMAL */
+#endif /* _TRACE_THERMAL_H */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE thermal_trace
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/drivers/thermal/thermal_trace_ipa.h b/drivers/thermal/thermal_trace_ipa.h
new file mode 100644 (file)
index 0000000..84568db
--- /dev/null
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM thermal_power_allocator
+
+#if !defined(_TRACE_THERMAL_POWER_ALLOCATOR_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_THERMAL_POWER_ALLOCATOR_H
+
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(thermal_power_allocator,
+       TP_PROTO(struct thermal_zone_device *tz, u32 *req_power,
+                u32 total_req_power, u32 *granted_power,
+                u32 total_granted_power, size_t num_actors,
+                u32 power_range, u32 max_allocatable_power,
+                int current_temp, s32 delta_temp),
+       TP_ARGS(tz, req_power, total_req_power, granted_power,
+               total_granted_power, num_actors, power_range,
+               max_allocatable_power, current_temp, delta_temp),
+       TP_STRUCT__entry(
+               __field(int,           tz_id          )
+               __dynamic_array(u32,   req_power, num_actors    )
+               __field(u32,           total_req_power          )
+               __dynamic_array(u32,   granted_power, num_actors)
+               __field(u32,           total_granted_power      )
+               __field(size_t,        num_actors               )
+               __field(u32,           power_range              )
+               __field(u32,           max_allocatable_power    )
+               __field(int,           current_temp             )
+               __field(s32,           delta_temp               )
+       ),
+       TP_fast_assign(
+               __entry->tz_id = tz->id;
+               memcpy(__get_dynamic_array(req_power), req_power,
+                       num_actors * sizeof(*req_power));
+               __entry->total_req_power = total_req_power;
+               memcpy(__get_dynamic_array(granted_power), granted_power,
+                       num_actors * sizeof(*granted_power));
+               __entry->total_granted_power = total_granted_power;
+               __entry->num_actors = num_actors;
+               __entry->power_range = power_range;
+               __entry->max_allocatable_power = max_allocatable_power;
+               __entry->current_temp = current_temp;
+               __entry->delta_temp = delta_temp;
+       ),
+
+       TP_printk("thermal_zone_id=%d req_power={%s} total_req_power=%u granted_power={%s} total_granted_power=%u power_range=%u max_allocatable_power=%u current_temperature=%d delta_temperature=%d",
+               __entry->tz_id,
+               __print_array(__get_dynamic_array(req_power),
+                              __entry->num_actors, 4),
+               __entry->total_req_power,
+               __print_array(__get_dynamic_array(granted_power),
+                              __entry->num_actors, 4),
+               __entry->total_granted_power, __entry->power_range,
+               __entry->max_allocatable_power, __entry->current_temp,
+               __entry->delta_temp)
+);
+
+TRACE_EVENT(thermal_power_allocator_pid,
+       TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
+                s64 p, s64 i, s64 d, s32 output),
+       TP_ARGS(tz, err, err_integral, p, i, d, output),
+       TP_STRUCT__entry(
+               __field(int, tz_id       )
+               __field(s32, err         )
+               __field(s32, err_integral)
+               __field(s64, p           )
+               __field(s64, i           )
+               __field(s64, d           )
+               __field(s32, output      )
+       ),
+       TP_fast_assign(
+               __entry->tz_id = tz->id;
+               __entry->err = err;
+               __entry->err_integral = err_integral;
+               __entry->p = p;
+               __entry->i = i;
+               __entry->d = d;
+               __entry->output = output;
+       ),
+
+       TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
+                 __entry->tz_id, __entry->err, __entry->err_integral,
+                 __entry->p, __entry->i, __entry->d, __entry->output)
+);
+#endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE thermal_trace_ipa
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h
deleted file mode 100644 (file)
index e58bf30..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM thermal
-
-#if !defined(_TRACE_THERMAL_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_THERMAL_H
-
-#include <linux/devfreq.h>
-#include <linux/thermal.h>
-#include <linux/tracepoint.h>
-
-TRACE_DEFINE_ENUM(THERMAL_TRIP_CRITICAL);
-TRACE_DEFINE_ENUM(THERMAL_TRIP_HOT);
-TRACE_DEFINE_ENUM(THERMAL_TRIP_PASSIVE);
-TRACE_DEFINE_ENUM(THERMAL_TRIP_ACTIVE);
-
-#define show_tzt_type(type)                                    \
-       __print_symbolic(type,                                  \
-                        { THERMAL_TRIP_CRITICAL, "CRITICAL"},  \
-                        { THERMAL_TRIP_HOT,      "HOT"},       \
-                        { THERMAL_TRIP_PASSIVE,  "PASSIVE"},   \
-                        { THERMAL_TRIP_ACTIVE,   "ACTIVE"})
-
-TRACE_EVENT(thermal_temperature,
-
-       TP_PROTO(struct thermal_zone_device *tz),
-
-       TP_ARGS(tz),
-
-       TP_STRUCT__entry(
-               __string(thermal_zone, tz->type)
-               __field(int, id)
-               __field(int, temp_prev)
-               __field(int, temp)
-       ),
-
-       TP_fast_assign(
-               __assign_str(thermal_zone, tz->type);
-               __entry->id = tz->id;
-               __entry->temp_prev = tz->last_temperature;
-               __entry->temp = tz->temperature;
-       ),
-
-       TP_printk("thermal_zone=%s id=%d temp_prev=%d temp=%d",
-               __get_str(thermal_zone), __entry->id, __entry->temp_prev,
-               __entry->temp)
-);
-
-TRACE_EVENT(cdev_update,
-
-       TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target),
-
-       TP_ARGS(cdev, target),
-
-       TP_STRUCT__entry(
-               __string(type, cdev->type)
-               __field(unsigned long, target)
-       ),
-
-       TP_fast_assign(
-               __assign_str(type, cdev->type);
-               __entry->target = target;
-       ),
-
-       TP_printk("type=%s target=%lu", __get_str(type), __entry->target)
-);
-
-TRACE_EVENT(thermal_zone_trip,
-
-       TP_PROTO(struct thermal_zone_device *tz, int trip,
-               enum thermal_trip_type trip_type),
-
-       TP_ARGS(tz, trip, trip_type),
-
-       TP_STRUCT__entry(
-               __string(thermal_zone, tz->type)
-               __field(int, id)
-               __field(int, trip)
-               __field(enum thermal_trip_type, trip_type)
-       ),
-
-       TP_fast_assign(
-               __assign_str(thermal_zone, tz->type);
-               __entry->id = tz->id;
-               __entry->trip = trip;
-               __entry->trip_type = trip_type;
-       ),
-
-       TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%s",
-               __get_str(thermal_zone), __entry->id, __entry->trip,
-               show_tzt_type(__entry->trip_type))
-);
-
-#ifdef CONFIG_CPU_THERMAL
-TRACE_EVENT(thermal_power_cpu_get_power_simple,
-       TP_PROTO(int cpu, u32 power),
-
-       TP_ARGS(cpu, power),
-
-       TP_STRUCT__entry(
-               __field(int, cpu)
-               __field(u32, power)
-       ),
-
-       TP_fast_assign(
-               __entry->cpu = cpu;
-               __entry->power = power;
-       ),
-
-       TP_printk("cpu=%d power=%u", __entry->cpu, __entry->power)
-);
-
-TRACE_EVENT(thermal_power_cpu_limit,
-       TP_PROTO(const struct cpumask *cpus, unsigned int freq,
-               unsigned long cdev_state, u32 power),
-
-       TP_ARGS(cpus, freq, cdev_state, power),
-
-       TP_STRUCT__entry(
-               __bitmask(cpumask, num_possible_cpus())
-               __field(unsigned int,  freq      )
-               __field(unsigned long, cdev_state)
-               __field(u32,           power     )
-       ),
-
-       TP_fast_assign(
-               __assign_bitmask(cpumask, cpumask_bits(cpus),
-                               num_possible_cpus());
-               __entry->freq = freq;
-               __entry->cdev_state = cdev_state;
-               __entry->power = power;
-       ),
-
-       TP_printk("cpus=%s freq=%u cdev_state=%lu power=%u",
-               __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,
-       TP_PROTO(struct thermal_cooling_device *cdev,
-                struct devfreq_dev_status *status, unsigned long freq,
-               u32 power),
-
-       TP_ARGS(cdev, status,  freq, power),
-
-       TP_STRUCT__entry(
-               __string(type,         cdev->type    )
-               __field(unsigned long, freq          )
-               __field(u32,           busy_time)
-               __field(u32,           total_time)
-               __field(u32,           power)
-       ),
-
-       TP_fast_assign(
-               __assign_str(type, cdev->type);
-               __entry->freq = freq;
-               __entry->busy_time = status->busy_time;
-               __entry->total_time = status->total_time;
-               __entry->power = power;
-       ),
-
-       TP_printk("type=%s freq=%lu load=%u power=%u",
-               __get_str(type), __entry->freq,
-               __entry->total_time == 0 ? 0 :
-                       (100 * __entry->busy_time) / __entry->total_time,
-               __entry->power)
-);
-
-TRACE_EVENT(thermal_power_devfreq_limit,
-       TP_PROTO(struct thermal_cooling_device *cdev, unsigned long freq,
-               unsigned long cdev_state, u32 power),
-
-       TP_ARGS(cdev, freq, cdev_state, power),
-
-       TP_STRUCT__entry(
-               __string(type,         cdev->type)
-               __field(unsigned int,  freq      )
-               __field(unsigned long, cdev_state)
-               __field(u32,           power     )
-       ),
-
-       TP_fast_assign(
-               __assign_str(type, cdev->type);
-               __entry->freq = freq;
-               __entry->cdev_state = cdev_state;
-               __entry->power = power;
-       ),
-
-       TP_printk("type=%s freq=%u cdev_state=%lu power=%u",
-               __get_str(type), __entry->freq, __entry->cdev_state,
-               __entry->power)
-);
-#endif /* CONFIG_DEVFREQ_THERMAL */
-#endif /* _TRACE_THERMAL_H */
-
-/* This part must be outside protection */
-#include <trace/define_trace.h>
diff --git a/include/trace/events/thermal_power_allocator.h b/include/trace/events/thermal_power_allocator.h
deleted file mode 100644 (file)
index 1c8fb95..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM thermal_power_allocator
-
-#if !defined(_TRACE_THERMAL_POWER_ALLOCATOR_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_THERMAL_POWER_ALLOCATOR_H
-
-#include <linux/tracepoint.h>
-
-TRACE_EVENT(thermal_power_allocator,
-       TP_PROTO(struct thermal_zone_device *tz, u32 *req_power,
-                u32 total_req_power, u32 *granted_power,
-                u32 total_granted_power, size_t num_actors,
-                u32 power_range, u32 max_allocatable_power,
-                int current_temp, s32 delta_temp),
-       TP_ARGS(tz, req_power, total_req_power, granted_power,
-               total_granted_power, num_actors, power_range,
-               max_allocatable_power, current_temp, delta_temp),
-       TP_STRUCT__entry(
-               __field(int,           tz_id          )
-               __dynamic_array(u32,   req_power, num_actors    )
-               __field(u32,           total_req_power          )
-               __dynamic_array(u32,   granted_power, num_actors)
-               __field(u32,           total_granted_power      )
-               __field(size_t,        num_actors               )
-               __field(u32,           power_range              )
-               __field(u32,           max_allocatable_power    )
-               __field(int,           current_temp             )
-               __field(s32,           delta_temp               )
-       ),
-       TP_fast_assign(
-               __entry->tz_id = tz->id;
-               memcpy(__get_dynamic_array(req_power), req_power,
-                       num_actors * sizeof(*req_power));
-               __entry->total_req_power = total_req_power;
-               memcpy(__get_dynamic_array(granted_power), granted_power,
-                       num_actors * sizeof(*granted_power));
-               __entry->total_granted_power = total_granted_power;
-               __entry->num_actors = num_actors;
-               __entry->power_range = power_range;
-               __entry->max_allocatable_power = max_allocatable_power;
-               __entry->current_temp = current_temp;
-               __entry->delta_temp = delta_temp;
-       ),
-
-       TP_printk("thermal_zone_id=%d req_power={%s} total_req_power=%u granted_power={%s} total_granted_power=%u power_range=%u max_allocatable_power=%u current_temperature=%d delta_temperature=%d",
-               __entry->tz_id,
-               __print_array(__get_dynamic_array(req_power),
-                              __entry->num_actors, 4),
-               __entry->total_req_power,
-               __print_array(__get_dynamic_array(granted_power),
-                              __entry->num_actors, 4),
-               __entry->total_granted_power, __entry->power_range,
-               __entry->max_allocatable_power, __entry->current_temp,
-               __entry->delta_temp)
-);
-
-TRACE_EVENT(thermal_power_allocator_pid,
-       TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
-                s64 p, s64 i, s64 d, s32 output),
-       TP_ARGS(tz, err, err_integral, p, i, d, output),
-       TP_STRUCT__entry(
-               __field(int, tz_id       )
-               __field(s32, err         )
-               __field(s32, err_integral)
-               __field(s64, p           )
-               __field(s64, i           )
-               __field(s64, d           )
-               __field(s32, output      )
-       ),
-       TP_fast_assign(
-               __entry->tz_id = tz->id;
-               __entry->err = err;
-               __entry->err_integral = err_integral;
-               __entry->p = p;
-               __entry->i = i;
-               __entry->d = d;
-               __entry->output = output;
-       ),
-
-       TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
-                 __entry->tz_id, __entry->err, __entry->err_integral,
-                 __entry->p, __entry->i, __entry->d, __entry->output)
-);
-#endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
-
-/* This part must be outside protection */
-#include <trace/define_trace.h>