tracing: Fixes for unused tracepoints for 6.17
Subsystems (7)
cover tracing: Fixes for unused tracepoints for 6.17
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
unused-tracepoints/for-next
Head SHA1: 8c4e53a1a09374c232fe96232426226b2824f473
Steven Rostedt (9):
tracing, AER: Hide PCIe AER event when PCIEAER is not configured
alarmtimer: Hide alarmtimer_suspend event when RTC_CLASS is not configured
PM: cpufreq: powernv/tracing: Move powernv_throttle trace event
PM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE
PM: tracing: Hide device_pm_callback events under PM_SLEEP
PM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS
binder: Remove unused binder lock events
tracing: arm: arm64: Hide trace events ipi_raise, ipi_entry and ipi_exit
tracing: Call trace_ftrace_test_filter() for the event
----
arch/arm/Kconfig | 1 + arch/arm64/Kconfig | 1 + drivers/android/binder_trace.h | 21 -------------- drivers/cpufreq/Makefile | 1 + drivers/cpufreq/powernv-cpufreq.c | 4 ++- drivers/cpufreq/powernv-trace.h | 44 +++++++++++++++++++++++++++++ include/ras/ras_event.h | 2 ++ include/trace/events/alarmtimer.h | 2 ++ include/trace/events/ipi.h | 58 ++++++++++++++++++++------------------ include/trace/events/power.h | 28 ++++-------------- kernel/trace/Kconfig | 6 ++++ kernel/trace/power-traces.c | 1 - kernel/trace/trace_events_filter.c | 4 +++ 13 files changed, 100 insertions(+), 73 deletions(-) create mode 100644 drivers/cpufreq/powernv-trace.h
PATCH 1/9 tracing, AER: Hide PCIe AER event when PCIEAER is not configured
From: Steven Rostedt <[email protected]>
The event aer_event is only used when CONFIG_PCIEAER is configured. It should not be created when it is not. When an event is created it creates around 5K of text and meta data regardless if the tracepoint is used or not. Instead of wasting this memory, put #ifdef around the event to not create it when it is not used.
--- include/ras/ras_event.h | 2 ++ 1 file changed, 2 insertions(+)
include/ras/ras_event.h +2 -0
@@ -252,6 +252,7 @@ TRACE_EVENT(non_standard_event, __print_hex(__get_dynamic_array(buf), __entry->len)) ); +#ifdef CONFIG_PCIEAER /* * PCIe AER Trace event *
@@ -337,6 +338,7 @@ TRACE_EVENT(aer_event, __print_array(__entry->tlp_header, PCIE_STD_MAX_TLP_HEADERLOG, 4) : "Not available") ); +#endif /* CONFIG_PCIEAER */ /* * memory-failure recovery action result event
Signature · 1 line
2.47.2
PATCH 2/9 alarmtimer: Hide alarmtimer_suspend event when RTC_CLASS is not configured
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The trace event alarmtimer_suspend is only called when RTC_CLASS is defined. As every event created can create up to 5K of text and meta data regardless if it is called or not it should not be created and waste memory. Hide the event when CONFIG_RTC_CLASS is not defined.
--- include/trace/events/alarmtimer.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/alarmtimer.h +2 -0
@@ -20,6 +20,7 @@ TRACE_DEFINE_ENUM(ALARM_BOOTTIME_FREEZER); { 1 << ALARM_REALTIME_FREEZER, "REALTIME Freezer" }, \ { 1 << ALARM_BOOTTIME_FREEZER, "BOOTTIME Freezer" }) +#ifdef CONFIG_RTC_CLASS TRACE_EVENT(alarmtimer_suspend, TP_PROTO(ktime_t expires, int flag),
@@ -41,6 +42,7 @@ TRACE_EVENT(alarmtimer_suspend, __entry->expires ) ); +#endif /* CONFIG_RTC_CLASS */ DECLARE_EVENT_CLASS(alarm_class,
Signature · 1 line
2.47.2
PATCH 3/9 PM: cpufreq: powernv/tracing: Move powernv_throttle trace event
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
As the trace event powernv_throttle is only used by the powernv code, move it to a separate include file and have that code directly enable it.
Trace events can take up around 5K of memory when they are defined regardless if they are used or not. It wastes memory to have them defined in configurations where the tracepoint is not used.
--- drivers/cpufreq/Makefile | 1 + drivers/cpufreq/powernv-cpufreq.c | 4 ++- drivers/cpufreq/powernv-trace.h | 44 +++++++++++++++++++++++++++++++ include/trace/events/power.h | 22 ---------------- kernel/trace/power-traces.c | 1 - 5 files changed, 48 insertions(+), 24 deletions(-) create mode 100644 drivers/cpufreq/powernv-trace.h
drivers/cpufreq/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_CPUFREQ_VIRT) += virtual-cpufreq.o # Traces CFLAGS_amd-pstate-trace.o := -I$(src) +CFLAGS_powernv-cpufreq.o := -I$(src) amd_pstate-y := amd-pstate.o amd-pstate-trace.o ##################################################################################
drivers/cpufreq/powernv-cpufreq.c +3 -1
@@ -21,7 +21,6 @@#include <linux/string_choices.h> #include <linux/cpu.h> #include <linux/hashtable.h> -#include <trace/events/power.h> #include <asm/cputhreads.h> #include <asm/firmware.h>
@@ -30,6 +29,9 @@#include <asm/opal.h> #include <linux/timer.h> +#define CREATE_TRACE_POINTS +#include "powernv-trace.h" +#define POWERNV_MAX_PSTATES_ORDER 8#define POWERNV_MAX_PSTATES (1UL << (POWERNV_MAX_PSTATES_ORDER))#define PMSR_PSAFE_ENABLE (1UL << 30)
drivers/cpufreq/powernv-trace.h new file +44 -0
44 lines not on this page · raw message
include/trace/events/power.h +0 -22
@@ -99,28 +99,6 @@ DEFINE_EVENT(psci_domain_idle, psci_domain_idle_exit,TP_ARGS (cpu_id, state, s2idle) ); -TRACE_EVENT (powernv_throttle, - - TP_PROTO(int chip_id, const char *reason, int pmax), - -TP_ARGS (chip_id, reason, pmax), - -TP_STRUCT__entry ( - __field(int, chip_id) - __string(reason, reason) -__field (int, pmax) - ), - -TP_fast_assign ( - __entry->chip_id = chip_id; - __assign_str(reason); - __entry->pmax = pmax; - ), - -TP_printk ("Chip %d Pmax %d %s" , __entry->chip_id, - __entry->pmax,__get_str (reason)) -); - TRACE_EVENT(pstate_sample, TP_PROTO(u32 core_busy,
kernel/trace/power-traces.c +0 -1
@@ -17,5 +17,4 @@EXPORT_TRACEPOINT_SYMBOL_GPL (suspend_resume);EXPORT_TRACEPOINT_SYMBOL_GPL (cpu_idle);EXPORT_TRACEPOINT_SYMBOL_GPL (cpu_frequency); -EXPORT_TRACEPOINT_SYMBOL_GPL (powernv_throttle);
Signature · 1 line
2.47.2
PATCH 4/9 PM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The events psci_domain_idle_enter and psci_domain_idle_exit events are only called when CONFIG_ARM_PSCI_CPUIDLE is defined. As each event can take up to 5K (less for DEFINE_EVENT()) regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when they are not used.
--- include/trace/events/power.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/power.h +2 -0
@@ -62,6 +62,7 @@ TRACE_EVENT(cpu_idle_miss, (unsigned long)__entry->state, (__entry->below)?"below":"above") ); +#ifdef CONFIG_ARM_PSCI_CPUIDLE DECLARE_EVENT_CLASS(psci_domain_idle, TP_PROTO(unsigned int cpu_id, unsigned int state, bool s2idle),
@@ -98,6 +99,7 @@ DEFINE_EVENT(psci_domain_idle, psci_domain_idle_exit,TP_ARGS (cpu_id, state, s2idle) ); +#endif TRACE_EVENT(pstate_sample,
Signature · 1 line
2.47.2
PATCH 5/9 PM: tracing: Hide device_pm_callback events under PM_SLEEP
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The events device_pm_callback_start and device_pm_callback_end events are only called when CONFIG_PM_SLEEP is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when they are not used.
--- include/trace/events/power.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/power.h +2 -0
@@ -212,6 +212,7 @@ TRACE_EVENT(cpu_frequency_limits, (unsigned long)__entry->cpu_id) ); +#ifdef CONFIG_PM_SLEEP TRACE_EVENT(device_pm_callback_start, TP_PROTO(struct device *dev, const char *pm_ops, int event),
@@ -260,6 +261,7 @@ TRACE_EVENT(device_pm_callback_end,TP_printk ("%s %s, err=%d" ,__get_str (driver),__get_str (device), __entry->error) ); +#endif TRACE_EVENT(suspend_resume,
Signature · 1 line
2.47.2
PATCH 6/9 PM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The power_domain_target event event is only called when CONFIG_OMAP2PLUS is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when they are not used.
--- include/trace/events/power.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/power.h +2 -0
@@ -319,6 +319,7 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,TP_ARGS (name, state) ); +#ifdef CONFIG_ARCH_OMAP2PLUS /* * The power domain events are used for power domains transitions */
@@ -350,6 +351,7 @@ DEFINE_EVENT(power_domain, power_domain_target,TP_ARGS (name, state, cpu_id) ); +#endif /* * CPU latency QoS events used for global CPU latency QoS list updates
Signature · 1 line
2.47.2
PATCH 7/9 binder: Remove unused binder lock events
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
Trace events can take up to 5K each when they are defined, regardless if they are used or not. The binder lock events: binder_lock, binder_locked and binder_unlock are no longer used.
Remove them.
--- drivers/android/binder_trace.h | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/android/binder_trace.h +0 -21
@@ -34,27 +34,6 @@ TRACE_EVENT(binder_ioctl,TP_printk ("cmd=0x%x arg=0x%lx" , __entry->cmd, __entry->arg) ); -DECLARE_EVENT_CLASS (binder_lock_class, - TP_PROTO(const char *tag), -TP_ARGS (tag), -TP_STRUCT__entry ( - __field(const char *, tag) - ), -TP_fast_assign ( - __entry->tag = tag; - ), -TP_printk ("tag=%s" , __entry->tag) -); - -#define DEFINE_BINDER_LOCK_EVENT (name) \ -DEFINE_EVENT(binder_lock_class, name, \ - TP_PROTO(const char *func), \ - TP_ARGS(func)) - -DEFINE_BINDER_LOCK_EVENT (binder_lock); -DEFINE_BINDER_LOCK_EVENT (binder_locked); -DEFINE_BINDER_LOCK_EVENT (binder_unlock); - DECLARE_EVENT_CLASS(binder_function_return_class, TP_PROTO(int ret), TP_ARGS(ret),
Signature · 1 line
2.47.2
PATCH 8/9 tracing: arm: arm64: Hide trace events ipi_raise, ipi_entry and ipi_exit
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The ipi tracepoints are mostly generic, but the tracepoints ipi_raise, ipi_entry and ipi_exit are only used by arm and arm64. This means these trace events are wasting memory in all the other architectures that do not use them.
Add CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS and have arm and arm64 select it to enable these trace events. The config makes it easy if other architectures decide to trace these as well.
--- arch/arm/Kconfig | 1 + arch/arm64/Kconfig | 1 + include/trace/events/ipi.h | 58 ++++++++++++++++++++------------------ kernel/trace/Kconfig | 6 ++++ 4 files changed, 38 insertions(+), 28 deletions(-)
arch/arm/Kconfig +1 -0
@@ -102,6 +102,7 @@ config ARM select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL select HAVE_DMA_CONTIGUOUS if MMU + select HAVE_EXTRA_IPI_TRACEPOINTS select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
arch/arm64/Kconfig +1 -0
@@ -136,6 +136,7 @@ config ARM64 select CPU_PM if (SUSPEND || CPU_IDLE) select CPUMASK_OFFSTACK if NR_CPUS > 256 select DCACHE_WORD_ACCESS + select HAVE_EXTRA_IPI_TRACEPOINTS select DYNAMIC_FTRACE if FUNCTION_TRACER select DMA_BOUNCE_UNALIGNED_KMALLOC select DMA_DIRECT_REMAP
include/trace/events/ipi.h +30 -28
76 lines not on this page · raw message
kernel/trace/Kconfig +6 -0
@@ -53,6 +53,12 @@ config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS config HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS bool +config HAVE_EXTRA_IPI_TRACEPOINTS + bool + help + For architectures that use ipi_raise, ipi_entry and ipi_exit + tracepoints. + config HAVE_DYNAMIC_FTRACE_WITH_ARGS bool help
Signature · 1 line
2.47.2
PATCH 9/9 tracing: Call trace_ftrace_test_filter() for the event
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The trace event filter bootup self test tests a bunch of filter logic against the ftrace_test_filter event, but does not actually call the event. Work is being done to cause a warning if an event is defined but not used. To quiet the warning call the trace event under an if statement where it is disabled so it doesn't get optimized out.
--- kernel/trace/trace_events_filter.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/trace/trace_events_filter.c +4 -0
@@ -2900,6 +2900,10 @@ static __init int ftrace_test_event_filter(void)if (i ==DATA_CNT )printk (KERN_CONT "OK\n" ); +/* Need to call ftrace_test_filter to prevent a warning */ +if (!trace_ftrace_test_filter_enabled ()) +trace_ftrace_test_filter (1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ); +return 0 ; }
Signature · 1 line
2.47.2