Files
Linus Torvalds 3f942403bb Merge tag 'probes-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull probes updates from Masami Hiramatsu:
 "Asynchronous optprobe optimizer and cleanups:

   - Make optprobe optimizer multi-generational and asynchronous

     Rework the optimizer as a state machine to avoid calling
     time-consuming synchronize_rcu_tasks() while holding kprobe_mutex,
     text_mutex, and cpus_read_lock(). Uses call_rcu_tasks() and a fixed
     ring of generation slots instead, so locks are only held during the
     brief instruction- patching window

   - Use DEFINE_DEBUGFS_ATTRIBUTE for the kprobes enabled knob

     Replace a hand-rolled debugfs read/write pair (dating from 2007)
     with the proper DEFINE_DEBUGFS_ATTRIBUTE macro, removing dead code
     and the stale XXX comment

  Code quality and documentation cleanups:

   - Add const qualifier to new_argv allocation type in trace_probe.c,
     preparing for the type-aware kmalloc_obj allocator conversion

   - Clarify btf_find_struct_member() container parameter

     Rename the misleading @member_type parameter to @container_type and
     add proper kernel-doc documentation for all parameters and return
     values

  Boot tracing test framework and testcases:

   - Add a generic boot tracing test framework under
     tools/testing/selftests/ftrace/boottime/

     The test runner builds a minimal initramfs with busybox, boots
     QEMU, and runs tracefs checker scripts, supporting bootconfig,
     kernel command-line options, and multi-boot crash/reboot scenarios

   - Add boot-time tracing testcases

     Verify dynamic kprobe, synthetic events, eprobe, fprobe, tprobe,
     and trace instance creation via bootconfig

   - Add kernel cmdline tracing testcases

     Verify ftrace, trace_event, trace_buf_size, trace_options,
     trace_clock, and trace_instance kernel parameters

   - Add persistent ring buffer testcases:

     Verify memory reservation via reserve_mem= and trace data retention
     across guest crash/reboot, as well as backup instance creation and
     boot log preservation

   - Change non-unique test symbol from name_show to init_once in
     kprobe_non_uniq_symbol.tc for more reliable cross-architecture
     testing"

* tag 'probes-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  ftrace/selftests: Change non-unique test symbol to init_once
  tracing/probes: Clarify btf_find_struct_member() container parameter and add kernel-doc
  kprobes: Make optprobe optimizer multi-generational and asynchronous
  tracing/probes: Add const to new_argv allocation type
  kprobes: use DEFINE_DEBUGFS_ATTRIBUTE for the enabled knob
  selftests/ftrace: Add persistent ring buffer testcases
  selftests/ftrace: Add kernel cmdline tracing testcases
  selftests/ftrace: Add boot-time tracing testcases
  selftests/ftrace: Add generic boot tracing test framework
2026-10-23 12:12:26 -10:00

32 lines
922 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/btf.h>
enum {
RETVAL_FMT_HEX = BIT(0),
RETVAL_FMT_DEC = BIT(1),
RETVAL_FMT_BOOL = BIT(2),
RETVAL_FMT_TRUNC = BIT(3),
RETVAL_FMT_BTF = BIT(4),
RETVAL_FMT_UNSIGNED = BIT(5),
};
const struct btf_type *btf_find_func_proto(const char *func_name,
struct btf **btf_p);
const struct btf_param *btf_get_func_param(const struct btf_type *func_proto,
s32 *nr);
const struct btf_member *btf_find_struct_member(struct btf *btf,
const struct btf_type *type,
const char *member_name,
u32 *anon_offset,
const struct btf_type **container_type);
#ifdef CONFIG_DEBUG_INFO_BTF
void btf_trim_retval(unsigned long func, unsigned long *retval, bool *print_retval,
int *fmt, bool hex);
#else
static inline void btf_trim_retval(unsigned long func, unsigned long *retval,
bool *print_retval, int *fmt, bool hex)
{
}
#endif