Skip to content

Commit

Permalink
thermal/core: Relocate the traces definition in thermal directory
Browse files Browse the repository at this point in the history
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 <[email protected]>
Suggested-by: Steven Rostedt <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Reviewed-by: Steven Rostedt (Google) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
dlezcano committed Apr 1, 2023
1 parent e45c9a2 commit 32a7a02
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 9 deletions.
3 changes: 2 additions & 1 deletion drivers/thermal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/cpufreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/devfreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/gov_fair_share.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

#include <linux/thermal.h>
#include <trace/events/thermal.h>
#include "thermal_trace.h"

#include "thermal_core.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/gov_power_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/gov_step_wise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions drivers/thermal/thermal_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,11 @@ TRACE_EVENT(thermal_power_devfreq_limit,
#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>
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,11 @@ TRACE_EVENT(thermal_power_allocator_pid,
);
#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>

0 comments on commit 32a7a02

Please sign in to comment.