tracepoints: Add warnings for unused tracepoints and trace events
Subsystems (4)
v6 cover tracepoints: Add warnings for unused tracepoints and trace events
Every trace event can take up to 5K of memory in text and metadata regardless if they are used or not. Trace events should not be created if they are not used. Currently there's several events in the kernel that are defined but unused, either because their callers were removed without removing the trace event with it, or a config hides the trace event caller but not the trace event itself. And in some cases, trace events were simply added but were never called for whatever reason. The number of unused trace events continues to grow.
This patch series aims to fix this.
The first patch moves the elf parsing out of sorttable.c so that it can be used by other tooling.
The second patch creates a new program to run during build called tracepoint-update (note this may be extended to do other tracepoint modifications in the future). It also creates a new section called __tracepoint_check, where all callers of a tracepoint creates a variable that is placed in this section with the name of the tracepoint they use. The scripts/tracepoint-update.c is used to find tracepoints that are defined but not used which would mean they would not be in the __tracepoint_check section. It sorts the names from that section, and then reads the __tracepoint_strings section that has all compiled in tracepoint names. It makes sure that every tracepoint is found in the check section and if not, it prints a warning message about it. This lists the missing tracepoints at build time.
The third patch adds EXPORT_TRACEPOINT() to the __tracepoint_check section as well. There was several locations that adds tracepoints in the kernel proper that are only used in modules. It was getting quite complex trying to move things around that I just decided to make any tracepoint in a EXPORT_TRACEPOINT "used". I'm using the analogy of static and global functions. An unused static function gets a warning but an unused global one does not.
Changes since v5: https://lore.kernel.org/linux-trace-kernel/[email protected]
- Removed extra blank line at end of elf-parse.h
- Fixed change log "it's name" to "its name" (Mathieu Desnoyers)
- Removed unnecessary len = strlen(str) in increment of for_each_shdr_str()
- Removed assigned but not used "count" in check_tracepoints (kernel test robot)
- Added more comments
Steven Rostedt (3):
sorttable: Move ELF parsing into scripts/elf-parse.[ch]
tracing: Add a tracepoint verification check at build time
tracepoint: Do not warn for unused event that is exported
----
include/asm-generic/vmlinux.lds.h | 1 + include/linux/tracepoint.h | 12 + kernel/trace/Kconfig | 10 + scripts/Makefile | 6 + scripts/elf-parse.c | 198 ++++++++++++++++ scripts/elf-parse.h | 305 ++++++++++++++++++++++++ scripts/link-vmlinux.sh | 4 + scripts/sorttable.c | 477 +++----------------------------------- scripts/tracepoint-update.c | 232 ++++++++++++++++++ 9 files changed, 802 insertions(+), 443 deletions(-) create mode 100644 scripts/elf-parse.c create mode 100644 scripts/elf-parse.h create mode 100644 scripts/tracepoint-update.c
PATCH v6 1/3 sorttable: Move ELF parsing into scripts/elf-parse.[ch]
From: Steven Rostedt <[email protected]>
In order to share the elf parsing that is in sorttable.c so that other programs could use the same code, move it into elf-parse.c and elf-parse.h.
---
Changes since v5: https://lore.kernel.org/[email protected]
- Removed extra blank line at end of elf-parse.h
scripts/Makefile | 3 + scripts/elf-parse.c | 198 ++++++++++++++++++ scripts/elf-parse.h | 305 ++++++++++++++++++++++++++++ scripts/sorttable.c | 477 ++++---------------------------------------- 4 files changed, 540 insertions(+), 443 deletions(-) create mode 100644 scripts/elf-parse.c create mode 100644 scripts/elf-parse.h
scripts/Makefile +3 -0
@@ -12,6 +12,8 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_builder hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_gen +sorttable-objs := sorttable.o elf-parse.o + ifneq ($(or $(CONFIG_X86_64),$(CONFIG_X86_32)),) always-$(CONFIG_RUST) += target.json filechk_rust_target = $< < include/config/auto.conf
@@ -25,6 +27,7 @@ generate_rust_target-rust := y rustdoc_test_builder-rust := y rustdoc_test_gen-rust := y +HOSTCFLAGS_elf-parse.o = -I$(srctree)/tools/include HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include HOSTLDLIBS_sorttable = -lpthread HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
scripts/elf-parse.c new file +198 -0
198 lines not on this page · raw message
scripts/elf-parse.h new file +305 -0
305 lines not on this page · raw message
scripts/sorttable.c +34 -443
622 lines not on this page · raw message
Signature · 1 line
2.50.1
PATCH v6 2/3 tracing: Add a tracepoint verification check at build time
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
If a tracepoint is defined via DECLARE_TRACE() or TRACE_EVENT() but never called (via the trace_<tracepoint>() function), its metadata is still around in memory and not discarded.
When created via TRACE_EVENT() the situation is worse because the TRACE_EVENT() creates metadata that can be around 5k per trace event. Having unused trace events causes several thousand of wasted bytes.
Add a verifier that injects a string of the name of the tracepoint it calls that is added to the discarded section "__tracepoint_check". For every builtin tracepoint, its name (which is saved in the in-memory section "__tracepoint_strings") will have its name also in the "__tracepoint_check" section if it is used.
Add a new program that is run on build called tracepoint-update. This is executed on the vmlinux.o before the __tracepoint_check section is discarded (the section is discarded before vmlinux is created). This program will create an array of each string in the __tracepoint_check section and then sort it. Then it will walk the strings in the __tracepoint_strings section and do a binary search to check if its name is in the __tracepoint_check section. If it is not, then it is unused and a warning is printed.
Note, this currently only handles tracepoints that are builtin and not in modules.
Enabling this currently with a given config produces:
warning: tracepoint 'sched_move_numa' is unused.
warning: tracepoint 'sched_stick_numa' is unused.
warning: tracepoint 'sched_swap_numa' is unused.
warning: tracepoint 'pelt_hw_tp' is unused.
warning: tracepoint 'pelt_irq_tp' is unused.
warning: tracepoint 'rcu_preempt_task' is unused.
warning: tracepoint 'rcu_unlock_preempted_task' is unused.
warning: tracepoint 'xdp_bulk_tx' is unused.
warning: tracepoint 'xdp_redirect_map' is unused.
warning: tracepoint 'xdp_redirect_map_err' is unused.
warning: tracepoint 'vma_mas_szero' is unused.
warning: tracepoint 'vma_store' is unused.
warning: tracepoint 'hugepage_set_pmd' is unused.
warning: tracepoint 'hugepage_set_pud' is unused.
warning: tracepoint 'hugepage_update_pmd' is unused.
warning: tracepoint 'hugepage_update_pud' is unused.
warning: tracepoint 'block_rq_remap' is unused.
warning: tracepoint 'xhci_dbc_handle_event' is unused.
warning: tracepoint 'xhci_dbc_handle_transfer' is unused.
warning: tracepoint 'xhci_dbc_gadget_ep_queue' is unused.
warning: tracepoint 'xhci_dbc_alloc_request' is unused.
warning: tracepoint 'xhci_dbc_free_request' is unused.
warning: tracepoint 'xhci_dbc_queue_request' is unused.
warning: tracepoint 'xhci_dbc_giveback_request' is unused.
warning: tracepoint 'tcp_ao_wrong_maclen' is unused.
warning: tracepoint 'tcp_ao_mismatch' is unused.
warning: tracepoint 'tcp_ao_key_not_found' is unused.
warning: tracepoint 'tcp_ao_rnext_request' is unused.
warning: tracepoint 'tcp_ao_synack_no_key' is unused.
warning: tracepoint 'tcp_ao_snd_sne_update' is unused.
warning: tracepoint 'tcp_ao_rcv_sne_update' is unused.
Some of the above is totally unused but others are not used due to their "trace_" functions being inside configs, in which case, the defined tracepoints should also be inside those same configs. Others are architecture specific but defined in generic code, where they should either be moved to the architecture or be surrounded by #ifdef for the architectures they are for.
This tool could be updated to process modules in the future.
I'd like to thank Mathieu Desnoyers for suggesting using strings instead of pointers, as using pointers in vmlinux.o required handling relocations and it required implementing almost a full feature linker to do so.
---
Changes since v5: https://lore.kernel.org/[email protected]
- Fixed change log "it's name" to "its name" (Mathieu Desnoyers)
- Removed unnecessary len = strlen(str) in increment of for_each_shdr_str()
- Removed assigned but not used "count" in check_tracepoints (kernel test robot)
- Added more comments
include/asm-generic/vmlinux.lds.h | 1 + include/linux/tracepoint.h | 10 ++ kernel/trace/Kconfig | 10 ++ scripts/Makefile | 3 + scripts/link-vmlinux.sh | 4 + scripts/tracepoint-update.c | 232 ++++++++++++++++++++++++++++++ 6 files changed, 260 insertions(+) create mode 100644 scripts/tracepoint-update.c
include/asm-generic/vmlinux.lds.h +1 -0
@@ -1047,6 +1047,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG) *(.modinfo) \ /* ld.bfd warns about .gnu.version* even when not emitted */ \ *(.gnu.version*) \ + *(__tracepoint_check)#define DISCARDS \ /DISCARD/ : { \
include/linux/tracepoint.h +10 -0
@@ -221,6 +221,14 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) __do_trace_##name(args); \ } +#ifdef CONFIG_TRACEPOINT_WARN_ON_UNUSED +# define TRACEPOINT_CHECK (name) \ + static const char __used __section("__tracepoint_check") __trace_check[] = \ + #name; +#else +# define TRACEPOINT_CHECK (tname) +#endif +/* * Make sure the alignment of the structure in the __tracepoints section will * not add unwanted padding between the beginning of the section and the
@@ -270,6 +278,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) __DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto)) \ static inline void __do_trace_##name(proto) \ { \ +TRACEPOINT_CHECK (name) \ if (cond) { \guard (preempt_notrace)(); \__DO_TRACE_CALL (name,TP_ARGS (args)); \
@@ -289,6 +298,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) __DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto)) \ static inline void __do_trace_##name(proto) \ { \ +TRACEPOINT_CHECK (name) \guard (rcu_tasks_trace )(); \__DO_TRACE_CALL (name,TP_ARGS (args)); \ } \
kernel/trace/Kconfig +10 -0
@@ -1067,6 +1067,16 @@ config GCOV_PROFILE_FTRACE Note that on a kernel compiled with this config, ftrace will run significantly slower. +config TRACEPOINT_WARN_ON_UNUSED + bool "Warn on build if a tracepoint is defined but not used" + depends on TRACEPOINTS + help + This option checks if every builtin defined tracepoint is + used in the code. If a tracepoint is defined but not used, + it will waste memory as its metadata is still created. + This will cause a warning at build time if it detects a + tracepoint created but never called. + config FTRACE_SELFTEST bool
scripts/Makefile +3 -0
@@ -11,8 +11,10 @@ hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_builder hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_gen +hostprogs-always-$(CONFIG_TRACEPOINT_WARN_ON_UNUSED) += tracepoint-update sorttable-objs := sorttable.o elf-parse.o +tracepoint-update-objs := tracepoint-update.o elf-parse.o ifneq ($(or $(CONFIG_X86_64),$(CONFIG_X86_32)),) always-$(CONFIG_RUST) += target.json
@@ -27,6 +29,7 @@ generate_rust_target-rust := y rustdoc_test_builder-rust := y rustdoc_test_gen-rust := y +HOSTCFLAGS_tracepoint-update.o = -I$(srctree)/tools/include HOSTCFLAGS_elf-parse.o = -I$(srctree)/tools/include HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include HOSTLDLIBS_sorttable = -lpthread
scripts/link-vmlinux.sh +4 -0
@@ -211,6 +211,10 @@ kallsymso= strip_debug= generate_map= +if is_enabled CONFIG_TRACEPOINT_WARN_ON_UNUSED; then + ${objtree}/scripts/tracepoint-update vmlinux.o +fi + if is_enabled CONFIG_KALLSYMS; then true > .tmp_vmlinux0.syms kallsyms .tmp_vmlinux0.syms .tmp_vmlinux0.kallsyms
scripts/tracepoint-update.c new file +232 -0
232 lines not on this page · raw message
Signature · 1 line
2.50.1
Re: [PATCH v6 2/3] tracing: Add a tracepoint verification check at build time
Quoted 5 lines · Steven Rostedt
+/**
+ *for_each_shdr_str- iterator that reads strings that are in an ELF section.
+ * @len: "int" to hold the length of the current string
+ * @ehdr: A pointer to the ehdr of the ELF file
+ * @sec: The section that has the strings to iterater on
iterate> + *
Quoted 4 lines
+ * This is a for loop that iterates over all the nul terminated strings
+ * that are in a given ELF section. The variable "str" will hold
+ * the current string for each iteration and the passed in @len will
+ * contain thehstrlen()of that string.
the
Quoted 1 line
+ */
Signature · 1 line
~Randy
Steven Rostedt
maintainerRe: [PATCH v6 2/3] tracing: Add a tracepoint verification check at build time
Quoted 8 lines · On Wed, 20 Aug 2025 13:12:22 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 5 lines · Steven Rostedt
+/**
+ *for_each_shdr_str- iterator that reads strings that are in an ELF section.
+ * @len: "int" to hold the length of the current string
+ * @ehdr: A pointer to the ehdr of the ELF file
+ * @sec: The section that has the strings to iterater oniterate> + *
Hmm, "to iterate on" sounds better to me. :-/
Quoted 6 lines
Quoted 4 lines
+ * This is a for loop that iterates over all the nul terminated strings
+ * that are in a given ELF section. The variable "str" will hold
+ * the current string for each iteration and the passed in @len will
+ * contain thehstrlen()of that string.the
Oops! Thanks.
-- Steve
Quoted 3 lines
Quoted 2 lines
+ */
Re: [PATCH v6 2/3] tracing: Add a tracepoint verification check at build time
Quoted 10 lines · Steven Rostedt
Quoted 7 lines · On Wed, 20 Aug 2025 13:12:22 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 5 lines · Steven Rostedt
+/**
+ *for_each_shdr_str- iterator that reads strings that are in an ELF section.
+ * @len: "int" to hold the length of the current string
+ * @ehdr: A pointer to the ehdr of the ELF file
+ * @sec: The section that has the strings to iterater on
Quoted 3 lines
Quoted 1 line
iterate> + *
Hmm, "to iterate on" sounds better to me. :-/
Sure, I just meant s/iterater/iterate/
Signature · 1 line
~Randy
kernel test robot
build botRe: [PATCH v6 2/3] tracing: Add a tracepoint verification check at build time
In reply to Steven Rostedtkernel test robot noticed the following build warnings:
Hi Steven,
kernel test robot noticed the following build warnings:
[auto build test WARNING on trace/for-next]
[also build test WARNING on akpm-mm/mm-everything linus/master v6.17-rc2 next-20250822] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Steven-Rostedt/sorttable-Move-ELF-parsing-into-scripts-elf-parse-ch/20250821-015048 base: https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next patch link: https://lore.kernel.org/r/20250820174828.080947631%40kernel.org patch subject: [PATCH v6 2/3] tracing: Add a tracepoint verification check at build time config: x86_64-randconfig-003-20250823 (https://download.01.org/0day-ci/archive/20250824/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250824/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
warning: tracepoint 'nfsd_cb_setup_err' is unused.
warning: tracepoint 'nfsd_cb_setup' is unused.
warning: tracepoint 'nfsd_cb_rpc_release' is unused.
warning: tracepoint 'nfsd_cb_rpc_done' is unused.
warning: tracepoint 'nfsd_cb_rpc_prepare' is unused.
warning: tracepoint 'nfsd_cb_shutdown' is unused.
warning: tracepoint 'nfsd_cb_lost' is unused.
warning: tracepoint 'nfsd_cb_probe' is unused.
warning: tracepoint 'nfsd_cb_new_state' is unused.
warning: tracepoint 'nfsd_cb_start' is unused.
warning: tracepoint 'nfsd_cb_nodelegs' is unused.
warning: tracepoint 'nfsd_cb_args' is unused.
warning: tracepoint 'nfsd_clid_confirmed_r' is unused.
warning: tracepoint 'nfsd_clid_fresh' is unused.
warning: tracepoint 'nfsd_clid_verf_mismatch' is unused.
warning: tracepoint 'nfsd_clid_cred_mismatch' is unused.
warning: tracepoint 'nfsd_grace_complete' is unused.
warning: tracepoint 'nfsd_grace_start' is unused.
warning: tracepoint 'nfsd_mark_client_expired' is unused.
warning: tracepoint 'nfsd_clid_stale' is unused.
warning: tracepoint 'nfsd_clid_renew' is unused.
warning: tracepoint 'nfsd_clid_purged' is unused.
warning: tracepoint 'nfsd_clid_replaced' is unused.
warning: tracepoint 'nfsd_clid_admin_expired' is unused.
warning: tracepoint 'nfsd_clid_destroyed' is unused.
warning: tracepoint 'nfsd_clid_confirmed' is unused.
warning: tracepoint 'nfsd_clid_reclaim_complete' is unused.
warning: tracepoint 'nfsd_clid_expire_unconf' is unused.
warning: tracepoint 'nfsd_slot_seqid_sequence' is unused.
warning: tracepoint 'nfsd_slot_seqid_unconf' is unused.
warning: tracepoint 'nfsd_slot_seqid_conf' is unused.
warning: tracepoint 'nfsd_seq4_status' is unused.
warning: tracepoint 'nfsd_stateowner_replay' is unused.
warning: tracepoint 'nfsd_stid_revoke' is unused.
warning: tracepoint 'nfsd_open_confirm' is unused.
warning: tracepoint 'nfsd_preprocess' is unused.
warning: tracepoint 'nfsd_deleg_return' is unused.
warning: tracepoint 'nfsd_deleg_write' is unused.
warning: tracepoint 'nfsd_deleg_read' is unused.
warning: tracepoint 'nfsd_open' is unused.
warning: tracepoint 'nfsd_layout_recall_release' is unused.
warning: tracepoint 'nfsd_layout_recall_fail' is unused.
warning: tracepoint 'nfsd_layout_recall_done' is unused.
warning: tracepoint 'nfsd_layout_recall' is unused.
warning: tracepoint 'nfsd_layout_return_lookup_fail' is unused.
warning: tracepoint 'nfsd_layout_commit_lookup_fail' is unused.
warning: tracepoint 'nfsd_layout_get_lookup_fail' is unused.
warning: tracepoint 'nfsd_layoutstate_free' is unused.
warning: tracepoint 'nfsd_layoutstate_unhash' is unused.
warning: tracepoint 'nfsd_layoutstate_alloc' is unused.
warning: tracepoint 'nfsd_delegret_wakeup' is unused.
warning: tracepoint 'nfsd_clone_file_range_err' is unused.
warning: tracepoint 'nfsd_compound_encode_err' is unused.
warning: tracepoint 'nfsd_compound_op_err' is unused.
warning: tracepoint 'nfsd_compound_decode_err' is unused.
warning: tracepoint 'nfsd_compound_status' is unused.
warning: tracepoint 'nfsd_compound' is unused.
warning: tracepoint 'xfs_metadir_link' is unused.
warning: tracepoint 'xfs_metadir_start_link' is unused.
warning: tracepoint 'xfs_file_dax_write' is unused.
warning: tracepoint 'xfs_file_dax_read' is unused.
warning: tracepoint 'xrep_done' is unused.
warning: tracepoint 'xrep_attempt' is unused.
warning: tracepoint 'cachefiles_ondemand_fd_release' is unused.
warning: tracepoint 'cachefiles_ondemand_fd_write' is unused.
warning: tracepoint 'cachefiles_ondemand_cread' is unused.
warning: tracepoint 'cachefiles_ondemand_read' is unused.
warning: tracepoint 'cachefiles_ondemand_close' is unused.
warning: tracepoint 'cachefiles_ondemand_copen' is unused.
warning: tracepoint 'cachefiles_ondemand_open' is unused.
warning: tracepoint 'ocfs2_encode_fh_begin' is unused.
warning: tracepoint 'ocfs2_duplicate_clusters_by_jbd' is unused.
warning: tracepoint 'zonefs_file_dio_append' is unused.
warning: tracepoint 'edma_readb' is unused.
warning: tracepoint 'edma_readw' is unused.
warning: tracepoint 'xe_exec_queue_supress_resume' is unused.
warning: tracepoint 'xe_vm_restart' is unused.
warning: tracepoint 'xe_vma_userptr_rebind_exec' is unused.
warning: tracepoint 'xe_vma_userptr_rebind_worker' is unused.
warning: tracepoint 'xe_vma_flush' is unused.
warning: tracepoint 'dma_fence_emit' is unused.
warning: tracepoint 'scsi_zone_wp_update' is unused.
warning: tracepoint 'scsi_prepare_zone_append' is unused.
warning: tracepoint 'ata_sff_flush_pio_task' is unused.
warning: tracepoint 'atapi_send_cdb' is unused.
warning: tracepoint 'atapi_pio_transfer_data' is unused.
warning: tracepoint 'ata_sff_pio_transfer_data' is unused.
warning: tracepoint 'ata_sff_port_intr' is unused.
warning: tracepoint 'ata_sff_hsm_command_complete' is unused.
warning: tracepoint 'ata_sff_hsm_state' is unused.
warning: tracepoint 'ata_bmdma_status' is unused.
warning: tracepoint 'ata_bmdma_stop' is unused.
warning: tracepoint 'ata_bmdma_start' is unused.
warning: tracepoint 'ata_bmdma_setup' is unused.
warning: tracepoint 'ata_exec_command' is unused.
warning: tracepoint 'ata_tf_load' is unused.
warning: tracepoint 'ice_tx_tstamp_complete' is unused.
warning: tracepoint 'ice_tx_tstamp_fw_done' is unused.
warning: tracepoint 'ice_tx_tstamp_fw_req' is unused.
warning: tracepoint 'ice_tx_tstamp_request' is unused.
>> warning: tracepoint 'mlx5e_rep_neigh_update' is unused. warning: tracepoint 'xhci_dbc_giveback_request' is unused. warning: tracepoint 'xhci_dbc_queue_request' is unused. warning: tracepoint 'xhci_dbc_free_request' is unused. warning: tracepoint 'xhci_dbc_alloc_request' is unused. warning: tracepoint 'xhci_dbc_gadget_ep_queue' is unused. warning: tracepoint 'xhci_dbc_handle_transfer' is unused. warning: tracepoint 'xhci_dbc_handle_event' is unused. warning: tracepoint 'musb_req_deq' is unused. warning: tracepoint 'musb_req_enq' is unused. warning: tracepoint 'musb_req_start' is unused. warning: tracepoint 'musb_req_free' is unused. warning: tracepoint 'musb_req_alloc' is unused. warning: tracepoint 'musb_req_rx' is unused. warning: tracepoint 'musb_req_tx' is unused. warning: tracepoint 'musb_req_gb' is unused. warning: tracepoint 'ufshcd_wl_resume' is unused. warning: tracepoint 'ufshcd_wl_suspend' is unused. warning: tracepoint 'ufshcd_system_resume' is unused. warning: tracepoint 'ufshcd_system_suspend' is unused. warning: tracepoint 'br_mdb_full' is unused. warning: tracepoint 'tcp_hash_md5_mismatch' is unused. warning: tracepoint 'tcp_hash_md5_unexpected' is unused. warning: tracepoint 'devlink_hwerr' is unused. warning: tracepoint 'rpc_socket_reset_connection' is unused. warning: tracepoint 'rxrpc_rxgk_rekey' is unused. warning: tracepoint 'rxrpc_drop_ack' is unused. warning: tracepoint 'rxrpc_rx_response' is unused. warning: tracepoint 'rxrpc_rx_challenge' is unused. warning: tracepoint 'rxrpc_tx_challenge' is unused. warning: tracepoint 'cfg80211_return_u32' is unused. warning: tracepoint 'cfg80211_return_uint' is unused. warning: tracepoint 'cfg80211_chandef_dfs_required' is unused. warning: tracepoint 'cfg80211_send_rx_auth' is unused. warning: tracepoint 'rdev_return_void_tx_rx' is unused. warning: tracepoint 'rdev_resume' is unused. warning: tracepoint 'rdev_suspend' is unused. warning: tracepoint 'tipc_node_dump' is unused. warning: tracepoint '802154_rdev_resume' is unused. warning: tracepoint '802154_rdev_suspend' is unused. warning: tracepoint '802154_new_scan_event' is unused. warning: tracepoint '802154_drv_set_pan_coord' is unused. >> warning: tracepoint 'batadv_dbg' is unused.
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH v6 3/3 tracepoint: Do not warn for unused event that is exported
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
There are a few generic events that may only be used by modules. They are defined and then set with EXPORT_TRACEPOINT*(). Mark events that are exported as being used, even though they still waste memory in the kernel proper.
--- include/linux/tracepoint.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
include/linux/tracepoint.h +4 -2
@@ -223,8 +223,8 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)#ifdef CONFIG_TRACEPOINT_WARN_ON_UNUSED # define TRACEPOINT_CHECK (name) \ - static const char __used __section("__tracepoint_check") __trace_check[] = \ - #name; + static const char __used __section("__tracepoint_check") \ + __trace_check_##name[] = #name;#else # define TRACEPOINT_CHECK (tname)#endif
@@ -381,10 +381,12 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)__DEFINE_TRACE_EXT (_name,NULL ,PARAMS (_proto),PARAMS (_args));#define EXPORT_TRACEPOINT_SYMBOL_GPL (name) \ + TRACEPOINT_CHECK(name) \ EXPORT_SYMBOL_GPL(__tracepoint_##name); \ EXPORT_SYMBOL_GPL(__traceiter_##name); \ EXPORT_STATIC_CALL_GPL(tp_func_##name)#define EXPORT_TRACEPOINT_SYMBOL (name) \ + TRACEPOINT_CHECK(name) \ EXPORT_SYMBOL(__tracepoint_##name); \ EXPORT_SYMBOL(__traceiter_##name); \ EXPORT_STATIC_CALL(tp_func_##name)
Signature · 1 line
2.50.1