Skip to content

Commit 2be6a75

Browse files
committed
Merge tag 'trace-unused-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracepoint cleanup from Steven Rostedt: "Remove or hide unused tracepoints Tracepoints take up memory (around 5K per tracepoint) even when they are unused. Changes are being made to detect when a tracepoint is defined but unused and a warning is shown at build. But those changes are not yet ready for inclusion. - Fix some of the unused tracepoints that it detected Some tracepoints were removed and others were hidden by config settings to match the config settings of where they are instantiated. Some tracepoints were moved into architecture specific code as only one architecture used them. - Call the ftrace_test_filter tracepoint in an unreachable if statement The ftrace_test_filter tracepoint which is defined when ftrace selftests are configured and is used to test the filter logic, but the tracepoint is not actually called. It is put into an if statement to not have it get compiled out, but also not warn for not being used" * tag 'trace-unused-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: sched: Hide numa events under CONFIG_NUMA_BALANCING powerpc/thp: tracing: Hide hugepage events under CONFIG_PPC_BOOK3S_64 tracing: Call trace_ftrace_test_filter() for the event tracing: arm: arm64: Hide trace events ipi_raise, ipi_entry and ipi_exit binder: Remove unused binder lock events PM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS PM: tracing: Hide device_pm_callback events under PM_SLEEP PM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE PM: cpufreq: powernv/tracing: Move powernv_throttle trace event alarmtimer: Hide alarmtimer_suspend event when RTC_CLASS is not configured tracing, AER: Hide PCIe AER event when PCIEAER is not configured
2 parents 4ff261e + c2dbaf0 commit 2be6a75

File tree

14 files changed

+103
-53
lines changed

14 files changed

+103
-53
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ config ARM
100100
select HAVE_BUILDTIME_MCOUNT_SORT
101101
select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
102102
select HAVE_DMA_CONTIGUOUS if MMU
103+
select HAVE_EXTRA_IPI_TRACEPOINTS
103104
select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
104105
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
105106
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ config ARM64
134134
select CPU_PM if (SUSPEND || CPU_IDLE)
135135
select CPUMASK_OFFSTACK if NR_CPUS > 256
136136
select DCACHE_WORD_ACCESS
137+
select HAVE_EXTRA_IPI_TRACEPOINTS
137138
select DYNAMIC_FTRACE if FUNCTION_TRACER
138139
select DMA_BOUNCE_UNALIGNED_KMALLOC
139140
select DMA_DIRECT_REMAP

drivers/cpufreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ obj-$(CONFIG_CPUFREQ_VIRT) += virtual-cpufreq.o
2121

2222
# Traces
2323
CFLAGS_amd-pstate-trace.o := -I$(src)
24+
CFLAGS_powernv-cpufreq.o := -I$(src)
2425
amd_pstate-y := amd-pstate.o amd-pstate-trace.o
2526

2627
##################################################################################

drivers/cpufreq/powernv-cpufreq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/string_choices.h>
2222
#include <linux/cpu.h>
2323
#include <linux/hashtable.h>
24-
#include <trace/events/power.h>
2524

2625
#include <asm/cputhreads.h>
2726
#include <asm/firmware.h>
@@ -30,6 +29,9 @@
3029
#include <asm/opal.h>
3130
#include <linux/timer.h>
3231

32+
#define CREATE_TRACE_POINTS
33+
#include "powernv-trace.h"
34+
3335
#define POWERNV_MAX_PSTATES_ORDER 8
3436
#define POWERNV_MAX_PSTATES (1UL << (POWERNV_MAX_PSTATES_ORDER))
3537
#define PMSR_PSAFE_ENABLE (1UL << 30)

