Skip to content

Commit 32a7a02

Browse files
committed
thermal/core: Relocate the traces definition in thermal directory
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
1 parent e45c9a2 commit 32a7a02

10 files changed

Lines changed: 21 additions & 9 deletions

drivers/thermal/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for sensor chip drivers.
44
#
5-
5+
CFLAGS_thermal_core.o := -I$(src)
66
obj-$(CONFIG_THERMAL) += thermal_sys.o
77
thermal_sys-y += thermal_core.o thermal_sysfs.o
88
thermal_sys-y += thermal_trip.o thermal_helpers.o
@@ -16,6 +16,7 @@ thermal_sys-$(CONFIG_THERMAL_OF) += thermal_of.o
1616
thermal_sys-$(CONFIG_THERMAL_ACPI) += thermal_acpi.o
1717

1818
# governors
19+
CFLAGS_gov_power_allocator.o := -I$(src)
1920
thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE) += gov_fair_share.o
2021
thermal_sys-$(CONFIG_THERMAL_GOV_BANG_BANG) += gov_bang_bang.o
2122
thermal_sys-$(CONFIG_THERMAL_GOV_STEP_WISE) += gov_step_wise.o

drivers/thermal/cpufreq_cooling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <linux/thermal.h>
2424
#include <linux/units.h>
2525

26-
#include <trace/events/thermal.h>
26+
#include "thermal_trace.h"
2727

2828
/*
2929
* Cooling state <-> CPUFreq frequency

drivers/thermal/devfreq_cooling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <linux/thermal.h>
2121
#include <linux/units.h>
2222

23-
#include <trace/events/thermal.h>
23+
#include "thermal_trace.h"
2424

2525
#define SCALE_ERROR_MITIGATION 100
2626

drivers/thermal/gov_fair_share.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
#include <linux/thermal.h>
14-
#include <trace/events/thermal.h>
14+
#include "thermal_trace.h"
1515

1616
#include "thermal_core.h"
1717

drivers/thermal/gov_power_allocator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/thermal.h>
1313

1414
#define CREATE_TRACE_POINTS
15-
#include <trace/events/thermal_power_allocator.h>
15+
#include "thermal_trace_ipa.h"
1616

1717
#include "thermal_core.h"
1818

drivers/thermal/gov_step_wise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <linux/thermal.h>
1414
#include <linux/minmax.h>
15-
#include <trace/events/thermal.h>
15+
#include "thermal_trace.h"
1616

1717
#include "thermal_core.h"
1818

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/suspend.h>
2323

2424
#define CREATE_TRACE_POINTS
25-
#include <trace/events/thermal.h>
25+
#include "thermal_trace.h"
2626

2727
#include "thermal_core.h"
2828
#include "thermal_hwmon.h"

drivers/thermal/thermal_helpers.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
#include <linux/string.h>
2020
#include <linux/sysfs.h>
2121

22-
#include <trace/events/thermal.h>
23-
2422
#include "thermal_core.h"
23+
#include "thermal_trace.h"
2524

2625
int get_tz_trend(struct thermal_zone_device *tz, int trip)
2726
{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,11 @@ TRACE_EVENT(thermal_power_devfreq_limit,
195195
#endif /* CONFIG_DEVFREQ_THERMAL */
196196
#endif /* _TRACE_THERMAL_H */
197197

198+
#undef TRACE_INCLUDE_PATH
199+
#define TRACE_INCLUDE_PATH .
200+
201+
#undef TRACE_INCLUDE_FILE
202+
#define TRACE_INCLUDE_FILE thermal_trace
203+
198204
/* This part must be outside protection */
199205
#include <trace/define_trace.h>

include/trace/events/thermal_power_allocator.h renamed to drivers/thermal/thermal_trace_ipa.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,11 @@ TRACE_EVENT(thermal_power_allocator_pid,
8484
);
8585
#endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
8686

87+
#undef TRACE_INCLUDE_PATH
88+
#define TRACE_INCLUDE_PATH .
89+
90+
#undef TRACE_INCLUDE_FILE
91+
#define TRACE_INCLUDE_FILE thermal_trace_ipa
92+
8793
/* This part must be outside protection */
8894
#include <trace/define_trace.h>

0 commit comments

Comments
 (0)