* [PATCH] cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used
@ 2026-10-22 19:33 Steven Rostedt
2026-10-22 19:54 ` Wysocki, Rafael J
0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2026-10-22 19:33 UTC (permalink / raw)
To: LKML, Linux Trace Kernel
Cc: Rafael J. Wysocki, Mario Limonciello (AMD), Eiichi Tsukata, Julia Lawall
From: Steven Rostedt <rostedt@goodmis.org>
Tracepoints that are defined take up around 5K each, even if they are not
used. When a tracepoint is used only in code when a specific config is
enabled, their definition must also be only defined when the same config
is enabled otherwise it wastes memory.
The tracepoint guest_halt_poll_ns is only used when CONFIG_CPU_IDLE_GOV_HALTPOLL
is enabled. Guard the definition of that tracepoint with the same config.
Fixes: 0da11bf0cab90 ("cpuidle: haltpoll: Add trace points for guest_halt_poll_ns grow/shrink")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/trace/events/power.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 370f8df2fdb4..4d17eb307b6a 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -497,6 +497,7 @@ DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request,
TP_ARGS(name, type, new_value)
);
+#ifdef CONFIG_CPU_IDLE_GOV_HALTPOLL
TRACE_EVENT(guest_halt_poll_ns,
TP_PROTO(bool grow, unsigned int new, unsigned int old),
@@ -525,6 +526,8 @@ TRACE_EVENT(guest_halt_poll_ns,
trace_guest_halt_poll_ns(true, new, old)
#define trace_guest_halt_poll_ns_shrink(new, old) \
trace_guest_halt_poll_ns(false, new, old)
+#endif /* CONFIG_CPU_IDLE_GOV_HALTPOLL */
+
#endif /* _TRACE_POWER_H */
/* This part must be outside protection */
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used
2026-10-22 19:33 [PATCH] cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used Steven Rostedt
@ 2026-10-22 19:54 ` Wysocki, Rafael J
2026-10-22 20:00 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: Wysocki, Rafael J @ 2026-10-22 19:54 UTC (permalink / raw)
To: Steven Rostedt, Linux Trace Kernel
Cc: Mario Limonciello (AMD), Eiichi Tsukata, Julia Lawall, LKML
On 10/22/2026 9:33 PM, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> Tracepoints that are defined take up around 5K each, even if they are not
> used. When a tracepoint is used only in code when a specific config is
> enabled, their definition must also be only defined when the same config
> is enabled otherwise it wastes memory.
>
> The tracepoint guest_halt_poll_ns is only used when CONFIG_CPU_IDLE_GOV_HALTPOLL
> is enabled. Guard the definition of that tracepoint with the same config.
>
> Fixes: 0da11bf0cab90 ("cpuidle: haltpoll: Add trace points for guest_halt_poll_ns grow/shrink")
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Thanks!
> ---
> include/trace/events/power.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/trace/events/power.h b/include/trace/events/power.h
> index 370f8df2fdb4..4d17eb307b6a 100644
> --- a/include/trace/events/power.h
> +++ b/include/trace/events/power.h
> @@ -497,6 +497,7 @@ DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request,
> TP_ARGS(name, type, new_value)
> );
>
> +#ifdef CONFIG_CPU_IDLE_GOV_HALTPOLL
> TRACE_EVENT(guest_halt_poll_ns,
>
> TP_PROTO(bool grow, unsigned int new, unsigned int old),
> @@ -525,6 +526,8 @@ TRACE_EVENT(guest_halt_poll_ns,
> trace_guest_halt_poll_ns(true, new, old)
> #define trace_guest_halt_poll_ns_shrink(new, old) \
> trace_guest_halt_poll_ns(false, new, old)
> +#endif /* CONFIG_CPU_IDLE_GOV_HALTPOLL */
> +
> #endif /* _TRACE_POWER_H */
>
> /* This part must be outside protection */
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used
2026-10-22 19:54 ` Wysocki, Rafael J
@ 2026-10-22 20:00 ` Steven Rostedt
2026-10-22 20:02 ` Wysocki, Rafael J
0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2026-10-22 20:00 UTC (permalink / raw)
To: Wysocki, Rafael J
Cc: Linux Trace Kernel, Mario Limonciello (AMD),
Eiichi Tsukata, Julia Lawall, LKML
On Thu, 22 Oct 2026 21:54:09 +0200
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com> wrote:
> On 10/22/2026 9:33 PM, Steven Rostedt wrote:
> > From: Steven Rostedt <rostedt@goodmis.org>
> >
> > Tracepoints that are defined take up around 5K each, even if they are not
> > used. When a tracepoint is used only in code when a specific config is
> > enabled, their definition must also be only defined when the same config
> > is enabled otherwise it wastes memory.
> >
> > The tracepoint guest_halt_poll_ns is only used when CONFIG_CPU_IDLE_GOV_HALTPOLL
> > is enabled. Guard the definition of that tracepoint with the same config.
> >
> > Fixes: 0da11bf0cab90 ("cpuidle: haltpoll: Add trace points for guest_halt_poll_ns grow/shrink")
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Thanks!
Want me to take this through my tree, or do you want to take it?
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used
2026-10-22 20:00 ` Steven Rostedt
@ 2026-10-22 20:02 ` Wysocki, Rafael J
0 siblings, 0 replies; 4+ messages in thread
From: Wysocki, Rafael J @ 2026-10-22 20:02 UTC (permalink / raw)
To: Steven Rostedt
Cc: Linux Trace Kernel, Mario Limonciello (AMD),
Eiichi Tsukata, Julia Lawall, LKML
On 10/22/2026 10:00 PM, Steven Rostedt wrote:
> On Thu, 22 Oct 2026 21:54:09 +0200
> "Wysocki, Rafael J" <rafael.j.wysocki@intel.com> wrote:
>
>> On 10/22/2026 9:33 PM, Steven Rostedt wrote:
>>> From: Steven Rostedt <rostedt@goodmis.org>
>>>
>>> Tracepoints that are defined take up around 5K each, even if they are not
>>> used. When a tracepoint is used only in code when a specific config is
>>> enabled, their definition must also be only defined when the same config
>>> is enabled otherwise it wastes memory.
>>>
>>> The tracepoint guest_halt_poll_ns is only used when CONFIG_CPU_IDLE_GOV_HALTPOLL
>>> is enabled. Guard the definition of that tracepoint with the same config.
>>>
>>> Fixes: 0da11bf0cab90 ("cpuidle: haltpoll: Add trace points for guest_halt_poll_ns grow/shrink")
>>> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> Thanks!
> Want me to take this through my tree, or do you want to take it?
Please feel free to take it.
Rafael
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-22 20:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 19:33 [PATCH] cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used Steven Rostedt
2026-10-22 19:54 ` Wysocki, Rafael J
2026-10-22 20:00 ` Steven Rostedt
2026-10-22 20:02 ` Wysocki, Rafael J
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®