drivers/cpufreq/powernv-trace.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
#if !defined(_POWERNV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
4+
#define _POWERNV_TRACE_H
5+
6+
#include <linux/cpufreq.h>
7+
#include <linux/tracepoint.h>
8+
#include <linux/trace_events.h>
9+
10+
#undef TRACE_SYSTEM
11+
#define TRACE_SYSTEM power
12+
13+
TRACE_EVENT(powernv_throttle,
14+
15+
TP_PROTO(int chip_id, const char *reason, int pmax),
16+
17+
TP_ARGS(chip_id, reason, pmax),
18+
19+
TP_STRUCT__entry(
20+
__field(int, chip_id)
21+
__string(reason, reason)
22+
__field(int, pmax)
23+
),
24+
25+
TP_fast_assign(
26+
__entry->chip_id = chip_id;
27+
__assign_str(reason);
28+
__entry->pmax = pmax;
29+
),
30+
31+
TP_printk("Chip %d Pmax %d %s", __entry->chip_id,
32+
__entry->pmax, __get_str(reason))
33+
);
34+
35+
#endif /* _POWERNV_TRACE_H */
36+
37+
/* This part must be outside protection */
38+
#undef TRACE_INCLUDE_PATH
39+
#define TRACE_INCLUDE_PATH .
40+
41+
#undef TRACE_INCLUDE_FILE
42+
#define TRACE_INCLUDE_FILE powernv-trace
43+
44+
#include <trace/define_trace.h>

include/ras/ras_event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ TRACE_EVENT(non_standard_event,
252252
__print_hex(__get_dynamic_array(buf), __entry->len))
253253
);
254254

255+
#ifdef CONFIG_PCIEAER
255256
/*
256257
* PCIe AER Trace event
257258
*
@@ -337,6 +338,7 @@ TRACE_EVENT(aer_event,
337338
__print_array(__entry->tlp_header, PCIE_STD_MAX_TLP_HEADERLOG, 4) :
338339
"Not available")
339340
);
341+
#endif /* CONFIG_PCIEAER */
340342

341343
/*
342344
* memory-failure recovery action result event

include/trace/events/alarmtimer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ TRACE_DEFINE_ENUM(ALARM_BOOTTIME_FREEZER);
2020
{ 1 << ALARM_REALTIME_FREEZER, "REALTIME Freezer" }, \
2121
{ 1 << ALARM_BOOTTIME_FREEZER, "BOOTTIME Freezer" })
2222

23+
#ifdef CONFIG_RTC_CLASS
2324
TRACE_EVENT(alarmtimer_suspend,
2425

2526
TP_PROTO(ktime_t expires, int flag),
@@ -41,6 +42,7 @@ TRACE_EVENT(alarmtimer_suspend,
4142
__entry->expires
4243
)
4344
);
45+
#endif /* CONFIG_RTC_CLASS */
4446

4547
DECLARE_EVENT_CLASS(alarm_class,
4648

include/trace/events/ipi.h

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,6 @@
77

88
#include <linux/tracepoint.h>
99

10-
/**
11-
* ipi_raise - called when a smp cross call is made
12-
*
13-
* @mask: mask of recipient CPUs for the IPI
14-
* @reason: string identifying the IPI purpose
15-
*
16-
* It is necessary for @reason to be a static string declared with
17-
* __tracepoint_string.
18-
*/
19-
TRACE_EVENT(ipi_raise,
20-
21-
TP_PROTO(const struct cpumask *mask, const char *reason),
22-
23-
TP_ARGS(mask, reason),
24-
25-
TP_STRUCT__entry(
26-
__bitmask(target_cpus, nr_cpumask_bits)
27-
__field(const char *, reason)
28-
),
29-
30-
TP_fast_assign(
31-
__assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
32-
__entry->reason = reason;
33-
),
34-
35-
TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
36-
);
37-
3810
TRACE_EVENT(ipi_send_cpu,
3911

4012
TP_PROTO(const unsigned int cpu, unsigned long callsite, void *callback),
@@ -79,6 +51,35 @@ TRACE_EVENT(ipi_send_cpumask,
7951
__get_cpumask(cpumask), __entry->callsite, __entry->callback)
8052
);
8153

54+
#ifdef CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS
55+
/**
56+
* ipi_raise - called when a smp cross call is made
57+
*
58+
* @mask: mask of recipient CPUs for the IPI
59+
* @reason: string identifying the IPI purpose
60+
*
61+
* It is necessary for @reason to be a static string declared with
62+
* __tracepoint_string.
63+
*/
64+
TRACE_EVENT(ipi_raise,
65+
66+
TP_PROTO(const struct cpumask *mask, const char *reason),
67+
68+
TP_ARGS(mask, reason),
69+
70+
TP_STRUCT__entry(
71+
__bitmask(target_cpus, nr_cpumask_bits)
72+
__field(const char *, reason)
73+
),
74+
75+
TP_fast_assign(
76+
__assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
77+
__entry->reason = reason;
78+
),
79+
80+
TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
81+
);
82+
8283
DECLARE_EVENT_CLASS(ipi_handler,
8384

8485
TP_PROTO(const char *reason),
@@ -127,6 +128,7 @@ DEFINE_EVENT(ipi_handler, ipi_exit,
127128

128129
TP_ARGS(reason)
129130
);
131+
#endif /* CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS */
130132

131133
#endif /* _TRACE_IPI_H */
132134

include/trace/events/power.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ TRACE_EVENT(cpu_idle_miss,
6262
(unsigned long)__entry->state, (__entry->below)?"below":"above")
6363
);
6464

65+
#ifdef CONFIG_ARM_PSCI_CPUIDLE
6566
DECLARE_EVENT_CLASS(psci_domain_idle,
6667

6768
TP_PROTO(unsigned int cpu_id, unsigned int state, bool s2idle),
@@ -98,28 +99,7 @@ DEFINE_EVENT(psci_domain_idle, psci_domain_idle_exit,
9899

99100
TP_ARGS(cpu_id, state, s2idle)
100101
);
101-
102-
TRACE_EVENT(powernv_throttle,
103-
104-
TP_PROTO(int chip_id, const char *reason, int pmax),
105-
106-
TP_ARGS(chip_id, reason, pmax),
107-
108-
TP_STRUCT__entry(
109-
__field(int, chip_id)
110-
__string(reason, reason)
111-
__field(int, pmax)
112-
),
113-
114-
TP_fast_assign(
115-
__entry->chip_id = chip_id;
116-
__assign_str(reason);
117-
__entry->pmax = pmax;
118-
),
119-
120-
TP_printk("Chip %d Pmax %d %s", __entry->chip_id,
121-
__entry->pmax, __get_str(reason))
122-
);
102+
#endif
123103

124104
TRACE_EVENT(pstate_sample,
125105

@@ -232,6 +212,7 @@ TRACE_EVENT(cpu_frequency_limits,
232212
(unsigned long)__entry->cpu_id)
233213
);
234214

215+
#ifdef CONFIG_PM_SLEEP
235216
TRACE_EVENT(device_pm_callback_start,
236217

237218
TP_PROTO(struct device *dev, const char *pm_ops, int event),
@@ -280,6 +261,7 @@ TRACE_EVENT(device_pm_callback_end,
280261
TP_printk("%s %s, err=%d",
281262
__get_str(driver), __get_str(device), __entry->error)
282263
);
264+
#endif
283265

284266
TRACE_EVENT(suspend_resume,
285267

@@ -337,6 +319,7 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
337319
TP_ARGS(name, state)
338320
);
339321

322+
#ifdef CONFIG_ARCH_OMAP2PLUS
340323
/*
341324
* The power domain events are used for power domains transitions
342325
*/
@@ -368,6 +351,7 @@ DEFINE_EVENT(power_domain, power_domain_target,
368351

369352
TP_ARGS(name, state, cpu_id)
370353
);
354+
#endif
371355

372356
/*
373357
* CPU latency QoS events used for global CPU latency QoS list updates

include/trace/events/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ TRACE_EVENT(sched_process_hang,
628628
);
629629
#endif /* CONFIG_DETECT_HUNG_TASK */
630630

631+
#ifdef CONFIG_NUMA_BALANCING
631632
/*
632633
* Tracks migration of tasks from one runqueue to another. Can be used to
633634
* detect if automatic NUMA balancing is bouncing between nodes.
@@ -720,7 +721,6 @@ DEFINE_EVENT(sched_numa_pair_template, sched_swap_numa,
720721
TP_ARGS(src_tsk, src_cpu, dst_tsk, dst_cpu)
721722
);
722723

723-
#ifdef CONFIG_NUMA_BALANCING
724724
#define NUMAB_SKIP_REASON \
725725
EM( NUMAB_SKIP_UNSUITABLE, "unsuitable" ) \
726726
EM( NUMAB_SKIP_SHARED_RO, "shared_ro" ) \

0 commit comments

Comments
 (0)