ID Workflow Result Correct Bug Created Started Finished Revision
b81a3c49 patching ❓ WARNING in blk_register_tracepoints 2026/08/31 20:45 2026/08/31 20:45 2026/08/31 22:10 2f52988a
Agent: prod-syz-agent-0
External Bug ID: ---

Inputs:
BaseBranch master
BaseCommit RC
BaseRepository git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BugTitle WARNING in blk_register_tracepoints
CrashLogID 5621649715494912
CrashReportID 5940482082865152
KernelCommit 18f7fcd5e69a04df57b563360b88be72471d6b62
KernelConfig
Show (279076 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 syzkaller Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 14.2.0-19) 14.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24400
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=24400
CONFIG_LLD_VERSION=0
CONFIG_RUSTC_VERSION=109101
CONFIG_RUST_IS_AVAILABLE=y
CONFIG_RUSTC_LLVM_VERSION=210102
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_ASSUME=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y
CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED=y
CONFIG_RUSTC_HAS_COERCE_POINTEE=y
CONFIG_RUSTC_HAS_SPAN_FILE=y
CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
CONFIG_RUSTC_HAS_FILE_WITH_NUL=y
CONFIG_RUSTC_HAS_FILE_AS_C_STR=y
CONFIG_PAHOLE_VERSION=130
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_HAVE_KERNEL_ZSTD=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y
CONFIG_GENERIC_IRQ_RESERVATION_MODE=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_INIT=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_CONTEXT_TRACKING_IDLE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_CONTEXT_TRACKING_USER=y
# CONFIG_CONTEXT_TRACKING_USER_FORCE is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=125
CONFIG_POSIX_AUX_CLOCKS=y
# end of Timers subsystem

CONFIG_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y

#
# BPF subsystem
#
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_BPF_JIT_ALWAYS_ON=y
CONFIG_BPF_JIT_DEFAULT_ON=y
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
CONFIG_BPF_PRELOAD=y
CONFIG_BPF_PRELOAD_UMD=y
CONFIG_BPF_LSM=y
# end of BPF subsystem

CONFIG_PREEMPT_BUILD=y
CONFIG_ARCH_HAS_PREEMPT_LAZY=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
# CONFIG_PREEMPT_LAZY is not set
# CONFIG_PREEMPT_RT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_DYNAMIC=y
CONFIG_SCHED_CORE=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_SCHED_AVG_IRQ=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

CONFIG_CPU_ISOLATION=y

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
CONFIG_PREEMPT_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_NEED_TASKS_RCU=y
CONFIG_TASKS_RCU=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
# CONFIG_PRINTK_INDEX is not set
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y

#
# Scheduler features
#
# CONFIG_UCLAMP_TASK is not set
# CONFIG_SCHED_PROXY_EXEC is not set
# end of Scheduler features

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
CONFIG_CC_HAS_INT128=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_GCC_NO_STRINGOP_OVERFLOW=y
CONFIG_CC_NO_STRINGOP_OVERFLOW=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_NUMA_BALANCING=y
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_SLAB_OBJ_EXT=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
# CONFIG_CGROUP_FAVOR_DYNMODS is not set
CONFIG_MEMCG=y
CONFIG_MEMCG_V1=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_GROUP_SCHED_WEIGHT=y
CONFIG_GROUP_SCHED_BANDWIDTH=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_SCHED_MM_CID=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
# CONFIG_CGROUP_DMEM is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
# CONFIG_CPUSETS_V1 is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
# CONFIG_CGROUP_BPF is not set
CONFIG_CGROUP_MISC=y
CONFIG_CGROUP_DEBUG=y
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_TIME_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
CONFIG_CMDLINE_LOG_WRAP_IDEAL_LEN=1021
CONFIG_INITRAMFS_PRESERVE_MTIME=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_LD_ORPHAN_WARN_LEVEL="warn"
CONFIG_SYSCTL=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
# CONFIG_BASE_SMALL is not set
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_FUTEX_PRIVATE_HASH=y
CONFIG_FUTEX_MPOL=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_IO_URING_MOCK_FILE=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KCMP=y
CONFIG_RSEQ=y
# CONFIG_RSEQ_STATS is not set
# CONFIG_RSEQ_DEBUG_DEFAULT_ENABLE is not set
CONFIG_CACHESTAT_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
CONFIG_KALLSYMS_ALL=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_GUEST_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
# end of Kernel Performance Events And Counters

CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_PROFILING=y
# CONFIG_RUST is not set
CONFIG_TRACEPOINTS=y

#
# Kexec and crash features
#
CONFIG_CRASH_RESERVE=y
CONFIG_VMCORE_INFO=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
# CONFIG_KEXEC_FILE is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192
# end of Kexec and crash features

#
# Live Update and Kexec HandOver
#
# CONFIG_KEXEC_HANDOVER is not set
# end of Live Update and Kexec HandOver
# end of General setup

CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_AUDIT_ARCH=y
CONFIG_KASAN_SHADOW_OFFSET=0xdffffc0000000000
CONFIG_HAVE_INTEL_TXT=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=5

#
# Processor type and features
#
CONFIG_SMP=y
CONFIG_X86_X2APIC=y
# CONFIG_X86_POSTED_MSI is not set
CONFIG_X86_MPPARSE=y
# CONFIG_X86_CPU_RESCTRL is not set
CONFIG_X86_FRED=y
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_NUMACHIP is not set
# CONFIG_X86_VSMP is not set
# CONFIG_X86_INTEL_MID is not set
# CONFIG_X86_GOLDFISH is not set
# CONFIG_X86_INTEL_LPSS is not set
# CONFIG_X86_AMD_PLATFORM_DEVICE is not set
CONFIG_IOSF_MBI=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_X86_HV_CALLBACK_VECTOR=y
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
CONFIG_ARCH_CPUIDLE_HALTPOLL=y
CONFIG_PVH=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_JAILHOUSE_GUEST is not set
# CONFIG_ACRN_GUEST is not set
# CONFIG_BHYVE_GUEST is not set
CONFIG_CC_HAS_MARCH_NATIVE=y
# CONFIG_X86_NATIVE_CPU is not set
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_HAVE_PAE=y
CONFIG_X86_CX8=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_IA32_FEAT_CTL=y
CONFIG_X86_VMX_FEATURE_NAMES=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_BROADCAST_TLB_FLUSH=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
# CONFIG_CPU_SUP_HYGON is not set
# CONFIG_CPU_SUP_CENTAUR is not set
# CONFIG_CPU_SUP_ZHAOXIN is not set
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
# CONFIG_GART_IOMMU is not set
CONFIG_BOOT_VESA_SUPPORT=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS_RANGE_BEGIN=2
CONFIG_NR_CPUS_RANGE_END=512
CONFIG_NR_CPUS_DEFAULT=64
CONFIG_NR_CPUS=8
CONFIG_SCHED_MC_PRIO=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_ACPI_MADT_WAKEUP=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCELOG_LEGACY is not set
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set

#
# Performance monitoring
#
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_PERF_EVENTS_INTEL_RAPL=y
CONFIG_PERF_EVENTS_INTEL_CSTATE=y
# CONFIG_PERF_EVENTS_AMD_POWER is not set
CONFIG_PERF_EVENTS_AMD_UNCORE=y
# CONFIG_PERF_EVENTS_AMD_BRS is not set
# end of Performance monitoring

CONFIG_X86_16BIT=y
CONFIG_X86_ESPFIX64=y
CONFIG_X86_VSYSCALL_EMULATION=y
CONFIG_X86_IOPL_IOPERM=y
CONFIG_MICROCODE=y
# CONFIG_MICROCODE_LATE_LOADING is not set
# CONFIG_MICROCODE_DBG is not set
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
CONFIG_X86_DIRECT_GBPAGES=y
# CONFIG_X86_CPA_STATISTICS is not set
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
# CONFIG_ARCH_MEMORY_PROBE is not set
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
# CONFIG_X86_PMEM_LEGACY is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_MTRR=y
# CONFIG_MTRR_SANITIZER is not set
CONFIG_X86_PAT=y
CONFIG_X86_UMIP=y
CONFIG_CC_HAS_IBT=y
CONFIG_X86_CET=y
CONFIG_X86_KERNEL_IBT=y
CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y
CONFIG_ARCH_PKEY_BITS=4
# CONFIG_X86_INTEL_TSX_MODE_OFF is not set
CONFIG_X86_INTEL_TSX_MODE_ON=y
# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
CONFIG_X86_SGX=y
CONFIG_X86_USER_SHADOW_STACK=y
# CONFIG_INTEL_TDX_HOST is not set
# CONFIG_EFI is not set
CONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_SCHED_HRTICK=y
CONFIG_ARCH_SUPPORTS_KEXEC=y
CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y
CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG_FORCE=y
CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_JUMP=y
CONFIG_ARCH_SUPPORTS_KEXEC_HANDOVER=y
CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y
CONFIG_ARCH_DEFAULT_CRASH_DUMP=y
CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y
CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x200000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
CONFIG_LEGACY_VSYSCALL_XONLY=y
# CONFIG_LEGACY_VSYSCALL_NONE is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlyprintk=serial net.ifnames=0 sysctl.kernel.hung_task_all_cpu_backtrace=1 ima_policy=tcb nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 nf-conntrack-sane.ports=20000 binder.debug_mask=0 rcupdate.rcu_expedited=1 rcupdate.rcu_cpu_stall_cputime=1 no_hash_pointers page_owner=on sysctl.vm.nr_hugepages=4 sysctl.vm.nr_overcommit_hugepages=4 secretmem.enable=1 sysctl.max_rcu_stall_to_panic=1 msr.allow_writes=off coredump_filter=0xffff root=/dev/sda console=ttyS0 vsyscall=native numa=fake=2 kvm-intel.nested=1 spec_store_bypass_disable=prctl nopcid vivid.n_devs=64 vivid.multiplanar=1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 netrom.nr_ndevs=32 rose.rose_ndevs=32 smp.csd_lock_timeout=100000 watchdog_thresh=55 workqueue.watchdog_thresh=140 sysctl.net.core.netdev_unregister_timeout_secs=140 dummy_hcd.num=32 max_loop=32 nbds_max=32 comedi.comedi_num_legacy_minors=4 panic_on_warn=1"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_MODIFY_LDT_SYSCALL=y
# CONFIG_STRICT_SIGALTSTACK_SIZE is not set
CONFIG_HAVE_LIVEPATCH=y
CONFIG_HAVE_KLP_BUILD=y
CONFIG_X86_BUS_LOCK_DETECT=y
# end of Processor type and features

CONFIG_CC_HAS_NAMED_AS=y
CONFIG_CC_HAS_NAMED_AS_FIXED_SANITIZERS=y
CONFIG_USE_X86_SEG_SUPPORT=y
CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_CC_HAS_ENTRY_PADDING=y
CONFIG_FUNCTION_PADDING_CFI=11
CONFIG_FUNCTION_PADDING_BYTES=16
CONFIG_CALL_PADDING=y
CONFIG_HAVE_CALL_THUNKS=y
CONFIG_CALL_THUNKS=y
CONFIG_PREFIX_SYMBOLS=y
CONFIG_CPU_MITIGATIONS=y
CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y
CONFIG_MITIGATION_RETPOLINE=y
CONFIG_MITIGATION_RETHUNK=y
CONFIG_MITIGATION_UNRET_ENTRY=y
CONFIG_MITIGATION_CALL_DEPTH_TRACKING=y
# CONFIG_CALL_THUNKS_DEBUG is not set
CONFIG_MITIGATION_IBPB_ENTRY=y
CONFIG_MITIGATION_IBRS_ENTRY=y
CONFIG_MITIGATION_SRSO=y
# CONFIG_MITIGATION_SLS is not set
CONFIG_MITIGATION_GDS=y
CONFIG_MITIGATION_RFDS=y
CONFIG_MITIGATION_SPECTRE_BHI=y
CONFIG_MITIGATION_MDS=y
CONFIG_MITIGATION_TAA=y
CONFIG_MITIGATION_MMIO_STALE_DATA=y
CONFIG_MITIGATION_L1TF=y
CONFIG_MITIGATION_RETBLEED=y
CONFIG_MITIGATION_SPECTRE_V1=y
CONFIG_MITIGATION_SPECTRE_V2=y
CONFIG_MITIGATION_SRBDS=y
CONFIG_MITIGATION_SSB=y
CONFIG_MITIGATION_ITS=y
CONFIG_MITIGATION_TSA=y
# CONFIG_MITIGATION_VMSCAPE is not set
CONFIG_ARCH_HAS_ADD_PAGES=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_HIBERNATION_COMP_LZO=y
# CONFIG_HIBERNATION_COMP_LZ4 is not set
CONFIG_HIBERNATION_DEF_COMP="lzo"
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_USERSPACE_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
# CONFIG_PM_QOS_CPU_SYSTEM_WAKEUP is not set
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
# CONFIG_DPM_WATCHDOG is not set
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_CLK=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
# CONFIG_ENERGY_MODEL is not set
CONFIG_ARCH_SUPPORTS_ACPI=y
CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
CONFIG_ACPI_THERMAL_LIB=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SPCR_TABLE=y
# CONFIG_ACPI_FPDT is not set
CONFIG_ACPI_LPIT=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
CONFIG_ACPI_EC=y
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_TAD is not set
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_ACPI_PROCESSOR_CSTATE=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_PLATFORM_PROFILE=y
CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_DEBUG=y
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
CONFIG_ACPI_NHLT=y
CONFIG_ACPI_NFIT=y
# CONFIG_NFIT_SECURITY_DEBUG is not set
CONFIG_ACPI_NUMA=y
# CONFIG_ACPI_HMAT is not set
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
# CONFIG_ACPI_APEI is not set
# CONFIG_ACPI_DPTF is not set
# CONFIG_ACPI_EXTLOG is not set
# CONFIG_ACPI_CONFIGFS is not set
# CONFIG_ACPI_PFRUT is not set
CONFIG_ACPI_PCC=y
# CONFIG_ACPI_FFH is not set
CONFIG_ACPI_MRRM=y
CONFIG_PMIC_OPREGION=y
CONFIG_BXT_WC_PMIC_OPREGION=y
# CONFIG_CHT_WC_PMIC_OPREGION is not set
CONFIG_X86_PM_TIMER=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
# CONFIG_CPUFREQ_DT is not set
# CONFIG_CPUFREQ_DT_PLATDEV is not set
CONFIG_X86_INTEL_PSTATE=y
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_AMD_PSTATE=y
CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3
# CONFIG_X86_AMD_PSTATE_UT is not set
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
CONFIG_CPUFREQ_ARCH_CUR_FREQ=y
# end of CPU Frequency scaling

#
# CPU Idle
#
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_CPU_IDLE_GOV_TEO is not set
CONFIG_CPU_IDLE_GOV_HALTPOLL=y
CONFIG_HALTPOLL_CPUIDLE=y
# end of CPU Idle

CONFIG_INTEL_IDLE=y
# end of Power management and ACPI options

#
# Bus options (PCI etc.)
#
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_MMCONF_FAM10H=y
CONFIG_ISA_BUS=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_AMD_NODE=y
# end of Bus options (PCI etc.)

#
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_EMULATION_DEFAULT_DISABLED is not set
# CONFIG_X86_X32_ABI is not set
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
# end of Binary Emulations

CONFIG_KVM_COMMON=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_READONLY_MEM=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_VIRT_XFER_TO_GUEST_WORK=y
CONFIG_HAVE_KVM_PM_NOTIFIER=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GENERIC_MMU_NOTIFIER=y
CONFIG_KVM_ELIDE_TLB_FLUSH_IF_YOUNG=y
CONFIG_KVM_MMU_LOCKLESS_AGING=y
CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES=y
CONFIG_KVM_GUEST_MEMFD=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM_X86=y
CONFIG_KVM=y
CONFIG_KVM_SW_PROTECTED_VM=y
CONFIG_KVM_INTEL=y
# CONFIG_KVM_INTEL_PROVE_VE is not set
CONFIG_X86_SGX_KVM=y
CONFIG_KVM_AMD=y
CONFIG_KVM_IOAPIC=y
# CONFIG_KVM_SMM is not set
CONFIG_KVM_HYPERV=y
CONFIG_KVM_XEN=y
CONFIG_KVM_PROVE_MMU=y
CONFIG_KVM_MAX_NR_VCPUS=1024
CONFIG_X86_REQUIRED_FEATURE_ALWAYS=y
CONFIG_X86_REQUIRED_FEATURE_NOPL=y
CONFIG_X86_REQUIRED_FEATURE_CX8=y
CONFIG_X86_REQUIRED_FEATURE_CMOV=y
CONFIG_X86_REQUIRED_FEATURE_CPUID=y
CONFIG_X86_REQUIRED_FEATURE_FPU=y
CONFIG_X86_REQUIRED_FEATURE_PAE=y
CONFIG_X86_REQUIRED_FEATURE_PSE=y
CONFIG_X86_REQUIRED_FEATURE_PGE=y
CONFIG_X86_REQUIRED_FEATURE_MSR=y
CONFIG_X86_REQUIRED_FEATURE_FXSR=y
CONFIG_X86_REQUIRED_FEATURE_XMM=y
CONFIG_X86_REQUIRED_FEATURE_XMM2=y
CONFIG_X86_REQUIRED_FEATURE_LM=y
CONFIG_X86_DISABLED_FEATURE_VME=y
CONFIG_X86_DISABLED_FEATURE_K6_MTRR=y
CONFIG_X86_DISABLED_FEATURE_CYRIX_ARR=y
CONFIG_X86_DISABLED_FEATURE_CENTAUR_MCR=y
CONFIG_X86_DISABLED_FEATURE_LAM=y
CONFIG_X86_DISABLED_FEATURE_XENPV=y
CONFIG_X86_DISABLED_FEATURE_TDX_GUEST=y
CONFIG_X86_DISABLED_FEATURE_SEV_SNP=y
CONFIG_AS_WRUSS=y
CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_HOTPLUG_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_CLUSTER=y
CONFIG_ARCH_SUPPORTS_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_CLUSTER=y
CONFIG_SCHED_MC=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CORE_SYNC_FULL=y
CONFIG_HOTPLUG_SPLIT_STARTUP=y
CONFIG_HOTPLUG_PARALLEL=y
CONFIG_GENERIC_IRQ_ENTRY=y
CONFIG_GENERIC_SYSCALL=y
CONFIG_GENERIC_ENTRY=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
# CONFIG_STATIC_CALL_SELFTEST is not set
CONFIG_UPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y
CONFIG_HAVE_NMI=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
CONFIG_ARCH_HAS_SET_MEMORY=y
CONFIG_ARCH_HAS_SET_DIRECT_MAP=y
CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y
CONFIG_ARCH_HAS_CPU_PASID=y
CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
CONFIG_ARCH_WANTS_NO_INSTR=y
CONFIG_HAVE_ASM_MODVERSIONS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_RSEQ=y
CONFIG_HAVE_RUST=y
CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y
CONFIG_UNWIND_USER=y
CONFIG_HAVE_UNWIND_USER_FP=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y
CONFIG_MMU_GATHER_TABLE_FREE=y
CONFIG_MMU_GATHER_RCU_TABLE_FREE=y
CONFIG_MMU_GATHER_MERGE_VMAS=y
CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y
CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP=y
CONFIG_SECCOMP_FILTER=y
# CONFIG_SECCOMP_CACHE_DEBUG is not set
CONFIG_HAVE_ARCH_KSTACK_ERASE=y
CONFIG_HAVE_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR_STRONG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y
CONFIG_LTO_NONE=y
CONFIG_ARCH_SUPPORTS_AUTOFDO_CLANG=y
CONFIG_ARCH_SUPPORTS_PROPELLER_CLANG=y
CONFIG_ARCH_SUPPORTS_CFI=y
CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y
CONFIG_HAVE_CONTEXT_TRACKING_USER=y
CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_MOVE_PUD=y
CONFIG_HAVE_MOVE_PMD=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_PMD_MKWRITE=y
CONFIG_HAVE_ARCH_SOFT_DIRTY=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_EXECMEM_ROX=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_HAVE_EXIT_THREAD=y
CONFIG_ARCH_MMAP_RND_BITS=28
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y
CONFIG_HAVE_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SHIFT=12
CONFIG_HAVE_OBJTOOL=y
CONFIG_HAVE_JUMP_LABEL_HACK=y
CONFIG_HAVE_NOINSTR_HACK=y
CONFIG_HAVE_NOINSTR_VALIDATION=y
CONFIG_HAVE_UACCESS_VALIDATION=y
CONFIG_HAVE_STACK_VALIDATION=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_ARCH_SUPPORTS_RT=y
CONFIG_HAVE_ARCH_VMAP_STACK=y
CONFIG_VMAP_STACK=y
CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y
CONFIG_RANDOMIZE_KSTACK_OFFSET=y
# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set
CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
CONFIG_STRICT_KERNEL_RWX=y
CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
CONFIG_STRICT_MODULE_RWX=y
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
# CONFIG_LOCK_EVENT_COUNTS is not set
CONFIG_ARCH_HAS_MEM_ENCRYPT=y
CONFIG_HAVE_STATIC_CALL=y
CONFIG_HAVE_STATIC_CALL_INLINE=y
CONFIG_HAVE_PREEMPT_DYNAMIC=y
CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y
CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y
CONFIG_ARCH_HAS_ELFCORE_COMPAT=y
CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y
CONFIG_DYNAMIC_SIGFRAME=y
CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y
CONFIG_ARCH_HAS_HW_PTE_YOUNG=y
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y
CONFIG_HAVE_GENERIC_TIF_BITS=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
# end of GCOV-based kernel profiling

CONFIG_HAVE_GCC_PLUGINS=y
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FUNCTION_ALIGNMENT_16B=y
CONFIG_FUNCTION_ALIGNMENT=16
CONFIG_CC_HAS_MIN_FUNCTION_ALIGNMENT=y
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
CONFIG_ARCH_HAS_CPU_ATTACK_VECTORS=y
# end of General architecture-dependent options

CONFIG_RT_MUTEXES=y
CONFIG_MODULE_SIG_FORMAT=y
CONFIG_MODULES=y
# CONFIG_MODULE_DEBUG is not set
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set
CONFIG_MODVERSIONS=y
# CONFIG_GENKSYMS is not set
CONFIG_GENDWARFKSYMS=y
CONFIG_ASM_MODVERSIONS=y
# CONFIG_EXTENDED_MODVERSIONS is not set
# CONFIG_BASIC_MODVERSIONS is not set
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_ALL is not set
# CONFIG_MODULE_SIG_SHA1 is not set
CONFIG_MODULE_SIG_SHA256=y
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
# CONFIG_MODULE_SIG_SHA3_256 is not set
# CONFIG_MODULE_SIG_SHA3_384 is not set
# CONFIG_MODULE_SIG_SHA3_512 is not set
CONFIG_MODULE_SIG_HASH="sha256"
# CONFIG_MODULE_COMPRESS is not set
# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set
CONFIG_MODPROBE_PATH="/sbin/modprobe"
# CONFIG_TRIM_UNUSED_KSYMS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_DEV_WRITE_MOUNTED is not set
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
CONFIG_BLK_CGROUP_IOLATENCY=y
# CONFIG_BLK_CGROUP_FC_APPID is not set
CONFIG_BLK_CGROUP_IOCOST=y
CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BLK_DEBUG_FS=y
# CONFIG_BLK_SED_OPAL is not set
CONFIG_BLK_INLINE_ENCRYPTION=y
CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
CONFIG_ACORN_PARTITION_CUMANA=y
CONFIG_ACORN_PARTITION_EESOX=y
CONFIG_ACORN_PARTITION_ICS=y
CONFIG_ACORN_PARTITION_ADFS=y
CONFIG_ACORN_PARTITION_POWERTEC=y
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_AIX_PARTITION=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_CMDLINE_PARTITION=y
# CONFIG_OF_PARTITION is not set
# end of Partition Types

CONFIG_BLK_PM=y
CONFIG_BLOCK_HOLDER_DEPRECATED=y
CONFIG_BLK_MQ_STACKING=y

#
# IO Schedulers
#
CONFIG_MQ_IOSCHED_DEADLINE=y
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y
CONFIG_BFQ_CGROUP_DEBUG=y
# end of IO Schedulers

CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PADATA=y
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_FREEZER=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ELFCORE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
# end of Executable file formats

#
# Memory Management options
#
CONFIG_SWAP=y
CONFIG_ZSWAP=y
CONFIG_ZSWAP_DEFAULT_ON=y
CONFIG_ZSWAP_SHRINKER_DEFAULT_ON=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT="842"
CONFIG_ZSMALLOC=y

#
# Zsmalloc allocator options
#

#
# Zsmalloc is a common backend allocator for zswap & zram
#
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_ZSMALLOC_CHAIN_SIZE=8
# end of Zsmalloc allocator options

#
# Slab allocator options
#
CONFIG_SLUB=y
CONFIG_KVFREE_RCU_BATCHED=y
# CONFIG_SLUB_TINY is not set
CONFIG_SLAB_MERGE_DEFAULT=y
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SLAB_BUCKETS is not set
# CONFIG_SLUB_STATS is not set
CONFIG_SLUB_CPU_PARTIAL=y
# CONFIG_RANDOM_KMALLOC_CACHES is not set
# end of Slab allocator options

# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_SPARSEMEM_VMEMMAP_PREINIT=y
CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=y
CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP=y
CONFIG_ARCH_WANT_HUGETLB_VMEMMAP_PREINIT=y
CONFIG_HAVE_GUP_FAST=y
CONFIG_NUMA_KEEP_MEMINFO=y
CONFIG_MEMORY_ISOLATION=y
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_HAVE_BOOTMEM_INFO_NODE=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_MEMORY_HOTPLUG=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set
CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_MHP_MEMMAP_ON_MEMORY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
CONFIG_SPLIT_PTE_PTLOCKS=y
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
CONFIG_SPLIT_PMD_PTLOCKS=y
CONFIG_MEMORY_BALLOON=y
# CONFIG_BALLOON_COMPACTION is not set
CONFIG_COMPACTION=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_PAGE_REPORTING=y
CONFIG_MIGRATION=y
CONFIG_DEVICE_MIGRATION=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_ARCH_ENABLE_THP_MIGRATION=y
CONFIG_CONTIG_ALLOC=y
CONFIG_PCP_BATCH_SCALE_MAX=5
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANTS_THP_SWAP=y
# CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is not set
CONFIG_MM_ID=y
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE=y
CONFIG_THP_SWAP=y
CONFIG_READ_ONLY_THP_FOR_FS=y
# CONFIG_NO_PAGE_MAPCOUNT is not set
CONFIG_PAGE_MAPCOUNT=y
CONFIG_PGTABLE_HAS_HUGE_LEAVES=y
CONFIG_HAVE_GIGANTIC_FOLIOS=y
CONFIG_ASYNC_KERNEL_PGTABLE_FREE=y
CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_CMA=y
# CONFIG_CMA_DEBUGFS is not set
# CONFIG_CMA_SYSFS is not set
CONFIG_CMA_AREAS=20
CONFIG_PAGE_BLOCK_MAX_ORDER=10
CONFIG_MEM_SOFT_DIRTY=y
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
CONFIG_PAGE_IDLE_FLAG=y
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y
CONFIG_ARCH_HAS_ZONE_DMA_SET=y
CONFIG_ZONE_DMA=y
CONFIG_ZONE_DMA32=y
CONFIG_ZONE_DEVICE=y
CONFIG_HMM_MIRROR=y
CONFIG_GET_FREE_REGION=y
CONFIG_DEVICE_PRIVATE=y
CONFIG_VMAP_PFN=y
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
CONFIG_ARCH_USES_PG_ARCH_2=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PERCPU_STATS=y
# CONFIG_GUP_TEST is not set
# CONFIG_DMAPOOL_TEST is not set
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_MAPPING_DIRTY_HELPERS=y
CONFIG_KMAP_LOCAL=y
CONFIG_MEMFD_CREATE=y
CONFIG_SECRETMEM=y
CONFIG_ANON_VMA_NAME=y
CONFIG_HAVE_ARCH_USERFAULTFD_WP=y
CONFIG_HAVE_ARCH_USERFAULTFD_MINOR=y
CONFIG_USERFAULTFD=y
# CONFIG_PTE_MARKER_UFFD_WP is not set
CONFIG_LRU_GEN=y
CONFIG_LRU_GEN_ENABLED=y
# CONFIG_LRU_GEN_STATS is not set
CONFIG_LRU_GEN_WALKS_MMU=y
CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y
CONFIG_PER_VMA_LOCK=y
CONFIG_LOCK_MM_AND_FIND_VMA=y
CONFIG_IOMMU_MM_DATA=y
CONFIG_EXECMEM=y
CONFIG_NUMA_MEMBLKS=y
CONFIG_NUMA_EMU=y
CONFIG_ARCH_HAS_USER_SHADOW_STACK=y
CONFIG_ARCH_SUPPORTS_PT_RECLAIM=y
CONFIG_PT_RECLAIM=y

#
# Data Access Monitoring
#
CONFIG_DAMON=y
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_PADDR=y
# CONFIG_DAMON_SYSFS is not set
CONFIG_DAMON_RECLAIM=y
# CONFIG_DAMON_LRU_SORT is not set
# CONFIG_DAMON_STAT is not set
# end of Data Access Monitoring
# end of Memory Management options

CONFIG_NET=y
CONFIG_WANT_COMPAT_NETLINK_MESSAGES=y
CONFIG_COMPAT_NETLINK_MESSAGES=y
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
CONFIG_NET_XGRESS=y
CONFIG_NET_REDIRECT=y
CONFIG_SKB_DECRYPTED=y
CONFIG_SKB_EXTENSIONS=y
CONFIG_NET_DEVMEM=y
CONFIG_NET_SHAPER=y
CONFIG_NET_CRC32C=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_INET_PSP=y
CONFIG_UNIX=y
CONFIG_AF_UNIX_OOB=y
CONFIG_UNIX_DIAG=y
CONFIG_TLS=y
CONFIG_TLS_DEVICE=y
CONFIG_TLS_TOE=y
CONFIG_XFRM=y
CONFIG_XFRM_OFFLOAD=y
CONFIG_XFRM_ALGO=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_USER_COMPAT=y
CONFIG_XFRM_INTERFACE=y
CONFIG_XFRM_SUB_POLICY=y
CONFIG_XFRM_MIGRATE=y
CONFIG_XFRM_STATISTICS=y
CONFIG_XFRM_AH=y
CONFIG_XFRM_ESP=y
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
# CONFIG_XFRM_IPTFS is not set
CONFIG_XFRM_ESPINTCP=y
CONFIG_SMC=y
CONFIG_SMC_DIAG=y
# CONFIG_SMC_HS_CTRL_BPF is not set
CONFIG_DIBS=y
CONFIG_DIBS_LO=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_NET_HANDSHAKE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_TRIE_STATS=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_ROUTE_CLASSID=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE_COMMON=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=y
CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=y
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
CONFIG_INET_ESP_OFFLOAD=y
CONFIG_INET_ESPINTCP=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_TABLE_PERTURB_ORDER=16
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_INET_UDP_DIAG=y
CONFIG_INET_RAW_DIAG=y
CONFIG_INET_DIAG_DESTROY=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_TCP_CONG_HTCP=y
CONFIG_TCP_CONG_HSTCP=y
CONFIG_TCP_CONG_HYBLA=y
CONFIG_TCP_CONG_VEGAS=y
CONFIG_TCP_CONG_NV=y
CONFIG_TCP_CONG_SCALABLE=y
CONFIG_TCP_CONG_LP=y
CONFIG_TCP_CONG_VENO=y
CONFIG_TCP_CONG_YEAH=y
CONFIG_TCP_CONG_ILLINOIS=y
CONFIG_TCP_CONG_DCTCP=y
CONFIG_TCP_CONG_CDG=y
CONFIG_TCP_CONG_BBR=y
# CONFIG_DEFAULT_BIC is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_HYBLA is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_VENO is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_DCTCP is not set
# CONFIG_DEFAULT_CDG is not set
# CONFIG_DEFAULT_BBR is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_AO is not set
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
CONFIG_INET6_ESP_OFFLOAD=y
CONFIG_INET6_ESPINTCP=y
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_MIP6=y
CONFIG_IPV6_ILA=y
CONFIG_INET6_XFRM_TUNNEL=y
CONFIG_INET6_TUNNEL=y
CONFIG_IPV6_VTI=y
CONFIG_IPV6_SIT=y
CONFIG_IPV6_SIT_6RD=y
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=y
CONFIG_IPV6_GRE=y
CONFIG_IPV6_FOU=y
CONFIG_IPV6_FOU_TUNNEL=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_IPV6_SEG6_LWTUNNEL=y
CONFIG_IPV6_SEG6_HMAC=y
CONFIG_IPV6_SEG6_BPF=y
CONFIG_IPV6_RPL_LWTUNNEL=y
# CONFIG_IPV6_IOAM6_LWTUNNEL is not set
CONFIG_NETLABEL=y
CONFIG_MPTCP=y
CONFIG_INET_MPTCP_DIAG=y
CONFIG_MPTCP_IPV6=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NET_PTP_CLASSIFY=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_INGRESS=y
CONFIG_NETFILTER_EGRESS=y
CONFIG_NETFILTER_SKIP_EGRESS=y
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_FAMILY_BRIDGE=y
CONFIG_NETFILTER_FAMILY_ARP=y
CONFIG_NETFILTER_BPF_LINK=y
# CONFIG_NETFILTER_NETLINK_HOOK is not set
CONFIG_NETFILTER_NETLINK_ACCT=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NETFILTER_NETLINK_OSF=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_LOG_SYSLOG=y
CONFIG_NETFILTER_CONNCOUNT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_ZONES=y
# CONFIG_NF_CONNTRACK_PROCFS is not set
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_TIMEOUT=y
CONFIG_NF_CONNTRACK_TIMESTAMP=y
CONFIG_NF_CONNTRACK_LABELS=y
CONFIG_NF_CONNTRACK_OVS=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CT_PROTO_UDPLITE=y
CONFIG_NF_CONNTRACK_AMANDA=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_CONNTRACK_H323=y
CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_BROADCAST=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_SNMP=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SIP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NF_CT_NETLINK_TIMEOUT=y
CONFIG_NF_CT_NETLINK_HELPER=y
CONFIG_NETFILTER_NETLINK_GLUE_CT=y
CONFIG_NF_NAT=y
CONFIG_NF_NAT_AMANDA=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_IRC=y
CONFIG_NF_NAT_SIP=y
CONFIG_NF_NAT_TFTP=y
CONFIG_NF_NAT_REDIRECT=y
CONFIG_NF_NAT_MASQUERADE=y
CONFIG_NF_NAT_OVS=y
CONFIG_NETFILTER_SYNPROXY=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=y
CONFIG_NFT_CT=y
CONFIG_NFT_EXTHDR_DCCP=y
CONFIG_NFT_FLOW_OFFLOAD=y
CONFIG_NFT_CONNLIMIT=y
CONFIG_NFT_LOG=y
CONFIG_NFT_LIMIT=y
CONFIG_NFT_MASQ=y
CONFIG_NFT_REDIR=y
CONFIG_NFT_NAT=y
CONFIG_NFT_TUNNEL=y
CONFIG_NFT_QUEUE=y
CONFIG_NFT_QUOTA=y
CONFIG_NFT_REJECT=y
CONFIG_NFT_REJECT_INET=y
CONFIG_NFT_COMPAT=y
CONFIG_NFT_HASH=y
CONFIG_NFT_FIB=y
CONFIG_NFT_FIB_INET=y
CONFIG_NFT_XFRM=y
CONFIG_NFT_SOCKET=y
CONFIG_NFT_OSF=y
CONFIG_NFT_TPROXY=y
CONFIG_NFT_SYNPROXY=y
CONFIG_NF_DUP_NETDEV=y
CONFIG_NFT_DUP_NETDEV=y
CONFIG_NFT_FWD_NETDEV=y
CONFIG_NFT_FIB_NETDEV=y
CONFIG_NFT_REJECT_NETDEV=y
CONFIG_NF_FLOW_TABLE_INET=y
CONFIG_NF_FLOW_TABLE=y
# CONFIG_NF_FLOW_TABLE_PROCFS is not set
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XTABLES_COMPAT=y
CONFIG_NETFILTER_XTABLES_LEGACY=y

#
# Xtables combined modules
#
CONFIG_NETFILTER_XT_MARK=y
CONFIG_NETFILTER_XT_CONNMARK=y
CONFIG_NETFILTER_XT_SET=y

#
# Xtables targets
#
CONFIG_NETFILTER_XT_TARGET_AUDIT=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
CONFIG_NETFILTER_XT_TARGET_CT=y
CONFIG_NETFILTER_XT_TARGET_DSCP=y
CONFIG_NETFILTER_XT_TARGET_HL=y
CONFIG_NETFILTER_XT_TARGET_HMARK=y
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LED=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_NAT=y
CONFIG_NETFILTER_XT_TARGET_NETMAP=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
CONFIG_NETFILTER_XT_TARGET_NOTRACK=y
CONFIG_NETFILTER_XT_TARGET_RATEEST=y
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
CONFIG_NETFILTER_XT_TARGET_TEE=y
CONFIG_NETFILTER_XT_TARGET_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_TRACE=y
CONFIG_NETFILTER_XT_TARGET_SECMARK=y
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=y

#
# Xtables matches
#
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_NETFILTER_XT_MATCH_BPF=y
CONFIG_NETFILTER_XT_MATCH_CGROUP=y
CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
CONFIG_NETFILTER_XT_MATCH_CPU=y
CONFIG_NETFILTER_XT_MATCH_DCCP=y
CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
CONFIG_NETFILTER_XT_MATCH_DSCP=y
CONFIG_NETFILTER_XT_MATCH_ECN=y
CONFIG_NETFILTER_XT_MATCH_ESP=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_HELPER=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPCOMP=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_IPVS=y
CONFIG_NETFILTER_XT_MATCH_L2TP=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
CONFIG_NETFILTER_XT_MATCH_MARK=y
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
CONFIG_NETFILTER_XT_MATCH_NFACCT=y
CONFIG_NETFILTER_XT_MATCH_OSF=y
CONFIG_NETFILTER_XT_MATCH_OWNER=y
CONFIG_NETFILTER_XT_MATCH_POLICY=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
CONFIG_NETFILTER_XT_MATCH_RATEEST=y
CONFIG_NETFILTER_XT_MATCH_REALM=y
CONFIG_NETFILTER_XT_MATCH_RECENT=y
CONFIG_NETFILTER_XT_MATCH_SCTP=y
CONFIG_NETFILTER_XT_MATCH_SOCKET=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
CONFIG_NETFILTER_XT_MATCH_TIME=y
CONFIG_NETFILTER_XT_MATCH_U32=y
# end of Core Netfilter Configuration

CONFIG_IP_SET=y
CONFIG_IP_SET_MAX=256
CONFIG_IP_SET_BITMAP_IP=y
CONFIG_IP_SET_BITMAP_IPMAC=y
CONFIG_IP_SET_BITMAP_PORT=y
CONFIG_IP_SET_HASH_IP=y
CONFIG_IP_SET_HASH_IPMARK=y
CONFIG_IP_SET_HASH_IPPORT=y
CONFIG_IP_SET_HASH_IPPORTIP=y
CONFIG_IP_SET_HASH_IPPORTNET=y
CONFIG_IP_SET_HASH_IPMAC=y
CONFIG_IP_SET_HASH_MAC=y
CONFIG_IP_SET_HASH_NETPORTNET=y
CONFIG_IP_SET_HASH_NET=y
CONFIG_IP_SET_HASH_NETNET=y
CONFIG_IP_SET_HASH_NETPORT=y
CONFIG_IP_SET_HASH_NETIFACE=y
CONFIG_IP_SET_LIST_SET=y
CONFIG_IP_VS=y
CONFIG_IP_VS_IPV6=y
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_PROTO_SCTP=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_FO=y
CONFIG_IP_VS_OVF=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_MH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_TWOS=y

#
# IPVS SH scheduler
#
CONFIG_IP_VS_SH_TAB_BITS=8

#
# IPVS MH scheduler
#
CONFIG_IP_VS_MH_TAB_INDEX=12

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=y
CONFIG_IP_VS_NFCT=y
CONFIG_IP_VS_PE_SIP=y

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_IP_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV4=y
CONFIG_NF_TPROXY_IPV4=y
CONFIG_NF_TABLES_IPV4=y
CONFIG_NFT_REJECT_IPV4=y
CONFIG_NFT_DUP_IPV4=y
CONFIG_NFT_FIB_IPV4=y
CONFIG_NF_TABLES_ARP=y
CONFIG_NF_DUP_IPV4=y
CONFIG_NF_LOG_ARP=y
CONFIG_NF_LOG_IPV4=y
CONFIG_NF_REJECT_IPV4=y
CONFIG_NF_NAT_SNMP_BASIC=y
CONFIG_NF_NAT_PPTP=y
CONFIG_NF_NAT_H323=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_AH=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_RPFILTER=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_SYNPROXY=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_TTL=y
CONFIG_IP_NF_RAW=y
CONFIG_IP_NF_SECURITY=y
CONFIG_IP_NF_ARPTABLES=y
CONFIG_NFT_COMPAT_ARP=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
# end of IP: Netfilter Configuration

#
# IPv6: Netfilter Configuration
#
CONFIG_IP6_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV6=y
CONFIG_NF_TPROXY_IPV6=y
CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_REJECT_IPV6=y
CONFIG_NFT_DUP_IPV6=y
CONFIG_NFT_FIB_IPV6=y
CONFIG_NF_DUP_IPV6=y
CONFIG_NF_REJECT_IPV6=y
CONFIG_NF_LOG_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_MATCH_AH=y
CONFIG_IP6_NF_MATCH_EUI64=y
CONFIG_IP6_NF_MATCH_FRAG=y
CONFIG_IP6_NF_MATCH_OPTS=y
CONFIG_IP6_NF_MATCH_HL=y
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
CONFIG_IP6_NF_MATCH_MH=y
CONFIG_IP6_NF_MATCH_RPFILTER=y
CONFIG_IP6_NF_MATCH_RT=y
CONFIG_IP6_NF_MATCH_SRH=y
CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_SYNPROXY=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_IP6_NF_RAW=y
CONFIG_IP6_NF_SECURITY=y
CONFIG_IP6_NF_NAT=y
CONFIG_IP6_NF_TARGET_MASQUERADE=y
CONFIG_IP6_NF_TARGET_NPT=y
# end of IPv6: Netfilter Configuration

CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_TABLES_BRIDGE=y
CONFIG_NFT_BRIDGE_META=y
CONFIG_NFT_BRIDGE_REJECT=y
CONFIG_NF_CONNTRACK_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES_LEGACY=y
CONFIG_BRIDGE_NF_EBTABLES=y
CONFIG_BRIDGE_EBT_BROUTE=y
CONFIG_BRIDGE_EBT_T_FILTER=y
CONFIG_BRIDGE_EBT_T_NAT=y
CONFIG_BRIDGE_EBT_802_3=y
CONFIG_BRIDGE_EBT_AMONG=y
CONFIG_BRIDGE_EBT_ARP=y
CONFIG_BRIDGE_EBT_IP=y
CONFIG_BRIDGE_EBT_IP6=y
CONFIG_BRIDGE_EBT_LIMIT=y
CONFIG_BRIDGE_EBT_MARK=y
CONFIG_BRIDGE_EBT_PKTTYPE=y
CONFIG_BRIDGE_EBT_STP=y
CONFIG_BRIDGE_EBT_VLAN=y
CONFIG_BRIDGE_EBT_ARPREPLY=y
CONFIG_BRIDGE_EBT_DNAT=y
CONFIG_BRIDGE_EBT_MARK_T=y
CONFIG_BRIDGE_EBT_REDIRECT=y
CONFIG_BRIDGE_EBT_SNAT=y
CONFIG_BRIDGE_EBT_LOG=y
CONFIG_BRIDGE_EBT_NFLOG=y
CONFIG_IP_SCTP=y
# CONFIG_SCTP_DBG_OBJCNT is not set
CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA256=y
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
CONFIG_INET_SCTP_DIAG=y
CONFIG_RDS=y
CONFIG_RDS_RDMA=y
CONFIG_RDS_TCP=y
# CONFIG_RDS_DEBUG is not set
CONFIG_TIPC=y
CONFIG_TIPC_MEDIA_IB=y
CONFIG_TIPC_MEDIA_UDP=y
CONFIG_TIPC_CRYPTO=y
CONFIG_TIPC_DIAG=y
CONFIG_ATM=y
CONFIG_ATM_CLIP=y
# CONFIG_ATM_CLIP_NO_ICMP is not set
CONFIG_ATM_LANE=y
CONFIG_ATM_MPOA=y
CONFIG_ATM_BR2684=y
# CONFIG_ATM_BR2684_IPFILTER is not set
CONFIG_L2TP=y
# CONFIG_L2TP_DEBUGFS is not set
CONFIG_L2TP_V3=y
CONFIG_L2TP_IP=y
CONFIG_L2TP_ETH=y
CONFIG_STP=y
CONFIG_GARP=y
CONFIG_MRP=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_IGMP_SNOOPING=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_NET_DSA=y
# CONFIG_NET_DSA_TAG_NONE is not set
# CONFIG_NET_DSA_TAG_AR9331 is not set
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
CONFIG_NET_DSA_TAG_BRCM=y
# CONFIG_NET_DSA_TAG_BRCM_LEGACY is not set
# CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS is not set
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
# CONFIG_NET_DSA_TAG_HELLCREEK is not set
# CONFIG_NET_DSA_TAG_GSWIP is not set
# CONFIG_NET_DSA_TAG_DSA is not set
# CONFIG_NET_DSA_TAG_EDSA is not set
CONFIG_NET_DSA_TAG_MTK=y
# CONFIG_NET_DSA_TAG_MXL_GSW1XX is not set
# CONFIG_NET_DSA_TAG_KSZ is not set
# CONFIG_NET_DSA_TAG_OCELOT is not set
# CONFIG_NET_DSA_TAG_OCELOT_8021Q is not set
CONFIG_NET_DSA_TAG_QCA=y
CONFIG_NET_DSA_TAG_RTL4_A=y
# CONFIG_NET_DSA_TAG_RTL8_4 is not set
# CONFIG_NET_DSA_TAG_RZN1_A5PSW is not set
# CONFIG_NET_DSA_TAG_LAN9303 is not set
# CONFIG_NET_DSA_TAG_SJA1105 is not set
# CONFIG_NET_DSA_TAG_TRAILER is not set
# CONFIG_NET_DSA_TAG_VSC73XX_8021Q is not set
# CONFIG_NET_DSA_TAG_XRS700X is not set
# CONFIG_NET_DSA_TAG_YT921X is not set
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=y
CONFIG_LLC2=y
# CONFIG_ATALK is not set
CONFIG_X25=y
CONFIG_LAPB=y
CONFIG_PHONET=y
CONFIG_6LOWPAN=y
# CONFIG_6LOWPAN_DEBUGFS is not set
CONFIG_6LOWPAN_NHC=y
CONFIG_6LOWPAN_NHC_DEST=y
CONFIG_6LOWPAN_NHC_FRAGMENT=y
CONFIG_6LOWPAN_NHC_HOP=y
CONFIG_6LOWPAN_NHC_IPV6=y
CONFIG_6LOWPAN_NHC_MOBILITY=y
CONFIG_6LOWPAN_NHC_ROUTING=y
CONFIG_6LOWPAN_NHC_UDP=y
CONFIG_6LOWPAN_GHC_EXT_HDR_HOP=y
CONFIG_6LOWPAN_GHC_UDP=y
CONFIG_6LOWPAN_GHC_ICMPV6=y
CONFIG_6LOWPAN_GHC_EXT_HDR_DEST=y
CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG=y
CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE=y
CONFIG_IEEE802154=y
CONFIG_IEEE802154_NL802154_EXPERIMENTAL=y
CONFIG_IEEE802154_SOCKET=y
CONFIG_IEEE802154_6LOWPAN=y
CONFIG_MAC802154=y
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_HFSC=y
CONFIG_NET_SCH_PRIO=y
CONFIG_NET_SCH_MULTIQ=y
CONFIG_NET_SCH_RED=y
CONFIG_NET_SCH_SFB=y
CONFIG_NET_SCH_SFQ=y
CONFIG_NET_SCH_TEQL=y
CONFIG_NET_SCH_TBF=y
CONFIG_NET_SCH_CBS=y
CONFIG_NET_SCH_ETF=y
CONFIG_NET_SCH_MQPRIO_LIB=y
CONFIG_NET_SCH_TAPRIO=y
CONFIG_NET_SCH_GRED=y
CONFIG_NET_SCH_NETEM=y
CONFIG_NET_SCH_DRR=y
CONFIG_NET_SCH_MQPRIO=y
CONFIG_NET_SCH_SKBPRIO=y
CONFIG_NET_SCH_CHOKE=y
CONFIG_NET_SCH_QFQ=y
CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_SCH_CAKE=y
CONFIG_NET_SCH_FQ=y
CONFIG_NET_SCH_HHF=y
CONFIG_NET_SCH_PIE=y
CONFIG_NET_SCH_FQ_PIE=y
CONFIG_NET_SCH_INGRESS=y
CONFIG_NET_SCH_PLUG=y
CONFIG_NET_SCH_ETS=y
# CONFIG_NET_SCH_DUALPI2 is not set
CONFIG_NET_SCH_DEFAULT=y
# CONFIG_DEFAULT_FQ is not set
CONFIG_DEFAULT_CODEL=y
# CONFIG_DEFAULT_FQ_CODEL is not set
# CONFIG_DEFAULT_FQ_PIE is not set
# CONFIG_DEFAULT_SFQ is not set
# CONFIG_DEFAULT_PFIFO_FAST is not set
CONFIG_DEFAULT_NET_SCH="pfifo_fast"

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_ROUTE4=y
CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_FLOW=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NET_CLS_MATCHALL=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=y
CONFIG_NET_EMATCH_NBYTE=y
CONFIG_NET_EMATCH_U32=y
CONFIG_NET_EMATCH_META=y
CONFIG_NET_EMATCH_TEXT=y
CONFIG_NET_EMATCH_CANID=y
CONFIG_NET_EMATCH_IPSET=y
CONFIG_NET_EMATCH_IPT=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=y
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_SAMPLE=y
CONFIG_NET_ACT_NAT=y
CONFIG_NET_ACT_PEDIT=y
CONFIG_NET_ACT_SIMP=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_NET_ACT_CSUM=y
CONFIG_NET_ACT_MPLS=y
CONFIG_NET_ACT_VLAN=y
CONFIG_NET_ACT_BPF=y
CONFIG_NET_ACT_CONNMARK=y
CONFIG_NET_ACT_CTINFO=y
CONFIG_NET_ACT_SKBMOD=y
CONFIG_NET_ACT_IFE=y
CONFIG_NET_ACT_TUNNEL_KEY=y
CONFIG_NET_ACT_CT=y
CONFIG_NET_ACT_GATE=y
CONFIG_NET_IFE_SKBMARK=y
CONFIG_NET_IFE_SKBPRIO=y
CONFIG_NET_IFE_SKBTCINDEX=y
CONFIG_NET_TC_SKB_EXT=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
CONFIG_BATMAN_ADV=y
CONFIG_BATMAN_ADV_BATMAN_V=y
CONFIG_BATMAN_ADV_BLA=y
CONFIG_BATMAN_ADV_DAT=y
CONFIG_BATMAN_ADV_MCAST=y
# CONFIG_BATMAN_ADV_DEBUG is not set
# CONFIG_BATMAN_ADV_TRACING is not set
CONFIG_OPENVSWITCH=y
CONFIG_OPENVSWITCH_GRE=y
CONFIG_OPENVSWITCH_VXLAN=y
CONFIG_OPENVSWITCH_GENEVE=y
CONFIG_VSOCKETS=y
CONFIG_VSOCKETS_DIAG=y
CONFIG_VSOCKETS_LOOPBACK=y
# CONFIG_VMWARE_VMCI_VSOCKETS is not set
CONFIG_VIRTIO_VSOCKETS=y
CONFIG_VIRTIO_VSOCKETS_COMMON=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=y
CONFIG_MPLS_IPTUNNEL=y
CONFIG_NET_NSH=y
CONFIG_HSR=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_QRTR=y
CONFIG_QRTR_TUN=y
# CONFIG_QRTR_MHI is not set
CONFIG_NET_NCSI=y
# CONFIG_NCSI_OEM_CMD_GET_MAC is not set
# CONFIG_NCSI_OEM_CMD_KEEP_PHY is not set
# CONFIG_PCPU_DEV_REFCNT is not set
CONFIG_MAX_SKB_FRAGS=17
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_XPS=y
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NET_DROP_MONITOR=y
# end of Network testing
# end of Networking options

CONFIG_HAMRADIO=y

#
# Packet Radio protocols
#
CONFIG_AX25=y
CONFIG_AX25_DAMA_SLAVE=y
CONFIG_NETROM=y
CONFIG_ROSE=y

#
# AX.25 network device drivers
#
CONFIG_MKISS=y
CONFIG_6PACK=y
CONFIG_BPQETHER=y
# CONFIG_BAYCOM_SER_FDX is not set
# CONFIG_BAYCOM_SER_HDX is not set
# CONFIG_BAYCOM_PAR is not set
# CONFIG_YAM is not set
# end of AX.25 network device drivers

CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_GW=y
CONFIG_CAN_J1939=y
CONFIG_CAN_ISOTP=y
CONFIG_BT=y
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_LE=y
CONFIG_BT_LE_L2CAP_ECRED=y
CONFIG_BT_6LOWPAN=y
CONFIG_BT_LEDS=y
CONFIG_BT_MSFTEXT=y
# CONFIG_BT_AOSPEXT is not set
# CONFIG_BT_DEBUGFS is not set
# CONFIG_BT_SELFTEST is not set

#
# Bluetooth device drivers
#
CONFIG_BT_INTEL=y
CONFIG_BT_BCM=y
CONFIG_BT_RTL=y
CONFIG_BT_QCA=y
CONFIG_BT_MTK=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
CONFIG_BT_HCIBTUSB_POLL_SYNC=y
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_MTK=y
CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_NOKIA is not set
CONFIG_BT_HCIUART_BCSP=y
# CONFIG_BT_HCIUART_ATH3K is not set
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
# CONFIG_BT_HCIUART_INTEL is not set
# CONFIG_BT_HCIUART_BCM is not set
# CONFIG_BT_HCIUART_RTL is not set
CONFIG_BT_HCIUART_QCA=y
CONFIG_BT_HCIUART_AG6XX=y
CONFIG_BT_HCIUART_MRVL=y
# CONFIG_BT_HCIUART_AML is not set
CONFIG_BT_HCIBCM203X=y
# CONFIG_BT_HCIBCM4377 is not set
CONFIG_BT_HCIBPA10X=y
CONFIG_BT_HCIBFUSB=y
# CONFIG_BT_HCIDTL1 is not set
# CONFIG_BT_HCIBT3C is not set
# CONFIG_BT_HCIBLUECARD is not set
CONFIG_BT_HCIVHCI=y
CONFIG_BT_MRVL=y
CONFIG_BT_MRVL_SDIO=y
CONFIG_BT_ATH3K=y
CONFIG_BT_MTKSDIO=y
CONFIG_BT_MTKUART=y
# CONFIG_BT_VIRTIO is not set
# CONFIG_BT_NXPUART is not set
# CONFIG_BT_INTEL_PCIE is not set
# end of Bluetooth device drivers

CONFIG_AF_RXRPC=y
CONFIG_AF_RXRPC_IPV6=y
# CONFIG_AF_RXRPC_INJECT_LOSS is not set
# CONFIG_AF_RXRPC_INJECT_RX_DELAY is not set
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=y
# CONFIG_RXGK is not set
# CONFIG_RXPERF is not set
CONFIG_AF_KCM=y
CONFIG_STREAM_PARSER=y
CONFIG_MCTP=y
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=y
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_CRDA_SUPPORT=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_GPIO is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_FD=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_NET_9P_USBG is not set
CONFIG_NET_9P_RDMA=y
# CONFIG_NET_9P_DEBUG is not set
CONFIG_CAIF=y
CONFIG_CAIF_DEBUG=y
CONFIG_CAIF_NETDEV=y
CONFIG_CAIF_USB=y
CONFIG_CEPH_LIB=y
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y
CONFIG_NFC=y
CONFIG_NFC_DIGITAL=y
CONFIG_NFC_NCI=y
# CONFIG_NFC_NCI_SPI is not set
CONFIG_NFC_NCI_UART=y
CONFIG_NFC_HCI=y
CONFIG_NFC_SHDLC=y

#
# Near Field Communication (NFC) devices
#
# CONFIG_NFC_TRF7970A is not set
# CONFIG_NFC_MEI_PHY is not set
CONFIG_NFC_SIM=y
CONFIG_NFC_PORT100=y
CONFIG_NFC_VIRTUAL_NCI=y
CONFIG_NFC_FDP=y
# CONFIG_NFC_FDP_I2C is not set
# CONFIG_NFC_PN544_I2C is not set
CONFIG_NFC_PN533=y
CONFIG_NFC_PN533_USB=y
# CONFIG_NFC_PN533_I2C is not set
# CONFIG_NFC_PN532_UART is not set
# CONFIG_NFC_MICROREAD_I2C is not set
CONFIG_NFC_MRVL=y
CONFIG_NFC_MRVL_USB=y
# CONFIG_NFC_MRVL_UART is not set
# CONFIG_NFC_MRVL_I2C is not set
# CONFIG_NFC_ST21NFCA_I2C is not set
# CONFIG_NFC_ST_NCI_I2C is not set
# CONFIG_NFC_ST_NCI_SPI is not set
# CONFIG_NFC_NXP_NCI is not set
# CONFIG_NFC_S3FWRN5_I2C is not set
# CONFIG_NFC_S3FWRN82_UART is not set
# CONFIG_NFC_ST95HF is not set
# end of Near Field Communication (NFC) devices

CONFIG_PSAMPLE=y
CONFIG_NET_IFE=y
CONFIG_LWTUNNEL=y
CONFIG_LWTUNNEL_BPF=y
CONFIG_DST_CACHE=y
CONFIG_GRO_CELLS=y
CONFIG_SOCK_VALIDATE_XMIT=y
CONFIG_NET_SELFTESTS=y
CONFIG_NET_SOCK_MSG=y
CONFIG_NET_DEVLINK=y
CONFIG_PAGE_POOL=y
# CONFIG_PAGE_POOL_STATS is not set
CONFIG_FAILOVER=y
CONFIG_ETHTOOL_NETLINK=y

#
# Device Drivers
#
CONFIG_HAVE_PCI=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
# CONFIG_PCIEAER_INJECT is not set
# CONFIG_PCIE_ECRC is not set
CONFIG_PCIEASPM=y
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
# CONFIG_PCIE_DPC is not set
# CONFIG_PCIE_PTM is not set
CONFIG_PCI_MSI=y
CONFIG_PCI_QUIRKS=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
# CONFIG_PCI_STUB is not set
# CONFIG_PCI_PF_STUB is not set
CONFIG_PCI_ATS=y
# CONFIG_PCI_TSM is not set
# CONFIG_PCI_DOE is not set
CONFIG_PCI_ECAM=y
CONFIG_PCI_LOCKLESS_CONFIG=y
CONFIG_PCI_IOV=y
# CONFIG_PCI_NPEM is not set
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
# CONFIG_PCIE_TPH is not set
# CONFIG_PCI_P2PDMA is not set
CONFIG_PCI_LABEL=y
# CONFIG_PCI_DYNAMIC_OF_NODES is not set
# CONFIG_PCIE_BUS_TUNE_OFF is not set
CONFIG_PCIE_BUS_DEFAULT=y
# CONFIG_PCIE_BUS_SAFE is not set
# CONFIG_PCIE_BUS_PERFORMANCE is not set
# CONFIG_PCIE_BUS_PEER2PEER is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_HOTPLUG_PCI=y
# CONFIG_HOTPLUG_PCI_ACPI is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_OCTEONEP is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set

#
# PCI controller drivers
#
CONFIG_PCI_HOST_COMMON=y
# CONFIG_PCI_FTPCI100 is not set
CONFIG_PCI_HOST_GENERIC=y
# CONFIG_VMD is not set
# CONFIG_PCIE_XILINX is not set

#
# Cadence-based PCIe controllers
#
# CONFIG_PCIE_CADENCE_PLAT_HOST is not set
# CONFIG_PCIE_CADENCE_PLAT_EP is not set
# end of Cadence-based PCIe controllers

#
# DesignWare-based PCIe controllers
#
# CONFIG_PCI_MESON is not set
# CONFIG_PCIE_INTEL_GW is not set
# CONFIG_PCIE_DW_PLAT_HOST is not set
# CONFIG_PCIE_DW_PLAT_EP is not set
# end of DesignWare-based PCIe controllers

#
# Mobiveil-based PCIe controllers
#
# end of Mobiveil-based PCIe controllers

#
# PLDA-based PCIe controllers
#
# CONFIG_PCIE_MICROCHIP_HOST is not set
# end of PLDA-based PCIe controllers
# end of PCI controller drivers

#
# PCI Endpoint
#
CONFIG_PCI_ENDPOINT=y
# CONFIG_PCI_ENDPOINT_CONFIGFS is not set
# CONFIG_PCI_ENDPOINT_MSI_DOORBELL is not set
# CONFIG_PCI_EPF_TEST is not set
# CONFIG_PCI_EPF_NTB is not set
# end of PCI Endpoint

#
# PCI switch controller drivers
#
# CONFIG_PCI_SW_SWITCHTEC is not set
# end of PCI switch controller drivers

# CONFIG_PCI_PWRCTRL_SLOT is not set
# CONFIG_PCI_PWRCTRL_TC9563 is not set
# CONFIG_CXL_BUS is not set
CONFIG_PCCARD=y
CONFIG_PCMCIA=y
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y

#
# PC-card bridges
#
CONFIG_YENTA=y
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
# CONFIG_PD6729 is not set
# CONFIG_I82092 is not set
CONFIG_PCCARD_NONSTATIC=y
# CONFIG_RAPIDIO is not set
# CONFIG_PC104 is not set

#
# Generic Driver Options
#
CONFIG_AUXILIARY_BUS=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_DEVTMPFS_SAFE is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y

#
# Firmware loader
#
CONFIG_FW_LOADER=y
# CONFIG_FW_LOADER_DEBUG is not set
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_FW_LOADER_COMPRESS=y
# CONFIG_FW_LOADER_COMPRESS_XZ is not set
# CONFIG_FW_LOADER_COMPRESS_ZSTD is not set
CONFIG_FW_CACHE=y
# CONFIG_FW_UPLOAD is not set
# end of Firmware loader

CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
CONFIG_GENERIC_CPU_DEVICES=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_DMA_FENCE_TRACE is not set
# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set
# end of Generic Driver Options

#
# Bus devices
#
# CONFIG_MOXTET is not set
CONFIG_MHI_BUS=y
# CONFIG_MHI_BUS_DEBUG is not set
# CONFIG_MHI_BUS_PCI_GENERIC is not set
# CONFIG_MHI_BUS_EP is not set
# end of Bus devices

CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y

#
# Firmware Drivers
#

#
# ARM System Control and Management Interface Protocol
#
# end of ARM System Control and Management Interface Protocol

# CONFIG_EDD is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# CONFIG_ISCSI_IBFT is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_SYSFB=y
# CONFIG_SYSFB_SIMPLEFB is not set
CONFIG_GOOGLE_FIRMWARE=y
# CONFIG_GOOGLE_SMI is not set
# CONFIG_GOOGLE_CBMEM is not set
CONFIG_GOOGLE_COREBOOT_TABLE=y
CONFIG_GOOGLE_MEMCONSOLE=y
# CONFIG_GOOGLE_MEMCONSOLE_X86_LEGACY is not set
# CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT is not set
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y

#
# Qualcomm firmware drivers
#
# end of Qualcomm firmware drivers

#
# Tegra firmware driver
#
# end of Tegra firmware driver
# end of Firmware Drivers

# CONFIG_FWCTL is not set
CONFIG_GNSS=y
# CONFIG_GNSS_MTK_SERIAL is not set
# CONFIG_GNSS_SIRF_SERIAL is not set
# CONFIG_GNSS_UBX_SERIAL is not set
CONFIG_GNSS_USB=y
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set

#
# Partition parsers
#
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_OF_PARTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# end of Partition parsers

#
# User Modules And Translation Layers
#
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

#
# Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK.
#
CONFIG_FTL=y
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set
# CONFIG_MTD_PARTITIONED_MASTER is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# end of RAM/ROM/Flash chip drivers

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set
# end of Mapping drivers for chip access

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_MCHP23K256 is not set
# CONFIG_MTD_MCHP48L640 is not set
# CONFIG_MTD_SST25L is not set
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=128
CONFIG_MTDRAM_ERASE_SIZE=4
CONFIG_MTD_BLOCK2MTD=y
# CONFIG_MTD_INTEL_DG is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOCG3 is not set
# end of Self-contained MTD device drivers

#
# NAND
#
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_RAW_NAND is not set
# CONFIG_MTD_SPI_NAND is not set

#
# ECC engine support
#
# CONFIG_MTD_NAND_ECC_SW_HAMMING is not set
# CONFIG_MTD_NAND_ECC_SW_BCH is not set
# CONFIG_MTD_NAND_ECC_MXIC is not set
# end of ECC engine support
# end of NAND

#
# LPDDR & LPDDR2 PCM memory drivers
#
# CONFIG_MTD_LPDDR is not set
# end of LPDDR & LPDDR2 PCM memory drivers

# CONFIG_MTD_SPI_NOR is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
# CONFIG_MTD_UBI_FAULT_INJECTION is not set
# CONFIG_MTD_UBI_NVMEM is not set
# CONFIG_MTD_HYPERBUS is not set
CONFIG_DTC=y
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_KOBJ=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_RESERVED_MEM=y
# CONFIG_OF_OVERLAY is not set
CONFIG_OF_NUMA=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_PARPORT=y
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_CDROM=y
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
CONFIG_ZRAM=y
# CONFIG_ZRAM_BACKEND_LZ4 is not set
# CONFIG_ZRAM_BACKEND_LZ4HC is not set
# CONFIG_ZRAM_BACKEND_ZSTD is not set
# CONFIG_ZRAM_BACKEND_DEFLATE is not set
# CONFIG_ZRAM_BACKEND_842 is not set
CONFIG_ZRAM_BACKEND_FORCE_LZO=y
CONFIG_ZRAM_BACKEND_LZO=y
# CONFIG_ZRAM_DEF_COMP_LZORLE is not set
CONFIG_ZRAM_DEF_COMP_LZO=y
CONFIG_ZRAM_DEF_COMP="lzo"
# CONFIG_ZRAM_WRITEBACK is not set
# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set
# CONFIG_ZRAM_MEMORY_TRACKING is not set
# CONFIG_ZRAM_MULTI_COMP is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_UBLK is not set
CONFIG_BLK_DEV_RNBD=y
CONFIG_BLK_DEV_RNBD_CLIENT=y
# CONFIG_BLK_DEV_ZONED_LOOP is not set

#
# NVME Support
#
CONFIG_NVME_CORE=y
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_MULTIPATH=y
# CONFIG_NVME_VERBOSE_ERRORS is not set
# CONFIG_NVME_HWMON is not set
CONFIG_NVME_FABRICS=y
CONFIG_NVME_RDMA=y
CONFIG_NVME_FC=y
CONFIG_NVME_TCP=y
# CONFIG_NVME_TCP_TLS is not set
# CONFIG_NVME_HOST_AUTH is not set
CONFIG_NVME_TARGET=y
# CONFIG_NVME_TARGET_DEBUGFS is not set
# CONFIG_NVME_TARGET_PASSTHRU is not set
CONFIG_NVME_TARGET_LOOP=y
CONFIG_NVME_TARGET_RDMA=y
CONFIG_NVME_TARGET_FC=y
CONFIG_NVME_TARGET_FCLOOP=y
CONFIG_NVME_TARGET_TCP=y
# CONFIG_NVME_TARGET_TCP_TLS is not set
# CONFIG_NVME_TARGET_AUTH is not set
# CONFIG_NVME_TARGET_PCI_EPF is not set
# end of NVME Support

#
# Misc devices
#
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_IBM_ASM is not set
# CONFIG_PHANTOM is not set
# CONFIG_RPMB is not set
# CONFIG_TI_FPC202 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
# CONFIG_DW_XDATA_PCIE is not set
# CONFIG_PCI_ENDPOINT_TEST is not set
# CONFIG_XILINX_SDFEC is not set
CONFIG_MISC_RTSX=y
# CONFIG_HISI_HIKEY_USB is not set
# CONFIG_OPEN_DICE is not set
# CONFIG_NTSYNC is not set
# CONFIG_VCPU_STALL_DETECTOR is not set
# CONFIG_NSM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_MAX6875 is not set
CONFIG_EEPROM_93CX6=y
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_EEPROM_IDT_89HPESX is not set
# CONFIG_EEPROM_EE1004 is not set
# CONFIG_EEPROM_M24LR is not set
# end of EEPROM support

# CONFIG_CB710_CORE is not set
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_ALTERA_STAPL is not set
CONFIG_INTEL_MEI=y
CONFIG_INTEL_MEI_ME=y
# CONFIG_INTEL_MEI_TXE is not set
# CONFIG_INTEL_MEI_GSC is not set
# CONFIG_INTEL_MEI_VSC_HW is not set
# CONFIG_INTEL_MEI_HDCP is not set
# CONFIG_INTEL_MEI_PXP is not set
# CONFIG_INTEL_MEI_GSC_PROXY is not set
CONFIG_VMWARE_VMCI=y
# CONFIG_GENWQE is not set
# CONFIG_BCM_VK is not set
# CONFIG_MISC_ALCOR_PCI is not set
# CONFIG_MISC_RTSX_PCI is not set
CONFIG_MISC_RTSX_USB=y
# CONFIG_UACCE is not set
# CONFIG_PVPANIC is not set
# CONFIG_GP_PCI1XXXX is not set
# CONFIG_KEBA_CP500 is not set
# CONFIG_MISC_RP1 is not set
# end of Misc devices

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
CONFIG_RAID_ATTRS=y
CONFIG_SCSI_COMMON=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SAS_ATTRS=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
# CONFIG_SCSI_SAS_HOST_SMP is not set
CONFIG_SCSI_SRP_ATTRS=y
# end of SCSI Transports

CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
CONFIG_SCSI_HPSA=y
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_SCSI_ESAS2R is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_MPI3MR is not set
# CONFIG_SCSI_SMARTPQI is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_MYRB is not set
# CONFIG_SCSI_MYRS is not set
# CONFIG_VMWARE_PVSCSI is not set
# CONFIG_LIBFC is not set
# CONFIG_SCSI_SNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_FDOMAIN_PCI is not set
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_EFCT is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_WD719X is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_VIRTIO=y
# CONFIG_SCSI_CHELSIO_FCOE is not set
# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
# CONFIG_SCSI_DH is not set
# end of SCSI device support

CONFIG_ATA=y
CONFIG_SATA_HOST=y
CONFIG_PATA_TIMINGS=y
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_FORCE=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
CONFIG_SATA_MOBILE_LPM_POLICY=3
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_AHCI_DWC is not set
# CONFIG_AHCI_CEVA is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_DWC is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
CONFIG_PATA_AMD=y
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
CONFIG_PATA_OLDPIIX=y
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
CONFIG_PATA_SCH=y
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PCMCIA is not set
# CONFIG_PATA_OF_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
# CONFIG_PATA_ACPI is not set
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_BITMAP=y
# CONFIG_MD_LLBITMAP is not set
CONFIG_MD_AUTODETECT=y
CONFIG_MD_BITMAP_FILE=y
# CONFIG_MD_LINEAR is not set
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID10=y
CONFIG_MD_RAID456=y
# CONFIG_MD_CLUSTER is not set
CONFIG_BCACHE=y
# CONFIG_BCACHE_DEBUG is not set
# CONFIG_BCACHE_ASYNC_REGISTRATION is not set
CONFIG_BLK_DEV_DM_BUILTIN=y
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
CONFIG_DM_BUFIO=y
# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set
CONFIG_DM_BIO_PRISON=y
CONFIG_DM_PERSISTENT_DATA=y
# CONFIG_DM_UNSTRIPED is not set
CONFIG_DM_CRYPT=y
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_THIN_PROVISIONING=y
CONFIG_DM_CACHE=y
CONFIG_DM_CACHE_SMQ=y
CONFIG_DM_WRITECACHE=y
# CONFIG_DM_EBS is not set
# CONFIG_DM_ERA is not set
CONFIG_DM_CLONE=y
CONFIG_DM_MIRROR=y
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_RAID=y
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y
CONFIG_DM_MULTIPATH_QL=y
CONFIG_DM_MULTIPATH_ST=y
# CONFIG_DM_MULTIPATH_HST is not set
# CONFIG_DM_MULTIPATH_IOA is not set
# CONFIG_DM_DELAY is not set
# CONFIG_DM_DUST is not set
# CONFIG_DM_INIT is not set
CONFIG_DM_UEVENT=y
CONFIG_DM_FLAKEY=y
CONFIG_DM_VERITY=y
# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set
CONFIG_DM_VERITY_FEC=y
# CONFIG_DM_SWITCH is not set
# CONFIG_DM_LOG_WRITES is not set
CONFIG_DM_INTEGRITY=y
CONFIG_DM_ZONED=y
CONFIG_DM_AUDIT=y
# CONFIG_DM_VDO is not set
# CONFIG_DM_PCACHE is not set
CONFIG_TARGET_CORE=y
# CONFIG_TCM_IBLOCK is not set
# CONFIG_TCM_FILEIO is not set
# CONFIG_TCM_PSCSI is not set
# CONFIG_LOOPBACK_TARGET is not set
# CONFIG_ISCSI_TARGET is not set
# CONFIG_SBP_TARGET is not set
# CONFIG_REMOTE_TARGET is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
CONFIG_FIREWIRE=y
CONFIG_FIREWIRE_OHCI=y
CONFIG_FIREWIRE_SBP2=y
CONFIG_FIREWIRE_NET=y
# CONFIG_FIREWIRE_NOSY is not set
# end of IEEE 1394 (FireWire) support

# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_WIREGUARD=y
# CONFIG_WIREGUARD_DEBUG is not set
# CONFIG_OVPN is not set
CONFIG_EQUALIZER=y
CONFIG_NET_FC=y
CONFIG_IFB=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_BROADCAST=y
CONFIG_NET_TEAM_MODE_ROUNDROBIN=y
CONFIG_NET_TEAM_MODE_RANDOM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN_L3S=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_GTP=y
# CONFIG_PFCP is not set
# CONFIG_AMT is not set
CONFIG_MACSEC=y
CONFIG_NETCONSOLE=y
# CONFIG_NETCONSOLE_DYNAMIC is not set
# CONFIG_NETCONSOLE_EXTENDED_LOG is not set
CONFIG_NETPOLL=y
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=y
CONFIG_TAP=y
CONFIG_TUN_VNET_CROSS_LE=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
# CONFIG_NETKIT is not set
CONFIG_NET_VRF=y
CONFIG_VSOCKMON=y
# CONFIG_MHI_NET is not set
# CONFIG_ARCNET is not set
CONFIG_ATM_DRIVERS=y
# CONFIG_ATM_DUMMY is not set
CONFIG_ATM_TCP=y
# CONFIG_ATM_LANAI is not set
# CONFIG_ATM_ENI is not set
# CONFIG_ATM_NICSTAR is not set
# CONFIG_ATM_IDT77252 is not set
# CONFIG_ATM_IA is not set
# CONFIG_ATM_FORE200E is not set
# CONFIG_ATM_HE is not set
# CONFIG_ATM_SOLOS is not set
CONFIG_CAIF_DRIVERS=y
CONFIG_CAIF_TTY=y
CONFIG_CAIF_VIRTIO=y

#
# Distributed Switch Architecture drivers
#
# CONFIG_B53 is not set
# CONFIG_NET_DSA_BCM_SF2 is not set
# CONFIG_NET_DSA_LOOP is not set
# CONFIG_NET_DSA_HIRSCHMANN_HELLCREEK is not set
# CONFIG_NET_DSA_LANTIQ_GSWIP is not set
# CONFIG_NET_DSA_MXL_GSW1XX is not set
# CONFIG_NET_DSA_MT7530 is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON is not set
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_AR9331 is not set
# CONFIG_NET_DSA_QCA8K is not set
# CONFIG_NET_DSA_SJA1105 is not set
# CONFIG_NET_DSA_XRS700X_I2C is not set
# CONFIG_NET_DSA_XRS700X_MDIO is not set
# CONFIG_NET_DSA_REALTEK is not set
# CONFIG_NET_DSA_KS8995 is not set
# CONFIG_NET_DSA_SMSC_LAN9303_I2C is not set
# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_SPI is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_PLATFORM is not set
# CONFIG_NET_DSA_YT921X is not set
# end of Distributed Switch Architecture drivers

CONFIG_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMAZON=y
# CONFIG_ENA_ETHERNET is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
CONFIG_NET_VENDOR_ASIX=y
# CONFIG_SPI_AX88796C is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_CX_ECAT is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_NET_VENDOR_CORTINA is not set
CONFIG_NET_VENDOR_DAVICOM=y
# CONFIG_DM9051 is not set
# CONFIG_DNET is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
CONFIG_NET_VENDOR_ENGLEDER=y
# CONFIG_TSNEP is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FUJITSU is not set
CONFIG_NET_VENDOR_FUNGIBLE=y
# CONFIG_FUN_ETH is not set
CONFIG_NET_VENDOR_GOOGLE=y
CONFIG_GVE=y
CONFIG_NET_VENDOR_HISILICON=y
# CONFIG_HIBMCGE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=y
CONFIG_E1000=y
CONFIG_E1000E=y
CONFIG_E1000E_HWTS=y
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_ICE is not set
# CONFIG_FM10K is not set
# CONFIG_IGC is not set
# CONFIG_IDPF is not set
# CONFIG_JME is not set
# CONFIG_NET_VENDOR_ADI is not set
CONFIG_NET_VENDOR_LITEX=y
# CONFIG_LITEX_LITEETH is not set
# CONFIG_NET_VENDOR_MARVELL is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
CONFIG_MLX4_CORE=y
# CONFIG_MLX4_DEBUG is not set
# CONFIG_MLX4_CORE_GEN2 is not set
# CONFIG_MLX5_CORE is not set
# CONFIG_MLXSW_CORE is not set
# CONFIG_MLXFW is not set
CONFIG_NET_VENDOR_META=y
# CONFIG_FBNIC is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
CONFIG_NET_VENDOR_MICROSOFT=y
CONFIG_NET_VENDOR_MUCSE=y
# CONFIG_MGBE is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_FEALNX is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETERION is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_ETHOC is not set
# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
CONFIG_NET_VENDOR_VERTEXCOM=y
# CONFIG_MSE102X is not set
# CONFIG_NET_VENDOR_VIA is not set
CONFIG_NET_VENDOR_WANGXUN=y
# CONFIG_NGBE is not set
# CONFIG_TXGBE is not set
# CONFIG_TXGBEVF is not set
# CONFIG_NGBEVF is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
# CONFIG_NET_VENDOR_XIRCOM is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
# CONFIG_HIPPI is not set
CONFIG_MDIO_BUS=y
CONFIG_PHYLINK=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
# CONFIG_LED_TRIGGER_PHY is not set
CONFIG_PHYLIB_LEDS=y
CONFIG_FIXED_PHY=y
# CONFIG_SFP is not set

#
# MII PHY device drivers
#
# CONFIG_AS21XXX_PHY is not set
# CONFIG_AIR_EN8811H_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_ADIN_PHY is not set
# CONFIG_ADIN1100_PHY is not set
# CONFIG_AQUANTIA_PHY is not set
CONFIG_AX88796B_PHY=y
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM54140_PHY is not set
# CONFIG_BCM7XXX_PHY is not set
# CONFIG_BCM84881_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_CORTINA_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_INTEL_XWAY_PHY is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_MARVELL_10G_PHY is not set
# CONFIG_MARVELL_88Q2XXX_PHY is not set
# CONFIG_MARVELL_88X2222_PHY is not set
# CONFIG_MAXLINEAR_GPHY is not set
# CONFIG_MAXLINEAR_86110_PHY is not set
# CONFIG_MEDIATEK_GE_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_MICROCHIP_T1S_PHY is not set
CONFIG_MICROCHIP_PHY=y
# CONFIG_MICROCHIP_T1_PHY is not set
# CONFIG_MICROSEMI_PHY is not set
# CONFIG_MOTORCOMM_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_NXP_CBTX_PHY is not set
# CONFIG_NXP_C45_TJA11XX_PHY is not set
# CONFIG_NXP_TJA11XX_PHY is not set
# CONFIG_NCN26000_PHY is not set
# CONFIG_AT803X_PHY is not set
# CONFIG_QCA83XX_PHY is not set
# CONFIG_QCA808X_PHY is not set
# CONFIG_QCA807X_PHY is not set
# CONFIG_QSEMI_PHY is not set
CONFIG_REALTEK_PHY=y
# CONFIG_REALTEK_PHY_HWMON is not set
# CONFIG_RENESAS_PHY is not set
# CONFIG_ROCKCHIP_PHY is not set
CONFIG_SMSC_PHY=y
# CONFIG_STE10XP is not set
# CONFIG_TERANETICS_PHY is not set
# CONFIG_DP83822_PHY is not set
# CONFIG_DP83TC811_PHY is not set
# CONFIG_DP83848_PHY is not set
# CONFIG_DP83867_PHY is not set
# CONFIG_DP83869_PHY is not set
# CONFIG_DP83TD510_PHY is not set
# CONFIG_DP83TG720_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_XILINX_GMII2RGMII is not set
# CONFIG_PSE_CONTROLLER is not set
CONFIG_CAN_DEV=y
CONFIG_CAN_VCAN=y
CONFIG_CAN_VXCAN=y
CONFIG_CAN_NETLINK=y
CONFIG_CAN_CALC_BITTIMING=y
CONFIG_CAN_RX_OFFLOAD=y
# CONFIG_CAN_CAN327 is not set
# CONFIG_CAN_DUMMY is not set
# CONFIG_CAN_FLEXCAN is not set
# CONFIG_CAN_GRCAN is not set
# CONFIG_CAN_KVASER_PCIEFD is not set
CONFIG_CAN_SLCAN=y
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set
# CONFIG_CAN_CTUCANFD_PCI is not set
# CONFIG_CAN_CTUCANFD_PLATFORM is not set
# CONFIG_CAN_ESD_402_PCI is not set
CONFIG_CAN_IFI_CANFD=y
# CONFIG_CAN_M_CAN is not set
# CONFIG_CAN_PEAK_PCIEFD is not set
# CONFIG_CAN_SJA1000 is not set
# CONFIG_CAN_SOFTING is not set

#
# CAN SPI interfaces
#
# CONFIG_CAN_HI311X is not set
# CONFIG_CAN_MCP251X is not set
# CONFIG_CAN_MCP251XFD is not set
# end of CAN SPI interfaces

#
# CAN USB interfaces
#
CONFIG_CAN_8DEV_USB=y
CONFIG_CAN_EMS_USB=y
CONFIG_CAN_ESD_USB=y
CONFIG_CAN_ETAS_ES58X=y
CONFIG_CAN_F81604=y
CONFIG_CAN_GS_USB=y
CONFIG_CAN_KVASER_USB=y
CONFIG_CAN_MCBA_USB=y
CONFIG_CAN_PEAK_USB=y
CONFIG_CAN_UCAN=y
# end of CAN USB interfaces

# CONFIG_CAN_DEBUG_DEVICES is not set

#
# MCTP Device Drivers
#
# CONFIG_MCTP_SERIAL is not set
# CONFIG_MCTP_TRANSPORT_I2C is not set
# CONFIG_MCTP_TRANSPORT_USB is not set
# end of MCTP Device Drivers

CONFIG_FWNODE_MDIO=y
CONFIG_OF_MDIO=y
CONFIG_ACPI_MDIO=y
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BCM_UNIMAC is not set
# CONFIG_MDIO_HISI_FEMAC is not set
CONFIG_MDIO_MVUSB=y
# CONFIG_MDIO_MSCC_MIIM is not set
# CONFIG_MDIO_OCTEON is not set
# CONFIG_MDIO_IPQ4019 is not set
# CONFIG_MDIO_IPQ8064 is not set
# CONFIG_MDIO_THUNDER is not set

#
# MDIO Multiplexers
#
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set

#
# PCS device drivers
#
# CONFIG_PCS_XPCS is not set
# end of PCS device drivers

# CONFIG_PLIP is not set
CONFIG_PPP=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOATM=y
CONFIG_PPPOE=y
CONFIG_PPPOE_HASH_BITS_1=y
# CONFIG_PPPOE_HASH_BITS_2 is not set
# CONFIG_PPPOE_HASH_BITS_4 is not set
# CONFIG_PPPOE_HASH_BITS_8 is not set
CONFIG_PPPOE_HASH_BITS=1
CONFIG_PPTP=y
CONFIG_PPPOL2TP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y
CONFIG_SLIP=y
CONFIG_SLHC=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_RTL8150=y
CONFIG_USB_RTL8152=y
CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_HUAWEI_CDC_NCM=y
CONFIG_USB_NET_CDC_MBIM=y
CONFIG_USB_NET_DM9601=y
CONFIG_USB_NET_SR9700=y
CONFIG_USB_NET_SR9800=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_NET_GL620A=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_CX82310_ETH=y
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_HSO=y
CONFIG_USB_NET_INT51X1=y
CONFIG_USB_CDC_PHONET=y
CONFIG_USB_IPHETH=y
CONFIG_USB_SIERRA_NET=y
CONFIG_USB_VL600=y
CONFIG_USB_NET_CH9200=y
CONFIG_USB_NET_AQC111=y
CONFIG_USB_RTL8153_ECM=y
CONFIG_WLAN=y
CONFIG_WLAN_VENDOR_ADMTEK=y
# CONFIG_ADM8211 is not set
CONFIG_ATH_COMMON=y
CONFIG_WLAN_VENDOR_ATH=y
# CONFIG_ATH_DEBUG is not set
# CONFIG_ATH5K is not set
# CONFIG_ATH5K_PCI is not set
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_COMMON_DEBUG=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_STATION_STATISTICS is not set
CONFIG_ATH9K_DYNACK=y
# CONFIG_ATH9K_WOW is not set
CONFIG_ATH9K_RFKILL=y
CONFIG_ATH9K_CHANNEL_CONTEXT=y
CONFIG_ATH9K_PCOEM=y
# CONFIG_ATH9K_PCI_NO_EEPROM is not set
CONFIG_ATH9K_HTC=y
CONFIG_ATH9K_HTC_DEBUGFS=y
# CONFIG_ATH9K_HWRNG is not set
CONFIG_ATH9K_COMMON_SPECTRAL=y
CONFIG_CARL9170=y
CONFIG_CARL9170_LEDS=y
# CONFIG_CARL9170_DEBUGFS is not set
CONFIG_CARL9170_WPC=y
CONFIG_CARL9170_HWRNG=y
CONFIG_ATH6KL=y
# CONFIG_ATH6KL_SDIO is not set
CONFIG_ATH6KL_USB=y
# CONFIG_ATH6KL_DEBUG is not set
# CONFIG_ATH6KL_TRACING is not set
CONFIG_AR5523=y
# CONFIG_WIL6210 is not set
CONFIG_ATH10K=y
CONFIG_ATH10K_CE=y
CONFIG_ATH10K_PCI=y
# CONFIG_ATH10K_AHB is not set
# CONFIG_ATH10K_SDIO is not set
CONFIG_ATH10K_USB=y
# CONFIG_ATH10K_DEBUG is not set
# CONFIG_ATH10K_DEBUGFS is not set
CONFIG_ATH10K_LEDS=y
# CONFIG_ATH10K_TRACING is not set
# CONFIG_WCN36XX is not set
CONFIG_ATH11K=y
# CONFIG_ATH11K_PCI is not set
# CONFIG_ATH11K_DEBUG is not set
# CONFIG_ATH11K_DEBUGFS is not set
# CONFIG_ATH11K_TRACING is not set
# CONFIG_ATH12K is not set
# CONFIG_WLAN_VENDOR_ATMEL is not set
# CONFIG_WLAN_VENDOR_BROADCOM is not set
# CONFIG_WLAN_VENDOR_INTEL is not set
# CONFIG_WLAN_VENDOR_INTERSIL is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
CONFIG_WLAN_VENDOR_PURELIFI=y
CONFIG_PLFXLC=y
# CONFIG_WLAN_VENDOR_RALINK is not set
# CONFIG_WLAN_VENDOR_REALTEK is not set
# CONFIG_WLAN_VENDOR_RSI is not set
CONFIG_WLAN_VENDOR_SILABS=y
# CONFIG_WFX is not set
# CONFIG_WLAN_VENDOR_ST is not set
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
CONFIG_MAC80211_HWSIM=y
CONFIG_VIRT_WIFI=y
CONFIG_WAN=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y
CONFIG_HDLC_FR=y
CONFIG_HDLC_PPP=y
CONFIG_HDLC_X25=y
# CONFIG_FRAMER is not set
# CONFIG_PCI200SYN is not set
# CONFIG_WANXL is not set
# CONFIG_PC300TOO is not set
# CONFIG_FARSYNC is not set
CONFIG_LAPBETHER=y
CONFIG_IEEE802154_DRIVERS=y
# CONFIG_IEEE802154_FAKELB is not set
# CONFIG_IEEE802154_AT86RF230 is not set
# CONFIG_IEEE802154_MRF24J40 is not set
# CONFIG_IEEE802154_CC2520 is not set
CONFIG_IEEE802154_ATUSB=y
# CONFIG_IEEE802154_ADF7242 is not set
# CONFIG_IEEE802154_CA8210 is not set
# CONFIG_IEEE802154_MCR20A is not set
CONFIG_IEEE802154_HWSIM=y

#
# Wireless WAN
#
CONFIG_WWAN=y
# CONFIG_WWAN_DEBUGFS is not set
# CONFIG_WWAN_HWSIM is not set
CONFIG_MHI_WWAN_CTRL=y
# CONFIG_MHI_WWAN_MBIM is not set
# CONFIG_IOSM is not set
# CONFIG_MTK_T7XX is not set
# end of Wireless WAN

CONFIG_VMXNET3=y
# CONFIG_FUJITSU_ES is not set
CONFIG_USB4_NET=y
CONFIG_NETDEVSIM=y
CONFIG_NET_FAILOVER=y
CONFIG_ISDN=y
CONFIG_ISDN_CAPI=y
CONFIG_MISDN=y
CONFIG_MISDN_DSP=y
CONFIG_MISDN_L1OIP=y

#
# mISDN hardware drivers
#
# CONFIG_MISDN_HFCPCI is not set
# CONFIG_MISDN_HFCMULTI is not set
CONFIG_MISDN_HFCUSB=y
# CONFIG_MISDN_AVMFRITZ is not set
# CONFIG_MISDN_SPEEDFAX is not set
# CONFIG_MISDN_INFINEON is not set
# CONFIG_MISDN_W6692 is not set
# CONFIG_MISDN_NETJET is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_LEDS=y
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_SPARSEKMAP=y
# CONFIG_INPUT_MATRIXKMAP is not set
CONFIG_INPUT_VIVALDIFMAP=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADC is not set
# CONFIG_KEYBOARD_ADP5588 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1050 is not set
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_DLINK_DIR685 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_PINEPHONE is not set
# CONFIG_KEYBOARD_SAMSUNG is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
# CONFIG_KEYBOARD_TWL4030 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_CAP11XX is not set
# CONFIG_KEYBOARD_BCM is not set
# CONFIG_KEYBOARD_CYPRESS_SF is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_BYD=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_PS2_FOCALTECH=y
# CONFIG_MOUSE_PS2_VMMOUSE is not set
CONFIG_MOUSE_PS2_SMBUS=y
# CONFIG_MOUSE_SERIAL is not set
CONFIG_MOUSE_APPLETOUCH=y
CONFIG_MOUSE_BCM5974=y
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_ELAN_I2C is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
CONFIG_MOUSE_SYNAPTICS_USB=y
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADC is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
CONFIG_JOYSTICK_IFORCE=y
CONFIG_JOYSTICK_IFORCE_USB=y
# CONFIG_JOYSTICK_IFORCE_232 is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDJOY is not set
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_JOYSTICK_WALKERA0701 is not set
# CONFIG_JOYSTICK_PSXPAD_SPI is not set
CONFIG_JOYSTICK_PXRC=y
# CONFIG_JOYSTICK_QWIIC is not set
# CONFIG_JOYSTICK_FSIA6B is not set
# CONFIG_JOYSTICK_SENSEHAT is not set
# CONFIG_JOYSTICK_SEESAW is not set
CONFIG_INPUT_TABLET=y
CONFIG_TABLET_USB_ACECAD=y
CONFIG_TABLET_USB_AIPTEK=y
CONFIG_TABLET_USB_HANWANG=y
CONFIG_TABLET_USB_KBTAB=y
CONFIG_TABLET_USB_PEGASUS=y
# CONFIG_TABLET_SERIAL_WACOM4 is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ADC is not set
# CONFIG_TOUCHSCREEN_AR1021_I2C is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_BU21029 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8505 is not set
# CONFIG_TOUCHSCREEN_CY8CTMA140 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_CYTTSP5 is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set
# CONFIG_TOUCHSCREEN_EXC3000 is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_GOODIX is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI is not set
# CONFIG_TOUCHSCREEN_HIDEEP is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX852X is not set
# CONFIG_TOUCHSCREEN_HYCON_HY46XX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CST816X is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_ILITEK is not set
# CONFIG_TOUCHSCREEN_S6SY761 is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_EKTF2127 is not set
# CONFIG_TOUCHSCREEN_ELAN is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MMS114 is not set
# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set
# CONFIG_TOUCHSCREEN_MSG2638 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS is not set
# CONFIG_TOUCHSCREEN_IMAGIS is not set
# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
CONFIG_TOUCHSCREEN_USB_PANJIT=y
CONFIG_TOUCHSCREEN_USB_3M=y
CONFIG_TOUCHSCREEN_USB_ITM=y
CONFIG_TOUCHSCREEN_USB_ETURBO=y
CONFIG_TOUCHSCREEN_USB_GUNZE=y
CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
CONFIG_TOUCHSCREEN_USB_GOTOP=y
CONFIG_TOUCHSCREEN_USB_JASTEC=y
CONFIG_TOUCHSCREEN_USB_ELO=y
CONFIG_TOUCHSCREEN_USB_E2I=y
CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2004 is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_RM_TS is not set
# CONFIG_TOUCHSCREEN_SILEAD is not set
# CONFIG_TOUCHSCREEN_SIS_I2C is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_STMFTS is not set
CONFIG_TOUCHSCREEN_SUR40=y
# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set
# CONFIG_TOUCHSCREEN_SX8654 is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_TOUCHSCREEN_ZET6223 is not set
# CONFIG_TOUCHSCREEN_ZFORCE is not set
# CONFIG_TOUCHSCREEN_COLIBRI_VF50 is not set
# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set
# CONFIG_TOUCHSCREEN_IQS5XX is not set
# CONFIG_TOUCHSCREEN_IQS7211 is not set
# CONFIG_TOUCHSCREEN_ZINITIX is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX83112B is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
# CONFIG_INPUT_AW86927 is not set
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_E3X0_BUTTON is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_MMA8450 is not set
# CONFIG_INPUT_APANEL is not set
# CONFIG_INPUT_GPIO_BEEPER is not set
# CONFIG_INPUT_GPIO_DECODER is not set
# CONFIG_INPUT_GPIO_VIBRA is not set
# CONFIG_INPUT_ATLAS_BTNS is not set
CONFIG_INPUT_ATI_REMOTE2=y
CONFIG_INPUT_KEYSPAN_REMOTE=y
# CONFIG_INPUT_KXTJ9 is not set
CONFIG_INPUT_POWERMATE=y
CONFIG_INPUT_YEALINK=y
CONFIG_INPUT_CM109=y
# CONFIG_INPUT_REGULATOR_HAPTIC is not set
# CONFIG_INPUT_RETU_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_VIBRA is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA7280_HAPTICS is not set
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_IBM_PANEL is not set
CONFIG_INPUT_IMS_PCU=y
# CONFIG_INPUT_IQS269A is not set
# CONFIG_INPUT_IQS626A is not set
# CONFIG_INPUT_IQS7222 is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set
# CONFIG_INPUT_DRV260X_HAPTICS is not set
# CONFIG_INPUT_DRV2665_HAPTICS is not set
# CONFIG_INPUT_DRV2667_HAPTICS is not set
CONFIG_RMI4_CORE=y
# CONFIG_RMI4_I2C is not set
# CONFIG_RMI4_SPI is not set
# CONFIG_RMI4_SMB is not set
CONFIG_RMI4_F03=y
CONFIG_RMI4_F03_SERIO=y
CONFIG_RMI4_2D_SENSOR=y
CONFIG_RMI4_F11=y
CONFIG_RMI4_F12=y
# CONFIG_RMI4_F1A is not set
# CONFIG_RMI4_F21 is not set
CONFIG_RMI4_F30=y
# CONFIG_RMI4_F34 is not set
CONFIG_RMI4_F3A=y
# CONFIG_RMI4_F54 is not set
# CONFIG_RMI4_F55 is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_SERIO_APBPS2 is not set
# CONFIG_SERIO_GPIO_PS2 is not set
CONFIG_USERIO=y
# CONFIG_GAMEPORT is not set
# end of Hardware I/O ports
# end of Input device support

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_LEGACY_TIOCSTI=y
CONFIG_LDISC_AUTOLOAD=y

#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_PNP=y
# CONFIG_SERIAL_8250_16550A_VARIANTS is not set
# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCILIB=y
CONFIG_SERIAL_8250_PCI=y
# CONFIG_SERIAL_8250_EXAR is not set
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
# CONFIG_SERIAL_8250_PCI1XXXX is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_DWLIB=y
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_8250_PERICOM=y
# CONFIG_SERIAL_8250_NI is not set
# CONFIG_SERIAL_OF_PLATFORM is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_SIFIVE is not set
# CONFIG_SERIAL_LANTIQ is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_SERIAL_SPRD is not set
# end of Serial drivers

CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_MOXA_INTELLIO is not set
# CONFIG_MOXA_SMARTIO is not set
CONFIG_N_HDLC=y
# CONFIG_IPWIRELESS is not set
CONFIG_N_GSM=y
CONFIG_NOZOMI=y
CONFIG_NULL_TTY=y
CONFIG_HVC_DRIVER=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_TTY_PRINTK_LEVEL=6
# CONFIG_PRINTER is not set
# CONFIG_PPDEV is not set
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
# CONFIG_SSIF_IPMI_BMC is not set
# CONFIG_IPMB_DEVICE_INTERFACE is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_BA431 is not set
# CONFIG_HW_RANDOM_VIA is not set
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_HW_RANDOM_CCTRNG is not set
# CONFIG_HW_RANDOM_XIPHERA is not set
# CONFIG_APPLICOM is not set
# CONFIG_MWAVE is not set
# CONFIG_DEVMEM is not set
CONFIG_NVRAM=y
# CONFIG_DEVPORT is not set
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TPM2_HMAC is not set
# CONFIG_HW_RANDOM_TPM is not set
CONFIG_TCG_TIS_CORE=y
CONFIG_TCG_TIS=y
# CONFIG_TCG_TIS_SPI is not set
# CONFIG_TCG_TIS_I2C is not set
# CONFIG_TCG_TIS_I2C_CR50 is not set
# CONFIG_TCG_TIS_I2C_ATMEL is not set
# CONFIG_TCG_TIS_I2C_INFINEON is not set
# CONFIG_TCG_TIS_I2C_NUVOTON is not set
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
CONFIG_TCG_CRB=y
# CONFIG_TCG_VTPM_PROXY is not set
# CONFIG_TCG_TIS_ST33ZP24_I2C is not set
# CONFIG_TCG_TIS_ST33ZP24_SPI is not set
# CONFIG_TELCLOCK is not set
CONFIG_XILLYBUS_CLASS=y
# CONFIG_XILLYBUS is not set
CONFIG_XILLYUSB=y
# end of Character devices

#
# I2C support
#
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y

#
# Multiplexer I2C Chip support
#
# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set
# CONFIG_I2C_MUX_GPIO is not set
# CONFIG_I2C_MUX_GPMUX is not set
# CONFIG_I2C_MUX_LTC4306 is not set
# CONFIG_I2C_MUX_PCA9541 is not set
# CONFIG_I2C_MUX_PCA954x is not set
CONFIG_I2C_MUX_REG=y
# CONFIG_I2C_MUX_MLXCPLD is not set
# end of Multiplexer I2C Chip support

CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=y
CONFIG_I2C_ALGOBIT=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_AMD_MP2 is not set
CONFIG_I2C_I801=y
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_ISMT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_CHT_WC is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_NVIDIA_GPU is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_ZHAOXIN is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_CBUS_GPIO is not set
CONFIG_I2C_DESIGNWARE_CORE=y
# CONFIG_I2C_DESIGNWARE_SLAVE is not set
CONFIG_I2C_DESIGNWARE_PLATFORM=y
# CONFIG_I2C_DESIGNWARE_BAYTRAIL is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_RK3X is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_DIOLAN_U2C=y
CONFIG_I2C_DLN2=y
CONFIG_I2C_LJCA=y
CONFIG_I2C_CP2615=y
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PCI1XXXX is not set
CONFIG_I2C_ROBOTFUZZ_OSIF=y
# CONFIG_I2C_TAOS_EVM is not set
CONFIG_I2C_TINY_USB=y
CONFIG_I2C_VIPERBOARD=y

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_MLXCPLD is not set
# CONFIG_I2C_VIRTIO is not set
# end of I2C Hardware Bus support

# CONFIG_I2C_STUB is not set
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_EEPROM=y
# CONFIG_I2C_SLAVE_TESTUNIT is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# end of I2C support

# CONFIG_I3C is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_MEM is not set

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_CADENCE_QUADSPI is not set
# CONFIG_SPI_CH341 is not set
# CONFIG_SPI_DESIGNWARE is not set
CONFIG_SPI_DLN2=y
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_FSL_SPI is not set
CONFIG_SPI_LJCA=y
# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
# CONFIG_SPI_MICROCHIP_CORE_SPI is not set
# CONFIG_SPI_LANTIQ_SSC is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PCI1XXXX is not set
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_MXIC is not set
# CONFIG_SPI_VIRTIO is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set

#
# SPI Multiplexer support
#
# CONFIG_SPI_MUX is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_LOOPBACK_TEST is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPI_SLAVE is not set
CONFIG_SPI_DYNAMIC=y
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_PARPORT is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# CONFIG_PPS_GENERATOR is not set

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_PTP_1588_CLOCK_KVM=y
CONFIG_PTP_1588_CLOCK_VMCLOCK=y
# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set
# CONFIG_PTP_1588_CLOCK_IDTCM is not set
# CONFIG_PTP_1588_CLOCK_FC3W is not set
# CONFIG_PTP_1588_CLOCK_MOCK is not set
# CONFIG_PTP_1588_CLOCK_VMW is not set
# CONFIG_PTP_1588_CLOCK_OCP is not set
# CONFIG_PTP_NETC_V4_TIMER is not set
# end of PTP clock support

#
# DPLL device support
#
# CONFIG_ZL3073X_I2C is not set
# CONFIG_ZL3073X_SPI is not set
# end of DPLL device support

# CONFIG_PINCTRL is not set
CONFIG_GPIOLIB_LEGACY=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_OF_GPIO=y
CONFIG_GPIO_ACPI=y
CONFIG_GPIOLIB_IRQCHIP=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
# CONFIG_GPIO_CDEV is not set

#
# Memory mapped GPIO drivers
#
# CONFIG_GPIO_74XX_MMIO is not set
# CONFIG_GPIO_ALTERA is not set
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_CADENCE is not set
# CONFIG_GPIO_DWAPB is not set
# CONFIG_GPIO_FTGPIO010 is not set
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_GRANITERAPIDS is not set
# CONFIG_GPIO_GRGPIO is not set
# CONFIG_GPIO_HLWD is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_LOGICVC is not set
# CONFIG_GPIO_MB86S7X is not set
# CONFIG_GPIO_POLARFIRE_SOC is not set
# CONFIG_GPIO_SIFIVE is not set
# CONFIG_GPIO_SYSCON is not set
# CONFIG_GPIO_XILINX is not set
# CONFIG_GPIO_AMD_FCH is not set
# end of Memory mapped GPIO drivers

#
# Port-mapped I/O GPIO drivers
#
# CONFIG_GPIO_VX855 is not set
# CONFIG_GPIO_F7188X is not set
# CONFIG_GPIO_IT87 is not set
# CONFIG_GPIO_SCH311X is not set
# CONFIG_GPIO_WINBOND is not set
# CONFIG_GPIO_WS16C48 is not set
# end of Port-mapped I/O GPIO drivers

#
# I2C GPIO expanders
#
# CONFIG_GPIO_ADNP is not set
# CONFIG_GPIO_FXL6408 is not set
# CONFIG_GPIO_DS4520 is not set
# CONFIG_GPIO_GW_PLD is not set
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCA9570 is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_TPIC2810 is not set
# end of I2C GPIO expanders

#
# MFD GPIO expanders
#
CONFIG_GPIO_DLN2=y
CONFIG_GPIO_LJCA=y
# CONFIG_GPIO_TWL4030 is not set
# CONFIG_GPIO_WHISKEY_COVE is not set
# end of MFD GPIO expanders

#
# PCI GPIO expanders
#
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_PCI_IDIO_16 is not set
# CONFIG_GPIO_PCIE_IDIO_24 is not set
# CONFIG_GPIO_RDC321X is not set
# CONFIG_GPIO_SODAVILLE is not set
# end of PCI GPIO expanders

#
# SPI GPIO expanders
#
# CONFIG_GPIO_74X164 is not set
# CONFIG_GPIO_MAX3191X is not set
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_PISOSR is not set
# CONFIG_GPIO_XRA1403 is not set
# end of SPI GPIO expanders

#
# USB GPIO expanders
#
CONFIG_GPIO_VIPERBOARD=y
# CONFIG_GPIO_MPSSE is not set
# end of USB GPIO expanders

#
# Virtual GPIO drivers
#
# CONFIG_GPIO_AGGREGATOR is not set
# CONFIG_GPIO_LATCH is not set
# CONFIG_GPIO_MOCKUP is not set
# CONFIG_GPIO_VIRTIO is not set
# CONFIG_GPIO_SIM is not set
# end of Virtual GPIO drivers

#
# GPIO Debugging utilities
#
# CONFIG_GPIO_SLOPPY_LOGIC_ANALYZER is not set
# CONFIG_GPIO_VIRTUSER is not set
# end of GPIO Debugging utilities

# CONFIG_W1 is not set
# CONFIG_POWER_RESET is not set
# CONFIG_POWER_SEQUENCING is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_POWER_SUPPLY_HWMON=y
# CONFIG_GENERIC_ADC_BATTERY is not set
# CONFIG_IP5XXX_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_CHARGER_ADP5061 is not set
# CONFIG_BATTERY_CHAGALL is not set
# CONFIG_BATTERY_CW2015 is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SAMSUNG_SDI is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_CHARGER_SBS is not set
# CONFIG_MANAGER_SBS is not set
# CONFIG_BATTERY_BQ27XXX is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_BATTERY_MAX1720X is not set
CONFIG_CHARGER_ISP1704=y
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_TWL4030 is not set
# CONFIG_CHARGER_TWL6030 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
# CONFIG_CHARGER_MANAGER is not set
# CONFIG_CHARGER_LT3651 is not set
# CONFIG_CHARGER_LTC4162L is not set
# CONFIG_CHARGER_DETECTOR_MAX14656 is not set
# CONFIG_CHARGER_MAX77976 is not set
# CONFIG_CHARGER_MAX8971 is not set
# CONFIG_CHARGER_MT6360 is not set
# CONFIG_CHARGER_MT6370 is not set
# CONFIG_CHARGER_BQ2415X is not set
CONFIG_CHARGER_BQ24190=y
# CONFIG_CHARGER_BQ24257 is not set
# CONFIG_CHARGER_BQ24735 is not set
# CONFIG_CHARGER_BQ2515X is not set
# CONFIG_CHARGER_BQ25890 is not set
# CONFIG_CHARGER_BQ25980 is not set
# CONFIG_CHARGER_BQ256XX is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_BATTERY_RT5033 is not set
# CONFIG_CHARGER_RT9455 is not set
# CONFIG_CHARGER_RT9467 is not set
# CONFIG_CHARGER_RT9471 is not set
# CONFIG_CHARGER_RT9756 is not set
# CONFIG_FUEL_GAUGE_STC3117 is not set
# CONFIG_CHARGER_UCS1002 is not set
# CONFIG_CHARGER_BD99954 is not set
# CONFIG_BATTERY_SURFACE is not set
# CONFIG_CHARGER_SURFACE is not set
# CONFIG_BATTERY_UG3105 is not set
# CONFIG_FUEL_GAUGE_MM8013 is not set
CONFIG_HWMON=y
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM1177 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7310 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_AHT10 is not set
CONFIG_SENSORS_AQUACOMPUTER_D5NEXT=y
# CONFIG_SENSORS_AS370 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set
# CONFIG_SENSORS_AXI_FAN_CONTROL is not set
# CONFIG_SENSORS_K8TEMP is not set
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_APPLESMC is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_CHIPCAP2 is not set
CONFIG_SENSORS_CORSAIR_CPRO=y
CONFIG_SENSORS_CORSAIR_PSU=y
# CONFIG_SENSORS_DRIVETEMP is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_DELL_SMM is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
# CONFIG_SENSORS_FTSTEUTATES is not set
CONFIG_SENSORS_GIGABYTE_WATERFORCE=y
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_GPD is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
# CONFIG_SENSORS_HS3001 is not set
# CONFIG_SENSORS_HTU31 is not set
# CONFIG_SENSORS_IIO_HWMON is not set
# CONFIG_SENSORS_I5500 is not set
# CONFIG_SENSORS_CORETEMP is not set
# CONFIG_SENSORS_ISL28022 is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_JC42 is not set
CONFIG_SENSORS_POWERZ=y
# CONFIG_SENSORS_POWR1220 is not set
# CONFIG_SENSORS_LENOVO_EC is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LTC2945 is not set
# CONFIG_SENSORS_LTC2947_I2C is not set
# CONFIG_SENSORS_LTC2947_SPI is not set
# CONFIG_SENSORS_LTC2990 is not set
# CONFIG_SENSORS_LTC2991 is not set
# CONFIG_SENSORS_LTC2992 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4222 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4260 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_LTC4282 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX127 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX31722 is not set
# CONFIG_SENSORS_MAX31730 is not set
# CONFIG_SENSORS_MAX31760 is not set
# CONFIG_MAX31827 is not set
# CONFIG_SENSORS_MAX6620 is not set
# CONFIG_SENSORS_MAX6621 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MC34VR500 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_TC654 is not set
# CONFIG_SENSORS_TPS23861 is not set
# CONFIG_SENSORS_MR75203 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_NCT6683 is not set
# CONFIG_SENSORS_NCT6775 is not set
# CONFIG_SENSORS_NCT6775_I2C is not set
# CONFIG_SENSORS_NCT7363 is not set
# CONFIG_SENSORS_NCT7802 is not set
# CONFIG_SENSORS_NCT7904 is not set
# CONFIG_SENSORS_NPCM7XX is not set
CONFIG_SENSORS_NZXT_KRAKEN2=y
# CONFIG_SENSORS_NZXT_KRAKEN3 is not set
CONFIG_SENSORS_NZXT_SMART2=y
# CONFIG_SENSORS_OCC_P8_I2C is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_PT5161L is not set
# CONFIG_SENSORS_SBTSI is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SHT3x is not set
# CONFIG_SENSORS_SHT4x is not set
# CONFIG_SENSORS_SHTC1 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC2305 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH5627 is not set
# CONFIG_SENSORS_SCH5636 is not set
# CONFIG_SENSORS_STTS751 is not set
# CONFIG_SENSORS_SURFACE_FAN is not set
# CONFIG_SENSORS_SURFACE_TEMP is not set
# CONFIG_SENSORS_ADC128D818 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_INA238 is not set
# CONFIG_SENSORS_INA3221 is not set
# CONFIG_SENSORS_SPD5118 is not set
# CONFIG_SENSORS_TC74 is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP103 is not set
# CONFIG_SENSORS_TMP108 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_TMP464 is not set
# CONFIG_SENSORS_TMP513 is not set
# CONFIG_SENSORS_TSC1641 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83773G is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_XGENE is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
# CONFIG_SENSORS_ASUS_WMI is not set
# CONFIG_SENSORS_ASUS_EC is not set
# CONFIG_SENSORS_HP_WMI is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_NETLINK=y
# CONFIG_THERMAL_STATISTICS is not set
# CONFIG_THERMAL_DEBUGFS is not set
# CONFIG_THERMAL_CORE_TESTING is not set
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
CONFIG_THERMAL_HWMON=y
# CONFIG_THERMAL_OF is not set
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_THERMAL_GOV_USER_SPACE is not set
# CONFIG_PCIE_THERMAL is not set
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_THERMAL_MMIO is not set

#
# Intel thermal drivers
#
# CONFIG_INTEL_POWERCLAMP is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_X86_PKG_TEMP_THERMAL is not set
# CONFIG_INTEL_SOC_DTS_THERMAL is not set

#
# ACPI INT340X thermal drivers
#
# CONFIG_INT340X_THERMAL is not set
# end of ACPI INT340X thermal drivers

# CONFIG_INTEL_BXT_PMIC_THERMAL is not set
# CONFIG_INTEL_PCH_THERMAL is not set
# CONFIG_INTEL_TCC_COOLING is not set
# CONFIG_INTEL_HFI_THERMAL is not set
# end of Intel thermal drivers

# CONFIG_GENERIC_ADC_THERMAL is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_CORE is not set
# CONFIG_WATCHDOG_NOWAYOUT is not set
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
CONFIG_WATCHDOG_OPEN_TIMEOUT=0
# CONFIG_WATCHDOG_SYSFS is not set
# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set

#
# Watchdog Pretimeout Governors
#

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_LENOVO_SE10_WDT is not set
# CONFIG_LENOVO_SE30_WDT is not set
# CONFIG_WDAT_WDT is not set
# CONFIG_XILINX_WATCHDOG is not set
# CONFIG_ZIIRAVE_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set
# CONFIG_DW_WATCHDOG is not set
# CONFIG_TWL4030_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_RETU_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
# CONFIG_ADVANTECH_EC_WDT is not set
# CONFIG_ALIM1535_WDT is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_EBC_C384_WDT is not set
# CONFIG_EXAR_WDT is not set
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SBC_FITPC2_WATCHDOG is not set
# CONFIG_EUROTECH_WDT is not set
# CONFIG_IB700_WDT is not set
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IE6XX_WDT is not set
# CONFIG_INTEL_OC_WATCHDOG is not set
# CONFIG_ITCO_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_IT87_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
# CONFIG_TQMX86_WDT is not set
# CONFIG_VIA_WDT is not set
# CONFIG_W83627HF_WDT is not set
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_MACHZ_WDT is not set
# CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_INTEL_MEI_WDT is not set
# CONFIG_NI903X_WDT is not set
# CONFIG_NIC7018_WDT is not set
# CONFIG_MEN_A21_WDT is not set

#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
CONFIG_USBPCWATCHDOG=y
CONFIG_SSB_POSSIBLE=y
CONFIG_SSB=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
# CONFIG_SSB_PCIHOST is not set
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
# CONFIG_SSB_DRIVER_GPIO is not set
CONFIG_BCMA_POSSIBLE=y
CONFIG_BCMA=y
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
# CONFIG_BCMA_HOST_PCI is not set
# CONFIG_BCMA_HOST_SOC is not set
# CONFIG_BCMA_DRIVER_PCI is not set
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DRIVER_GPIO is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ADP5585 is not set
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_SMPRO is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_AAT2870_CORE is not set
# CONFIG_MFD_ATMEL_FLEXCOM is not set
# CONFIG_MFD_ATMEL_HLCDC is not set
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_BD9571MWV is not set
# CONFIG_MFD_AXP20X_I2C is not set
# CONFIG_MFD_CGBC is not set
# CONFIG_MFD_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
# CONFIG_MFD_CS42L43_I2C is not set
# CONFIG_MFD_CS42L43_SDW is not set
# CONFIG_MFD_LOCHNAGAR is not set
# CONFIG_MFD_MADERA is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
CONFIG_MFD_DLN2=y
# CONFIG_MFD_GATEWORKS_GSC is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_MFD_MP2629 is not set
# CONFIG_MFD_PF1550 is not set
# CONFIG_MFD_HI6421_PMIC is not set
# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set
CONFIG_LPC_ICH=y
# CONFIG_LPC_SCH is not set
# CONFIG_INTEL_SOC_PMIC is not set
CONFIG_INTEL_SOC_PMIC_BXTWC=y
CONFIG_INTEL_SOC_PMIC_CHTWC=y
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
# CONFIG_MFD_INTEL_LPSS_ACPI is not set
# CONFIG_MFD_INTEL_LPSS_PCI is not set
CONFIG_MFD_INTEL_PMC_BXT=y
# CONFIG_MFD_IQS62X is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_88PM886_PMIC is not set
# CONFIG_MFD_MAX5970 is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77541 is not set
# CONFIG_MFD_MAX77620 is not set
# CONFIG_MFD_MAX77650 is not set
# CONFIG_MFD_MAX77686 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX77705 is not set
# CONFIG_MFD_MAX77714 is not set
# CONFIG_MFD_MAX77759 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
CONFIG_MFD_MT6360=y
CONFIG_MFD_MT6370=y
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_MFD_NCT6694 is not set
# CONFIG_MFD_OCELOT is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_CPCAP is not set
CONFIG_MFD_VIPERBOARD=y
# CONFIG_MFD_NTXEC is not set
CONFIG_MFD_RETU=y
# CONFIG_MFD_SY7636A is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RT4831 is not set
# CONFIG_MFD_RT5033 is not set
# CONFIG_MFD_RT5120 is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_RK8XX_I2C is not set
# CONFIG_MFD_RK8XX_SPI is not set
# CONFIG_MFD_RN5T618 is not set
# CONFIG_MFD_SEC_I2C is not set
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_STMPE is not set
CONFIG_MFD_SYSCON=y
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_TI_LMU is not set
# CONFIG_MFD_BQ257XX is not set
# CONFIG_MFD_PALMAS is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65086 is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TI_LP873X is not set
# CONFIG_MFD_TI_LP87565 is not set
# CONFIG_MFD_TPS65218 is not set
# CONFIG_MFD_TPS65219 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS65910 is not set
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TPS6594_I2C is not set
# CONFIG_MFD_TPS6594_SPI is not set
CONFIG_TWL4030_CORE=y
# CONFIG_MFD_TWL4030_AUDIO is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM831X_SPI is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
# CONFIG_MFD_ROHM_BD718XX is not set
# CONFIG_MFD_ROHM_BD71828 is not set
# CONFIG_MFD_ROHM_BD957XMUF is not set
# CONFIG_MFD_ROHM_BD96801 is not set
# CONFIG_MFD_STPMIC1 is not set
# CONFIG_MFD_STMFX is not set
# CONFIG_MFD_ATC260X_I2C is not set
# CONFIG_MFD_QCOM_PM8008 is not set
# CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_INTEL_M10_BMC_SPI is not set
# CONFIG_MFD_QNAP_MCU is not set
# CONFIG_MFD_RSMU_I2C is not set
# CONFIG_MFD_RSMU_SPI is not set
# CONFIG_MFD_UPBOARD_FPGA is not set
# CONFIG_MFD_MAX7360 is not set
# end of Multifunction device drivers

CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_NETLINK_EVENTS is not set
# CONFIG_REGULATOR_88PG86X is not set
# CONFIG_REGULATOR_ACT8865 is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ADP5055 is not set
# CONFIG_REGULATOR_AW37503 is not set
# CONFIG_REGULATOR_DA9121 is not set
# CONFIG_REGULATOR_DA9210 is not set
# CONFIG_REGULATOR_DA9211 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_FAN53880 is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A is not set
# CONFIG_REGULATOR_FP9931 is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_LP872X is not set
# CONFIG_REGULATOR_LP8755 is not set
# CONFIG_REGULATOR_LTC3589 is not set
# CONFIG_REGULATOR_LTC3676 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX77503 is not set
# CONFIG_REGULATOR_MAX77857 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8893 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX20086 is not set
# CONFIG_REGULATOR_MAX20411 is not set
# CONFIG_REGULATOR_MAX77826 is not set
# CONFIG_REGULATOR_MAX77838 is not set
# CONFIG_REGULATOR_MCP16502 is not set
# CONFIG_REGULATOR_MP5416 is not set
# CONFIG_REGULATOR_MP8859 is not set
# CONFIG_REGULATOR_MP886X is not set
# CONFIG_REGULATOR_MPQ7920 is not set
# CONFIG_REGULATOR_MT6311 is not set
# CONFIG_REGULATOR_MT6360 is not set
# CONFIG_REGULATOR_MT6370 is not set
# CONFIG_REGULATOR_PCA9450 is not set
# CONFIG_REGULATOR_PF9453 is not set
# CONFIG_REGULATOR_PF0900 is not set
# CONFIG_REGULATOR_PF530X is not set
# CONFIG_REGULATOR_PF8X00 is not set
# CONFIG_REGULATOR_PFUZE100 is not set
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88080 is not set
# CONFIG_REGULATOR_PV88090 is not set
# CONFIG_REGULATOR_RAA215300 is not set
# CONFIG_REGULATOR_RT4801 is not set
# CONFIG_REGULATOR_RT4803 is not set
# CONFIG_REGULATOR_RT5133 is not set
# CONFIG_REGULATOR_RT5190A is not set
# CONFIG_REGULATOR_RT5739 is not set
# CONFIG_REGULATOR_RT5759 is not set
# CONFIG_REGULATOR_RT6160 is not set
# CONFIG_REGULATOR_RT6190 is not set
# CONFIG_REGULATOR_RT6245 is not set
# CONFIG_REGULATOR_RTQ2134 is not set
# CONFIG_REGULATOR_RTMV20 is not set
# CONFIG_REGULATOR_RTQ6752 is not set
# CONFIG_REGULATOR_RTQ2208 is not set
# CONFIG_REGULATOR_SLG51000 is not set
# CONFIG_REGULATOR_SY8106A is not set
# CONFIG_REGULATOR_SY8824X is not set
# CONFIG_REGULATOR_SY8827N is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS6286X is not set
# CONFIG_REGULATOR_TPS6287X is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS65132 is not set
# CONFIG_REGULATOR_TPS6524X is not set
CONFIG_REGULATOR_TWL4030=y
# CONFIG_REGULATOR_VCTRL is not set
CONFIG_RC_CORE=y
# CONFIG_LIRC is not set
# CONFIG_RC_MAP is not set
# CONFIG_RC_DECODERS is not set
CONFIG_RC_DEVICES=y
# CONFIG_IR_ENE is not set
# CONFIG_IR_FINTEK is not set
# CONFIG_IR_GPIO_CIR is not set
# CONFIG_IR_HIX5HD2 is not set
CONFIG_IR_IGORPLUGUSB=y
CONFIG_IR_IGUANA=y
CONFIG_IR_IMON=y
CONFIG_IR_IMON_RAW=y
# CONFIG_IR_ITE_CIR is not set
CONFIG_IR_MCEUSB=y
# CONFIG_IR_NUVOTON is not set
CONFIG_IR_REDRAT3=y
# CONFIG_IR_SERIAL is not set
CONFIG_IR_STREAMZAP=y
CONFIG_IR_TOY=y
CONFIG_IR_TTUSBIR=y
# CONFIG_IR_WINBOND_CIR is not set
CONFIG_RC_ATI_REMOTE=y
# CONFIG_RC_LOOPBACK is not set
CONFIG_RC_XBOX_DVD=y
CONFIG_CEC_CORE=y

#
# CEC support
#
# CONFIG_MEDIA_CEC_RC is not set
CONFIG_MEDIA_CEC_SUPPORT=y
# CONFIG_CEC_CH7322 is not set
# CONFIG_CEC_NXP_TDA9950 is not set
# CONFIG_CEC_GPIO is not set
# CONFIG_CEC_SECO is not set
# CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC is not set
CONFIG_USB_PULSE8_CEC=y
CONFIG_USB_RAINSHADOW_CEC=y
# end of CEC support

CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_SUPPORT_FILTER=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set

#
# Media device types
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_SDR_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
CONFIG_MEDIA_TEST_SUPPORT=y
# end of Media device types

CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_DVB_CORE=y

#
# Video4Linux options
#
CONFIG_VIDEO_V4L2_I2C=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=y
CONFIG_V4L2_MEM2MEM_DEV=y
# end of Video4Linux options

#
# Media controller options
#
CONFIG_MEDIA_CONTROLLER_DVB=y
# end of Media controller options

#
# Digital TV options
#
# CONFIG_DVB_MMAP is not set
# CONFIG_DVB_NET is not set
CONFIG_DVB_MAX_ADAPTERS=16
# CONFIG_DVB_DYNAMIC_MINORS is not set
# CONFIG_DVB_DEMUX_SECTION_LOSS_LOG is not set
# CONFIG_DVB_ULE_DEBUG is not set
# end of Digital TV options

#
# Media drivers
#

#
# Drivers filtered as selected at 'Filter media drivers'
#

#
# Media drivers
#
CONFIG_MEDIA_USB_SUPPORT=y

#
# Webcam devices
#
CONFIG_USB_GSPCA=y
CONFIG_USB_GSPCA_BENQ=y
CONFIG_USB_GSPCA_CONEX=y
CONFIG_USB_GSPCA_CPIA1=y
CONFIG_USB_GSPCA_DTCS033=y
CONFIG_USB_GSPCA_ETOMS=y
CONFIG_USB_GSPCA_FINEPIX=y
CONFIG_USB_GSPCA_JEILINJ=y
CONFIG_USB_GSPCA_JL2005BCD=y
CONFIG_USB_GSPCA_KINECT=y
CONFIG_USB_GSPCA_KONICA=y
CONFIG_USB_GSPCA_MARS=y
CONFIG_USB_GSPCA_MR97310A=y
CONFIG_USB_GSPCA_NW80X=y
CONFIG_USB_GSPCA_OV519=y
CONFIG_USB_GSPCA_OV534=y
CONFIG_USB_GSPCA_OV534_9=y
CONFIG_USB_GSPCA_PAC207=y
CONFIG_USB_GSPCA_PAC7302=y
CONFIG_USB_GSPCA_PAC7311=y
CONFIG_USB_GSPCA_SE401=y
CONFIG_USB_GSPCA_SN9C2028=y
CONFIG_USB_GSPCA_SN9C20X=y
CONFIG_USB_GSPCA_SONIXB=y
CONFIG_USB_GSPCA_SONIXJ=y
CONFIG_USB_GSPCA_SPCA1528=y
CONFIG_USB_GSPCA_SPCA500=y
CONFIG_USB_GSPCA_SPCA501=y
CONFIG_USB_GSPCA_SPCA505=y
CONFIG_USB_GSPCA_SPCA506=y
CONFIG_USB_GSPCA_SPCA508=y
CONFIG_USB_GSPCA_SPCA561=y
CONFIG_USB_GSPCA_SQ905=y
CONFIG_USB_GSPCA_SQ905C=y
CONFIG_USB_GSPCA_SQ930X=y
CONFIG_USB_GSPCA_STK014=y
CONFIG_USB_GSPCA_STK1135=y
CONFIG_USB_GSPCA_STV0680=y
CONFIG_USB_GSPCA_SUNPLUS=y
CONFIG_USB_GSPCA_T613=y
CONFIG_USB_GSPCA_TOPRO=y
CONFIG_USB_GSPCA_TOUPTEK=y
CONFIG_USB_GSPCA_TV8532=y
CONFIG_USB_GSPCA_VC032X=y
CONFIG_USB_GSPCA_VICAM=y
CONFIG_USB_GSPCA_XIRLINK_CIT=y
CONFIG_USB_GSPCA_ZC3XX=y
CONFIG_USB_GL860=y
CONFIG_USB_M5602=y
CONFIG_USB_STV06XX=y
CONFIG_USB_PWC=y
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_S2255=y
CONFIG_VIDEO_USBTV=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

#
# Analog TV USB devices
#
CONFIG_VIDEO_GO7007=y
CONFIG_VIDEO_GO7007_USB=y
CONFIG_VIDEO_GO7007_LOADER=y
CONFIG_VIDEO_GO7007_USB_S2250_BOARD=y
CONFIG_VIDEO_HDPVR=y
CONFIG_VIDEO_PVRUSB2=y
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_STK1160=y

#
# Analog/digital TV USB devices
#
CONFIG_VIDEO_AU0828=y
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_AU0828_RC=y
CONFIG_VIDEO_CX231XX=y
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=y
CONFIG_VIDEO_CX231XX_DVB=y

#
# Digital TV USB devices
#
CONFIG_DVB_AS102=y
CONFIG_DVB_B2C2_FLEXCOP_USB=y
# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set
CONFIG_DVB_USB_V2=y
CONFIG_DVB_USB_AF9015=y
CONFIG_DVB_USB_AF9035=y
CONFIG_DVB_USB_ANYSEE=y
CONFIG_DVB_USB_AU6610=y
CONFIG_DVB_USB_AZ6007=y
CONFIG_DVB_USB_CE6230=y
CONFIG_DVB_USB_DVBSKY=y
CONFIG_DVB_USB_EC168=y
CONFIG_DVB_USB_GL861=y
CONFIG_DVB_USB_LME2510=y
CONFIG_DVB_USB_MXL111SF=y
CONFIG_DVB_USB_RTL28XXU=y
CONFIG_DVB_USB_ZD1301=y
CONFIG_DVB_USB=y
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=y
CONFIG_DVB_USB_AF9005=y
CONFIG_DVB_USB_AF9005_REMOTE=y
CONFIG_DVB_USB_AZ6027=y
CONFIG_DVB_USB_CINERGY_T2=y
CONFIG_DVB_USB_CXUSB=y
CONFIG_DVB_USB_CXUSB_ANALOG=y
CONFIG_DVB_USB_DIB0700=y
CONFIG_DVB_USB_DIB3000MC=y
CONFIG_DVB_USB_DIBUSB_MB=y
# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
CONFIG_DVB_USB_DIBUSB_MC=y
CONFIG_DVB_USB_DIGITV=y
CONFIG_DVB_USB_DTT200U=y
CONFIG_DVB_USB_DTV5100=y
CONFIG_DVB_USB_DW2102=y
CONFIG_DVB_USB_GP8PSK=y
CONFIG_DVB_USB_M920X=y
CONFIG_DVB_USB_NOVA_T_USB2=y
CONFIG_DVB_USB_OPERA1=y
CONFIG_DVB_USB_PCTV452E=y
CONFIG_DVB_USB_TECHNISAT_USB2=y
CONFIG_DVB_USB_TTUSB2=y
CONFIG_DVB_USB_UMT_010=y
CONFIG_DVB_USB_VP702X=y
CONFIG_DVB_USB_VP7045=y
CONFIG_SMS_USB_DRV=y
CONFIG_DVB_TTUSB_BUDGET=y
CONFIG_DVB_TTUSB_DEC=y

#
# Webcam, TV (analog/digital) USB devices
#
CONFIG_VIDEO_EM28XX=y
CONFIG_VIDEO_EM28XX_V4L2=y
CONFIG_VIDEO_EM28XX_ALSA=y
CONFIG_VIDEO_EM28XX_DVB=y
CONFIG_VIDEO_EM28XX_RC=y

#
# Software defined radio USB devices
#
CONFIG_USB_AIRSPY=y
CONFIG_USB_HACKRF=y
CONFIG_USB_MSI2500=y
# CONFIG_MEDIA_PCI_SUPPORT is not set
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SAA7706H is not set
CONFIG_RADIO_SHARK=y
CONFIG_RADIO_SHARK2=y
CONFIG_RADIO_SI4713=y
CONFIG_RADIO_TEA575X=y
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_TEF6862 is not set
CONFIG_USB_DSBR=y
CONFIG_USB_KEENE=y
CONFIG_USB_MA901=y
CONFIG_USB_MR800=y
CONFIG_USB_RAREMONO=y
CONFIG_RADIO_SI470X=y
CONFIG_USB_SI470X=y
# CONFIG_I2C_SI470X is not set
CONFIG_USB_SI4713=y
# CONFIG_PLATFORM_SI4713 is not set
CONFIG_I2C_SI4713=y
# CONFIG_MEDIA_PLATFORM_DRIVERS is not set

#
# MMC/SDIO DVB adapters
#
CONFIG_SMS_SDIO_DRV=y
CONFIG_V4L_TEST_DRIVERS=y
CONFIG_VIDEO_VIM2M=y
CONFIG_VIDEO_VICODEC=y
CONFIG_VIDEO_VIMC=y
CONFIG_VIDEO_VIVID=y
CONFIG_VIDEO_VIVID_CEC=y
# CONFIG_VIDEO_VIVID_OSD is not set
CONFIG_VIDEO_VIVID_MAX_DEVS=64
# CONFIG_VIDEO_VISL is not set
CONFIG_DVB_TEST_DRIVERS=y
CONFIG_DVB_VIDTV=y

#
# FireWire (IEEE 1394) Adapters
#
# CONFIG_DVB_FIREDTV is not set
CONFIG_MEDIA_COMMON_OPTIONS=y

#
# common driver options
#
CONFIG_CYPRESS_FIRMWARE=y
CONFIG_TTPCI_EEPROM=y
CONFIG_UVC_COMMON=y
CONFIG_VIDEO_CX2341X=y
CONFIG_VIDEO_TVEEPROM=y
CONFIG_DVB_B2C2_FLEXCOP=y
CONFIG_SMS_SIANO_MDTV=y
CONFIG_SMS_SIANO_RC=y
CONFIG_SMS_SIANO_DEBUGFS=y
CONFIG_VIDEO_V4L2_TPG=y
CONFIG_VIDEOBUF2_CORE=y
CONFIG_VIDEOBUF2_V4L2=y
CONFIG_VIDEOBUF2_MEMOPS=y
CONFIG_VIDEOBUF2_DMA_CONTIG=y
CONFIG_VIDEOBUF2_VMALLOC=y
CONFIG_VIDEOBUF2_DMA_SG=y
# end of Media drivers

#
# Media ancillary drivers
#
CONFIG_MEDIA_ATTACH=y
# CONFIG_VIDEO_IR_I2C is not set
# CONFIG_VIDEO_CAMERA_SENSOR is not set

#
# Camera ISPs
#
# CONFIG_VIDEO_THP7312 is not set
# end of Camera ISPs

# CONFIG_VIDEO_CAMERA_LENS is not set

#
# Flash devices
#
# CONFIG_VIDEO_ADP1653 is not set
# CONFIG_VIDEO_LM3560 is not set
# CONFIG_VIDEO_LM3646 is not set
# end of Flash devices

#
# Audio decoders, processors and mixers
#
# CONFIG_VIDEO_CS3308 is not set
# CONFIG_VIDEO_CS5345 is not set
CONFIG_VIDEO_CS53L32A=y
CONFIG_VIDEO_MSP3400=y
# CONFIG_VIDEO_SONY_BTF_MPX is not set
# CONFIG_VIDEO_TDA1997X is not set
# CONFIG_VIDEO_TDA7432 is not set
# CONFIG_VIDEO_TDA9840 is not set
# CONFIG_VIDEO_TEA6415C is not set
# CONFIG_VIDEO_TEA6420 is not set
# CONFIG_VIDEO_TLV320AIC23B is not set
# CONFIG_VIDEO_TVAUDIO is not set
# CONFIG_VIDEO_UDA1342 is not set
# CONFIG_VIDEO_VP27SMPX is not set
# CONFIG_VIDEO_WM8739 is not set
CONFIG_VIDEO_WM8775=y
# end of Audio decoders, processors and mixers

#
# RDS decoders
#
# CONFIG_VIDEO_SAA6588 is not set
# end of RDS decoders

#
# Video decoders
#
# CONFIG_VIDEO_ADV7180 is not set
# CONFIG_VIDEO_ADV7183 is not set
# CONFIG_VIDEO_ADV748X is not set
# CONFIG_VIDEO_ADV7604 is not set
# CONFIG_VIDEO_ADV7842 is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_ISL7998X is not set
# CONFIG_VIDEO_LT6911UXE is not set
# CONFIG_VIDEO_KS0127 is not set
# CONFIG_VIDEO_MAX9286 is not set
# CONFIG_VIDEO_ML86V7667 is not set
# CONFIG_VIDEO_SAA7110 is not set
CONFIG_VIDEO_SAA711X=y
# CONFIG_VIDEO_TC358743 is not set
# CONFIG_VIDEO_TC358746 is not set
# CONFIG_VIDEO_TVP514X is not set
# CONFIG_VIDEO_TVP5150 is not set
# CONFIG_VIDEO_TVP7002 is not set
# CONFIG_VIDEO_TW2804 is not set
# CONFIG_VIDEO_TW9900 is not set
# CONFIG_VIDEO_TW9903 is not set
# CONFIG_VIDEO_TW9906 is not set
# CONFIG_VIDEO_TW9910 is not set
# CONFIG_VIDEO_VPX3220 is not set

#
# Video and audio decoders
#
# CONFIG_VIDEO_SAA717X is not set
CONFIG_VIDEO_CX25840=y
# end of Video decoders

#
# Video encoders
#
# CONFIG_VIDEO_ADV7170 is not set
# CONFIG_VIDEO_ADV7175 is not set
# CONFIG_VIDEO_ADV7343 is not set
# CONFIG_VIDEO_ADV7393 is not set
# CONFIG_VIDEO_ADV7511 is not set
# CONFIG_VIDEO_AK881X is not set
# CONFIG_VIDEO_SAA7127 is not set
# CONFIG_VIDEO_SAA7185 is not set
# CONFIG_VIDEO_THS8200 is not set
# end of Video encoders

#
# Video improvement chips
#
# CONFIG_VIDEO_UPD64031A is not set
# CONFIG_VIDEO_UPD64083 is not set
# end of Video improvement chips

#
# Audio/Video compression chips
#
# CONFIG_VIDEO_SAA6752HS is not set
# end of Audio/Video compression chips

#
# SDR tuner chips
#
# CONFIG_SDR_MAX2175 is not set
# end of SDR tuner chips

#
# Miscellaneous helper chips
#
# CONFIG_VIDEO_I2C is not set
# CONFIG_VIDEO_M52790 is not set
# CONFIG_VIDEO_ST_MIPID02 is not set
# CONFIG_VIDEO_THS7303 is not set
# end of Miscellaneous helper chips

#
# Video serializers and deserializers
#
# CONFIG_VIDEO_DS90UB913 is not set
# CONFIG_VIDEO_DS90UB953 is not set
# CONFIG_VIDEO_DS90UB960 is not set
# CONFIG_VIDEO_MAX96714 is not set
# CONFIG_VIDEO_MAX96717 is not set
# end of Video serializers and deserializers

#
# Media SPI Adapters
#
# CONFIG_CXD2880_SPI_DRV is not set
# CONFIG_VIDEO_GS1662 is not set
# end of Media SPI Adapters

CONFIG_MEDIA_TUNER=y

#
# Customize TV tuners
#
# CONFIG_MEDIA_TUNER_E4000 is not set
# CONFIG_MEDIA_TUNER_FC0011 is not set
# CONFIG_MEDIA_TUNER_FC0012 is not set
# CONFIG_MEDIA_TUNER_FC0013 is not set
# CONFIG_MEDIA_TUNER_FC2580 is not set
# CONFIG_MEDIA_TUNER_IT913X is not set
# CONFIG_MEDIA_TUNER_M88RS6000T is not set
# CONFIG_MEDIA_TUNER_MAX2165 is not set
# CONFIG_MEDIA_TUNER_MC44S803 is not set
CONFIG_MEDIA_TUNER_MSI001=y
# CONFIG_MEDIA_TUNER_MT2060 is not set
# CONFIG_MEDIA_TUNER_MT2063 is not set
# CONFIG_MEDIA_TUNER_MT20XX is not set
# CONFIG_MEDIA_TUNER_MT2131 is not set
# CONFIG_MEDIA_TUNER_MT2266 is not set
# CONFIG_MEDIA_TUNER_MXL301RF is not set
# CONFIG_MEDIA_TUNER_MXL5005S is not set
# CONFIG_MEDIA_TUNER_MXL5007T is not set
# CONFIG_MEDIA_TUNER_QM1D1B0004 is not set
# CONFIG_MEDIA_TUNER_QM1D1C0042 is not set
# CONFIG_MEDIA_TUNER_QT1010 is not set
# CONFIG_MEDIA_TUNER_R820T is not set
# CONFIG_MEDIA_TUNER_SI2157 is not set
# CONFIG_MEDIA_TUNER_SIMPLE is not set
# CONFIG_MEDIA_TUNER_TDA18212 is not set
# CONFIG_MEDIA_TUNER_TDA18218 is not set
# CONFIG_MEDIA_TUNER_TDA18250 is not set
# CONFIG_MEDIA_TUNER_TDA18271 is not set
# CONFIG_MEDIA_TUNER_TDA827X is not set
# CONFIG_MEDIA_TUNER_TDA8290 is not set
# CONFIG_MEDIA_TUNER_TDA9887 is not set
# CONFIG_MEDIA_TUNER_TEA5761 is not set
# CONFIG_MEDIA_TUNER_TEA5767 is not set
# CONFIG_MEDIA_TUNER_TUA9001 is not set
# CONFIG_MEDIA_TUNER_XC2028 is not set
# CONFIG_MEDIA_TUNER_XC4000 is not set
# CONFIG_MEDIA_TUNER_XC5000 is not set
# end of Customize TV tuners

#
# Customise DVB Frontends
#

#
# Multistandard (satellite) frontends
#
# CONFIG_DVB_M88DS3103 is not set
# CONFIG_DVB_MXL5XX is not set
# CONFIG_DVB_STB0899 is not set
# CONFIG_DVB_STB6100 is not set
# CONFIG_DVB_STV090x is not set
# CONFIG_DVB_STV0910 is not set
# CONFIG_DVB_STV6110x is not set
# CONFIG_DVB_STV6111 is not set

#
# Multistandard (cable + terrestrial) frontends
#
# CONFIG_DVB_DRXK is not set
# CONFIG_DVB_MN88472 is not set
# CONFIG_DVB_MN88473 is not set
# CONFIG_DVB_SI2165 is not set
# CONFIG_DVB_TDA18271C2DD is not set

#
# DVB-S (satellite) frontends
#
# CONFIG_DVB_CX24110 is not set
# CONFIG_DVB_CX24116 is not set
# CONFIG_DVB_CX24117 is not set
# CONFIG_DVB_CX24120 is not set
# CONFIG_DVB_CX24123 is not set
# CONFIG_DVB_DS3000 is not set
# CONFIG_DVB_MB86A16 is not set
# CONFIG_DVB_MT312 is not set
# CONFIG_DVB_S5H1420 is not set
# CONFIG_DVB_SI21XX is not set
# CONFIG_DVB_STB6000 is not set
# CONFIG_DVB_STV0288 is not set
# CONFIG_DVB_STV0299 is not set
# CONFIG_DVB_STV0900 is not set
# CONFIG_DVB_STV6110 is not set
# CONFIG_DVB_TDA10071 is not set
# CONFIG_DVB_TDA10086 is not set
# CONFIG_DVB_TDA8083 is not set
# CONFIG_DVB_TDA8261 is not set
# CONFIG_DVB_TDA826X is not set
# CONFIG_DVB_TS2020 is not set
# CONFIG_DVB_TUA6100 is not set
# CONFIG_DVB_TUNER_CX24113 is not set
# CONFIG_DVB_TUNER_ITD1000 is not set
# CONFIG_DVB_VES1X93 is not set
# CONFIG_DVB_ZL10036 is not set
# CONFIG_DVB_ZL10039 is not set

#
# DVB-T (terrestrial) frontends
#
CONFIG_DVB_AF9013=y
CONFIG_DVB_AS102_FE=y
# CONFIG_DVB_CX22700 is not set
# CONFIG_DVB_CX22702 is not set
# CONFIG_DVB_CXD2820R is not set
# CONFIG_DVB_CXD2841ER is not set
CONFIG_DVB_DIB3000MB=y
CONFIG_DVB_DIB3000MC=y
# CONFIG_DVB_DIB7000M is not set
# CONFIG_DVB_DIB7000P is not set
# CONFIG_DVB_DIB9000 is not set
# CONFIG_DVB_DRXD is not set
CONFIG_DVB_EC100=y
CONFIG_DVB_GP8PSK_FE=y
# CONFIG_DVB_L64781 is not set
# CONFIG_DVB_MT352 is not set
# CONFIG_DVB_NXT6000 is not set
CONFIG_DVB_RTL2830=y
CONFIG_DVB_RTL2832=y
CONFIG_DVB_RTL2832_SDR=y
# CONFIG_DVB_S5H1432 is not set
# CONFIG_DVB_SI2168 is not set
# CONFIG_DVB_SP887X is not set
# CONFIG_DVB_STV0367 is not set
# CONFIG_DVB_TDA10048 is not set
# CONFIG_DVB_TDA1004X is not set
# CONFIG_DVB_ZD1301_DEMOD is not set
CONFIG_DVB_ZL10353=y
# CONFIG_DVB_CXD2880 is not set

#
# DVB-C (cable) frontends
#
# CONFIG_DVB_STV0297 is not set
# CONFIG_DVB_TDA10021 is not set
# CONFIG_DVB_TDA10023 is not set
# CONFIG_DVB_VES1820 is not set

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#
# CONFIG_DVB_AU8522_DTV is not set
# CONFIG_DVB_AU8522_V4L is not set
# CONFIG_DVB_BCM3510 is not set
# CONFIG_DVB_LG2160 is not set
# CONFIG_DVB_LGDT3305 is not set
# CONFIG_DVB_LGDT3306A is not set
# CONFIG_DVB_LGDT330X is not set
# CONFIG_DVB_MXL692 is not set
# CONFIG_DVB_NXT200X is not set
# CONFIG_DVB_OR51132 is not set
# CONFIG_DVB_OR51211 is not set
# CONFIG_DVB_S5H1409 is not set
# CONFIG_DVB_S5H1411 is not set

#
# ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_DIB8000 is not set
# CONFIG_DVB_MB86A20S is not set
# CONFIG_DVB_S921 is not set

#
# ISDB-S (satellite) & ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_MN88443X is not set
# CONFIG_DVB_TC90522 is not set

#
# Digital terrestrial only tuners/PLL
#
# CONFIG_DVB_PLL is not set
# CONFIG_DVB_TUNER_DIB0070 is not set
# CONFIG_DVB_TUNER_DIB0090 is not set

#
# SEC control devices for DVB-S
#
# CONFIG_DVB_A8293 is not set
CONFIG_DVB_AF9033=y
# CONFIG_DVB_ASCOT2E is not set
# CONFIG_DVB_ATBM8830 is not set
# CONFIG_DVB_HELENE is not set
# CONFIG_DVB_HORUS3A is not set
# CONFIG_DVB_ISL6405 is not set
# CONFIG_DVB_ISL6421 is not set
# CONFIG_DVB_ISL6423 is not set
# CONFIG_DVB_IX2505V is not set
# CONFIG_DVB_LGS8GL5 is not set
# CONFIG_DVB_LGS8GXX is not set
# CONFIG_DVB_LNBH25 is not set
# CONFIG_DVB_LNBH29 is not set
# CONFIG_DVB_LNBP21 is not set
# CONFIG_DVB_LNBP22 is not set
# CONFIG_DVB_M88RS2000 is not set
# CONFIG_DVB_TDA665x is not set
# CONFIG_DVB_DRX39XYJ is not set

#
# Common Interface (EN50221) controller drivers
#
# CONFIG_DVB_CXD2099 is not set
# CONFIG_DVB_SP2 is not set
# end of Customise DVB Frontends

#
# Tools to develop new frontends
#
# CONFIG_DVB_DUMMY_FE is not set
# end of Media ancillary drivers

#
# Graphics support
#
CONFIG_APERTURE_HELPERS=y
CONFIG_SCREEN_INFO=y
CONFIG_VIDEO=y
# CONFIG_AUXDISPLAY is not set
# CONFIG_PANEL is not set
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_VIA is not set
CONFIG_INTEL_GTT=y
# CONFIG_VGA_SWITCHEROO is not set
CONFIG_DRM=y

#
# DRM debugging options
#
# CONFIG_DRM_WERROR is not set
CONFIG_DRM_DEBUG_MM=y
# end of DRM debugging options

CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_KMS_HELPER=y
# CONFIG_DRM_PANIC is not set
# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set
# CONFIG_DRM_DEBUG_MODESET_LOCK is not set
CONFIG_DRM_CLIENT=y
CONFIG_DRM_CLIENT_LIB=y
CONFIG_DRM_CLIENT_SELECTION=y
CONFIG_DRM_CLIENT_SETUP=y

#
# Supported DRM clients
#
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=100
# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set
# CONFIG_DRM_CLIENT_LOG is not set
CONFIG_DRM_CLIENT_DEFAULT_FBDEV=y
CONFIG_DRM_CLIENT_DEFAULT="fbdev"
# end of Supported DRM clients

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_DISPLAY_DP_AUX_BUS=y
CONFIG_DRM_DISPLAY_HELPER=y
# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set
# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set
CONFIG_DRM_DISPLAY_DP_HELPER=y
CONFIG_DRM_DISPLAY_DSC_HELPER=y
CONFIG_DRM_DISPLAY_HDCP_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_DRM_BUDDY=y
CONFIG_DRM_TTM_HELPER=y
CONFIG_DRM_GEM_SHMEM_HELPER=y

#
# Drivers for system framebuffers
#
CONFIG_DRM_SYSFB_HELPER=y
CONFIG_DRM_SIMPLEDRM=y
# CONFIG_DRM_VESADRM is not set
# end of Drivers for system framebuffers

#
# ARM devices
#
# CONFIG_DRM_KOMEDA is not set
# end of ARM devices

# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_AMDGPU is not set
# CONFIG_DRM_NOUVEAU is not set
CONFIG_DRM_I915=y
CONFIG_DRM_I915_FORCE_PROBE=""
CONFIG_DRM_I915_CAPTURE_ERROR=y
CONFIG_DRM_I915_COMPRESS_ERROR=y
CONFIG_DRM_I915_USERPTR=y
# CONFIG_DRM_I915_GVT_KVMGT is not set
# CONFIG_DRM_I915_DP_TUNNEL is not set

#
# drm/i915 Debugging
#
# CONFIG_DRM_I915_WERROR is not set
# CONFIG_DRM_I915_REPLAY_GPU_HANGS_API is not set
# CONFIG_DRM_I915_DEBUG is not set
# CONFIG_DRM_I915_DEBUG_MMIO is not set
# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set
# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set
# CONFIG_DRM_I915_DEBUG_GUC is not set
# CONFIG_DRM_I915_SELFTEST is not set
# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set
# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set
# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set
# CONFIG_DRM_I915_DEBUG_WAKEREF is not set
# end of drm/i915 Debugging

#
# drm/i915 Profile Guided Optimisation
#
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
CONFIG_DRM_I915_FENCE_TIMEOUT=10000
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000
CONFIG_DRM_I915_STOP_TIMEOUT=100
CONFIG_DRM_I915_TIMESLICE_DURATION=1
# end of drm/i915 Profile Guided Optimisation

# CONFIG_DRM_XE is not set
CONFIG_DRM_VGEM=y
CONFIG_DRM_VKMS=y
CONFIG_DRM_VMWGFX=y
# CONFIG_DRM_VMWGFX_MKSSTATS is not set
# CONFIG_DRM_GMA500 is not set
CONFIG_DRM_UDL=y
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_QXL is not set
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
CONFIG_DRM_PANEL=y

#
# Display Panels
#
# CONFIG_DRM_PANEL_ABT_Y030XX067A is not set
# CONFIG_DRM_PANEL_ARM_VERSATILE is not set
# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set
# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set
# CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set
# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set
# CONFIG_DRM_PANEL_BOE_TD4320 is not set
# CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 is not set
# CONFIG_DRM_PANEL_EBBG_FT8719 is not set
# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set
# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set
# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set
# CONFIG_DRM_PANEL_DSI_CM is not set
# CONFIG_DRM_PANEL_LVDS is not set
# CONFIG_DRM_PANEL_HIMAX_HX8279 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112A is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112B is not set
# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set
# CONFIG_DRM_PANEL_HYDIS_HV101HD1 is not set
# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9805 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9882T is not set
# CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set
# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set
# CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set
# CONFIG_DRM_PANEL_JDI_LPM102A188A is not set
# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set
# CONFIG_DRM_PANEL_JDI_R63452 is not set
# CONFIG_DRM_PANEL_KHADAS_TS050 is not set
# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set
# CONFIG_DRM_PANEL_LINCOLNTECH_LCD197 is not set
# CONFIG_DRM_PANEL_LG_LB035Q02 is not set
# CONFIG_DRM_PANEL_LG_LD070WX3 is not set
# CONFIG_DRM_PANEL_LG_LG4573 is not set
# CONFIG_DRM_PANEL_LG_SW43408 is not set
# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672E is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37801 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set
# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set
# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set
# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set
# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set
# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM692E5 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set
# CONFIG_DRM_PANEL_RENESAS_R61307 is not set
# CONFIG_DRM_PANEL_RENESAS_R69328 is not set
# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set
# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D27A1 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FC2X01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set
# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set
# CONFIG_DRM_PANEL_SHARP_LQ079L1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set
# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set
# CONFIG_DRM_PANEL_SHARP_LS060T1SX01 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set
# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set
# CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set
# CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set
# CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set
CONFIG_DRM_PANEL_EDP=y
# CONFIG_DRM_PANEL_SIMPLE is not set
# CONFIG_DRM_PANEL_SUMMIT is not set
# CONFIG_DRM_PANEL_SYNAPTICS_R63353 is not set
# CONFIG_DRM_PANEL_SYNAPTICS_TDDI is not set
# CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set
# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set
# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set
# CONFIG_DRM_PANEL_TPO_TPG110 is not set
# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
# CONFIG_DRM_PANEL_VISIONOX_G2647FB105 is not set
# CONFIG_DRM_PANEL_VISIONOX_R66451 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM692E5 is not set
# CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set
# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set
# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set
# end of Display Panels

CONFIG_DRM_BRIDGE=y
CONFIG_DRM_PANEL_BRIDGE=y
CONFIG_DRM_AUX_BRIDGE=y

#
# Display Interface Bridges
#
# CONFIG_DRM_CHIPONE_ICN6211 is not set
# CONFIG_DRM_CHRONTEL_CH7033 is not set
# CONFIG_DRM_DISPLAY_CONNECTOR is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_ITE_IT6263 is not set
# CONFIG_DRM_ITE_IT6505 is not set
# CONFIG_DRM_LONTIUM_LT8912B is not set
# CONFIG_DRM_LONTIUM_LT9211 is not set
# CONFIG_DRM_LONTIUM_LT9611 is not set
# CONFIG_DRM_LONTIUM_LT9611UXC is not set
# CONFIG_DRM_ITE_IT66121 is not set
# CONFIG_DRM_LVDS_CODEC is not set
# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set
# CONFIG_DRM_NWL_MIPI_DSI is not set
# CONFIG_DRM_NXP_PTN3460 is not set
# CONFIG_DRM_PARADE_PS8622 is not set
# CONFIG_DRM_PARADE_PS8640 is not set
# CONFIG_DRM_SAMSUNG_DSIM is not set
# CONFIG_DRM_SIL_SII8620 is not set
# CONFIG_DRM_SII902X is not set
# CONFIG_DRM_SII9234 is not set
# CONFIG_DRM_SIMPLE_BRIDGE is not set
# CONFIG_DRM_SOLOMON_SSD2825 is not set
# CONFIG_DRM_THINE_THC63LVD1024 is not set
# CONFIG_DRM_TOSHIBA_TC358762 is not set
# CONFIG_DRM_TOSHIBA_TC358764 is not set
# CONFIG_DRM_TOSHIBA_TC358767 is not set
# CONFIG_DRM_TOSHIBA_TC358768 is not set
# CONFIG_DRM_TOSHIBA_TC358775 is not set
# CONFIG_DRM_TI_DLPC3433 is not set
# CONFIG_DRM_TI_TDP158 is not set
# CONFIG_DRM_TI_TFP410 is not set
# CONFIG_DRM_TI_SN65DSI83 is not set
# CONFIG_DRM_TI_SN65DSI86 is not set
# CONFIG_DRM_TI_TPD12S015 is not set
# CONFIG_DRM_WAVESHARE_BRIDGE is not set
# CONFIG_DRM_ANALOGIX_ANX6345 is not set
# CONFIG_DRM_ANALOGIX_ANX78XX is not set
# CONFIG_DRM_ANALOGIX_ANX7625 is not set
# CONFIG_DRM_I2C_ADV7511 is not set
# CONFIG_DRM_CDNS_DSI is not set
# CONFIG_DRM_CDNS_MHDP8546 is not set
# end of Display Interface Bridges

# CONFIG_DRM_ETNAVIV is not set
# CONFIG_DRM_HISI_HIBMC is not set
# CONFIG_DRM_LOGICVC is not set
# CONFIG_DRM_APPLETBDRM is not set
# CONFIG_DRM_ARCPGU is not set
CONFIG_DRM_BOCHS=y
CONFIG_DRM_CIRRUS_QEMU=y
CONFIG_DRM_GM12U320=y
# CONFIG_DRM_PANEL_MIPI_DBI is not set
# CONFIG_DRM_PIXPAPER is not set
# CONFIG_TINYDRM_HX8357D is not set
# CONFIG_TINYDRM_ILI9163 is not set
# CONFIG_TINYDRM_ILI9225 is not set
# CONFIG_TINYDRM_ILI9341 is not set
# CONFIG_TINYDRM_ILI9486 is not set
# CONFIG_TINYDRM_MI0283QT is not set
# CONFIG_TINYDRM_REPAPER is not set
# CONFIG_TINYDRM_SHARP_MEMORY is not set
# CONFIG_DRM_VBOXVIDEO is not set
CONFIG_DRM_GUD=y
# CONFIG_DRM_ST7571_I2C is not set
# CONFIG_DRM_ST7586 is not set
# CONFIG_DRM_ST7735R is not set
# CONFIG_DRM_SSD130X is not set
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

#
# Frame buffer Devices
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=y
# CONFIG_FB_UVESA is not set
CONFIG_FB_VESA=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_OPENCORES is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_IBM_GXT4500 is not set
CONFIG_FB_VIRTUAL=y
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_SSD1307 is not set
# CONFIG_FB_SM712 is not set
CONFIG_FB_CORE=y
CONFIG_FB_NOTIFY=y
CONFIG_FB_DEVICE=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYSMEM_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_IOMEM_FOPS=y
CONFIG_FB_IOMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y
CONFIG_FB_TILEBLITTING=y
# end of Frame buffer Devices

#
# Backlight & LCD device support
#
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_L4F00242T03 is not set
# CONFIG_LCD_LMS283GF05 is not set
# CONFIG_LCD_LTV350QV is not set
# CONFIG_LCD_ILI922X is not set
# CONFIG_LCD_ILI9320 is not set
# CONFIG_LCD_TDO24M is not set
# CONFIG_LCD_VGG2432A4 is not set
# CONFIG_LCD_PLATFORM is not set
# CONFIG_LCD_AMS369FG06 is not set
# CONFIG_LCD_LMS501KF03 is not set
# CONFIG_LCD_HX8357 is not set
# CONFIG_LCD_OTM3225A is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_AW99706 is not set
# CONFIG_BACKLIGHT_KTD253 is not set
# CONFIG_BACKLIGHT_KTD2801 is not set
# CONFIG_BACKLIGHT_KTZ8866 is not set
# CONFIG_BACKLIGHT_MT6370 is not set
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_QCOM_WLED is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3509 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_PANDORA is not set
# CONFIG_BACKLIGHT_GPIO is not set
# CONFIG_BACKLIGHT_LV5207LP is not set
# CONFIG_BACKLIGHT_BD6107 is not set
# CONFIG_BACKLIGHT_ARCXCNN is not set
# CONFIG_BACKLIGHT_LED is not set
# end of Backlight & LCD device support

CONFIG_VGASTATE=y
CONFIG_VIDEOMODE_HELPERS=y
CONFIG_HDMI=y
# CONFIG_FIRMWARE_EDID is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
# end of Console display driver support

CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_TRACE_GPU_MEM is not set
# end of Graphics support

# CONFIG_DRM_ACCEL is not set
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_SEQ_DEVICE=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_UMP=y
CONFIG_SND_UMP_LEGACY_RAWMIDI=y
CONFIG_SND_JACK=y
CONFIG_SND_JACK_INPUT_DEV=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_PCM_TIMER=y
CONFIG_SND_HRTIMER=y
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_PROC_FS=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_CTL_FAST_LOOKUP=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_PCM_XRUN_DEBUG=y
# CONFIG_SND_CTL_INPUT_VALIDATION is not set
# CONFIG_SND_CTL_DEBUG is not set
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
# CONFIG_SND_UTIMER is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_CTL_LED=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_SEQ_MIDI_EVENT=y
CONFIG_SND_SEQ_MIDI=y
CONFIG_SND_SEQ_VIRMIDI=y
# CONFIG_SND_SEQ_UMP is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=y
CONFIG_SND_ALOOP=y
# CONFIG_SND_PCMTEST is not set
CONFIG_SND_VIRMIDI=y
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_SERIAL_GENERIC is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SE6X is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set

#
# HD-Audio
#
CONFIG_SND_HDA=y
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDA_CTL_DEV_ID is not set
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_HDA_INTEL=y
# CONFIG_SND_HDA_ACPI is not set
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
# CONFIG_SND_HDA_CODEC_SENARYTECH is not set
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
# CONFIG_SND_HDA_CODEC_CM9825 is not set
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_CODEC_REALTEK=y
# CONFIG_SND_HDA_CODEC_ALC260 is not set
# CONFIG_SND_HDA_CODEC_ALC262 is not set
# CONFIG_SND_HDA_CODEC_ALC268 is not set
# CONFIG_SND_HDA_CODEC_ALC269 is not set
# CONFIG_SND_HDA_CODEC_ALC662 is not set
# CONFIG_SND_HDA_CODEC_ALC680 is not set
# CONFIG_SND_HDA_CODEC_ALC861 is not set
# CONFIG_SND_HDA_CODEC_ALC861VD is not set
# CONFIG_SND_HDA_CODEC_ALC880 is not set
# CONFIG_SND_HDA_CODEC_ALC882 is not set
CONFIG_SND_HDA_CODEC_CIRRUS=y
# CONFIG_SND_HDA_CODEC_CS420X is not set
# CONFIG_SND_HDA_CODEC_CS421X is not set
# CONFIG_SND_HDA_CODEC_CS8409 is not set
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_CODEC_HDMI_GENERIC is not set
# CONFIG_SND_HDA_CODEC_HDMI_SIMPLE is not set
# CONFIG_SND_HDA_CODEC_HDMI_INTEL is not set
# CONFIG_SND_HDA_CODEC_HDMI_ATI is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA_MCP is not set
# CONFIG_SND_HDA_CODEC_HDMI_TEGRA is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set
CONFIG_SND_HDA_CORE=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=y
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=y
# end of HD-Audio

# CONFIG_SND_SPI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_AUDIO_MIDI_V2=y
CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y
CONFIG_SND_USB_UA101=y
CONFIG_SND_USB_USX2Y=y
CONFIG_SND_USB_CAIAQ=y
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_US122L=y
# CONFIG_SND_USB_US144MKII is not set
CONFIG_SND_USB_6FIRE=y
CONFIG_SND_USB_HIFACE=y
CONFIG_SND_BCD2000=y
CONFIG_SND_USB_LINE6=y
CONFIG_SND_USB_POD=y
CONFIG_SND_USB_PODHD=y
CONFIG_SND_USB_TONEPORT=y
CONFIG_SND_USB_VARIAX=y
# CONFIG_SND_FIREWIRE is not set
CONFIG_SND_PCMCIA=y
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_PDAUDIOCF is not set
CONFIG_SND_SOC=y
# CONFIG_SND_SOC_USB is not set

#
# Analog Devices
#
# CONFIG_SND_SOC_ADI_AXI_I2S is not set
# CONFIG_SND_SOC_ADI_AXI_SPDIF is not set
# end of Analog Devices

#
# AMD
#
# CONFIG_SND_SOC_AMD_ACP is not set
# CONFIG_SND_SOC_AMD_ACP3x is not set
# CONFIG_SND_SOC_AMD_RENOIR is not set
# CONFIG_SND_SOC_AMD_ACP5x is not set
# CONFIG_SND_SOC_AMD_ACP6x is not set
# CONFIG_SND_AMD_ACP_CONFIG is not set
# CONFIG_SND_SOC_AMD_ACP_COMMON is not set
# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set
# end of AMD

#
# Apple
#
# end of Apple

#
# Atmel
#
# CONFIG_SND_SOC_MIKROE_PROTO is not set
# end of Atmel

#
# Au1x
#
# end of Au1x

#
# Broadcom
#
# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set
# end of Broadcom

#
# Cirrus Logic
#
# end of Cirrus Logic

#
# DesignWare
#
# CONFIG_SND_DESIGNWARE_I2S is not set
# end of DesignWare

#
# Freescale
#

#
# Common SoC Audio options for Freescale CPUs:
#
# CONFIG_SND_SOC_FSL_ASRC is not set
# CONFIG_SND_SOC_FSL_SAI is not set
# CONFIG_SND_SOC_FSL_AUDMIX is not set
# CONFIG_SND_SOC_FSL_SSI is not set
# CONFIG_SND_SOC_FSL_SPDIF is not set
# CONFIG_SND_SOC_FSL_ESAI is not set
# CONFIG_SND_SOC_FSL_MICFIL is not set
# CONFIG_SND_SOC_FSL_XCVR is not set
# CONFIG_SND_SOC_IMX_AUDMUX is not set
# end of Freescale

#
# Google
#
# CONFIG_SND_SOC_CHV3_I2S is not set
# end of Google

#
# Hisilicon
#
# CONFIG_SND_I2S_HI6210_I2S is not set
# end of Hisilicon

#
# JZ4740
#
# end of JZ4740

#
# Kirkwood
#
# end of Kirkwood

#
# Loongson
#
# end of Loongson

#
# Intel
#
# CONFIG_SND_SOC_INTEL_SST_TOPLEVEL is not set
# CONFIG_SND_SOC_INTEL_AVS is not set
# end of Intel

#
# Mediatek
#
# CONFIG_SND_SOC_MTK_BTCVSD is not set
# end of Mediatek

#
# PXA
#
# end of PXA

#
# SoundWire (SDCA)
#
CONFIG_SND_SOC_SDCA_OPTIONAL=y
# end of SoundWire (SDCA)

#
# ST SPEAr
#
# end of ST SPEAr

#
# Spreadtrum
#
# end of Spreadtrum

#
# STMicroelectronics STM32
#
# end of STMicroelectronics STM32

#
# Tegra
#
# end of Tegra

#
# Xilinx
#
# CONFIG_SND_SOC_XILINX_I2S is not set
# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set
# CONFIG_SND_SOC_XILINX_SPDIF is not set
# end of Xilinx

#
# Xtensa
#
# CONFIG_SND_SOC_XTFPGA_I2S is not set
# end of Xtensa

# CONFIG_SND_SOC_SOF_TOPLEVEL is not set
CONFIG_SND_SOC_I2C_AND_SPI=y

#
# CODEC drivers
#
# CONFIG_SND_SOC_AC97_CODEC is not set
# CONFIG_SND_SOC_ADAU1372_I2C is not set
# CONFIG_SND_SOC_ADAU1372_SPI is not set
# CONFIG_SND_SOC_ADAU1373 is not set
# CONFIG_SND_SOC_ADAU1701 is not set
# CONFIG_SND_SOC_ADAU1761_I2C is not set
# CONFIG_SND_SOC_ADAU1761_SPI is not set
# CONFIG_SND_SOC_ADAU7002 is not set
# CONFIG_SND_SOC_ADAU7118_HW is not set
# CONFIG_SND_SOC_ADAU7118_I2C is not set
# CONFIG_SND_SOC_AK4104 is not set
# CONFIG_SND_SOC_AK4118 is not set
# CONFIG_SND_SOC_AK4375 is not set
# CONFIG_SND_SOC_AK4458 is not set
# CONFIG_SND_SOC_AK4554 is not set
# CONFIG_SND_SOC_AK4613 is not set
# CONFIG_SND_SOC_AK4619 is not set
# CONFIG_SND_SOC_AK4642 is not set
# CONFIG_SND_SOC_AK5386 is not set
# CONFIG_SND_SOC_AK5558 is not set
# CONFIG_SND_SOC_ALC5623 is not set
# CONFIG_SND_SOC_AUDIO_IIO_AUX is not set
# CONFIG_SND_SOC_AW8738 is not set
# CONFIG_SND_SOC_AW88395 is not set
# CONFIG_SND_SOC_AW88166 is not set
# CONFIG_SND_SOC_AW88261 is not set
# CONFIG_SND_SOC_AW88081 is not set
# CONFIG_SND_SOC_AW87390 is not set
# CONFIG_SND_SOC_AW88399 is not set
# CONFIG_SND_SOC_BD28623 is not set
# CONFIG_SND_SOC_BT_SCO is not set
# CONFIG_SND_SOC_CHV3_CODEC is not set
# CONFIG_SND_SOC_CS35L32 is not set
# CONFIG_SND_SOC_CS35L33 is not set
# CONFIG_SND_SOC_CS35L34 is not set
# CONFIG_SND_SOC_CS35L35 is not set
# CONFIG_SND_SOC_CS35L36 is not set
# CONFIG_SND_SOC_CS35L41_SPI is not set
# CONFIG_SND_SOC_CS35L41_I2C is not set
# CONFIG_SND_SOC_CS35L45_SPI is not set
# CONFIG_SND_SOC_CS35L45_I2C is not set
# CONFIG_SND_SOC_CS35L56_I2C is not set
# CONFIG_SND_SOC_CS35L56_SPI is not set
# CONFIG_SND_SOC_CS35L56_SDW is not set
# CONFIG_SND_SOC_CS42L42 is not set
# CONFIG_SND_SOC_CS42L42_SDW is not set
# CONFIG_SND_SOC_CS42L51_I2C is not set
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set
# CONFIG_SND_SOC_CS42L73 is not set
# CONFIG_SND_SOC_CS42L83 is not set
# CONFIG_SND_SOC_CS42L84 is not set
# CONFIG_SND_SOC_CS4234 is not set
# CONFIG_SND_SOC_CS4265 is not set
# CONFIG_SND_SOC_CS4270 is not set
# CONFIG_SND_SOC_CS4271_I2C is not set
# CONFIG_SND_SOC_CS4271_SPI is not set
# CONFIG_SND_SOC_CS42XX8_I2C is not set
# CONFIG_SND_SOC_CS43130 is not set
# CONFIG_SND_SOC_CS4341 is not set
# CONFIG_SND_SOC_CS4349 is not set
# CONFIG_SND_SOC_CS48L32 is not set
# CONFIG_SND_SOC_CS53L30 is not set
# CONFIG_SND_SOC_CS530X_I2C is not set
# CONFIG_SND_SOC_CS530X_SPI is not set
# CONFIG_SND_SOC_CX2072X is not set
# CONFIG_SND_SOC_DA7213 is not set
# CONFIG_SND_SOC_DMIC is not set
# CONFIG_SND_SOC_ES7134 is not set
# CONFIG_SND_SOC_ES7241 is not set
# CONFIG_SND_SOC_ES8311 is not set
# CONFIG_SND_SOC_ES8316 is not set
# CONFIG_SND_SOC_ES8323 is not set
# CONFIG_SND_SOC_ES8326 is not set
# CONFIG_SND_SOC_ES8328_I2C is not set
# CONFIG_SND_SOC_ES8328_SPI is not set
# CONFIG_SND_SOC_ES8375 is not set
# CONFIG_SND_SOC_ES8389 is not set
# CONFIG_SND_SOC_FS210X is not set
# CONFIG_SND_SOC_GTM601 is not set
# CONFIG_SND_SOC_HDA is not set
# CONFIG_SND_SOC_ICS43432 is not set
# CONFIG_SND_SOC_IDT821034 is not set
# CONFIG_SND_SOC_MAX98088 is not set
# CONFIG_SND_SOC_MAX98090 is not set
# CONFIG_SND_SOC_MAX98357A is not set
# CONFIG_SND_SOC_MAX98504 is not set
# CONFIG_SND_SOC_MAX9867 is not set
# CONFIG_SND_SOC_MAX98927 is not set
# CONFIG_SND_SOC_MAX98520 is not set
# CONFIG_SND_SOC_MAX98363 is not set
# CONFIG_SND_SOC_MAX98373_I2C is not set
# CONFIG_SND_SOC_MAX98373_SDW is not set
# CONFIG_SND_SOC_MAX98388 is not set
# CONFIG_SND_SOC_MAX98390 is not set
# CONFIG_SND_SOC_MAX98396 is not set
# CONFIG_SND_SOC_MAX9860 is not set
# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set
# CONFIG_SND_SOC_PCM1681 is not set
# CONFIG_SND_SOC_PCM1754 is not set
# CONFIG_SND_SOC_PCM1789_I2C is not set
# CONFIG_SND_SOC_PCM179X_I2C is not set
# CONFIG_SND_SOC_PCM179X_SPI is not set
# CONFIG_SND_SOC_PCM186X_I2C is not set
# CONFIG_SND_SOC_PCM186X_SPI is not set
# CONFIG_SND_SOC_PCM3060_I2C is not set
# CONFIG_SND_SOC_PCM3060_SPI is not set
# CONFIG_SND_SOC_PCM3168A_I2C is not set
# CONFIG_SND_SOC_PCM3168A_SPI is not set
# CONFIG_SND_SOC_PCM5102A is not set
# CONFIG_SND_SOC_PCM512x_I2C is not set
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_PCM6240 is not set
# CONFIG_SND_SOC_PEB2466 is not set
# CONFIG_SND_SOC_PM4125_SDW is not set
# CONFIG_SND_SOC_RT1017_SDCA_SDW is not set
# CONFIG_SND_SOC_RT1308_SDW is not set
# CONFIG_SND_SOC_RT1316_SDW is not set
# CONFIG_SND_SOC_RT1318_SDW is not set
# CONFIG_SND_SOC_RT1320_SDW is not set
# CONFIG_SND_SOC_RT5616 is not set
# CONFIG_SND_SOC_RT5631 is not set
# CONFIG_SND_SOC_RT5640 is not set
# CONFIG_SND_SOC_RT5659 is not set
# CONFIG_SND_SOC_RT5682_SDW is not set
# CONFIG_SND_SOC_RT700_SDW is not set
# CONFIG_SND_SOC_RT711_SDW is not set
# CONFIG_SND_SOC_RT711_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_DMIC_SDW is not set
# CONFIG_SND_SOC_RT721_SDCA_SDW is not set
# CONFIG_SND_SOC_RT722_SDCA_SDW is not set
# CONFIG_SND_SOC_RT715_SDW is not set
# CONFIG_SND_SOC_RT715_SDCA_SDW is not set
# CONFIG_SND_SOC_RT9120 is not set
# CONFIG_SND_SOC_RT9123 is not set
# CONFIG_SND_SOC_RT9123P is not set
# CONFIG_SND_SOC_RTQ9124 is not set
# CONFIG_SND_SOC_RTQ9128 is not set
# CONFIG_SND_SOC_SDW_MOCKUP is not set
# CONFIG_SND_SOC_SGTL5000 is not set
# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set
# CONFIG_SND_SOC_SIMPLE_MUX is not set
# CONFIG_SND_SOC_SMA1303 is not set
# CONFIG_SND_SOC_SMA1307 is not set
# CONFIG_SND_SOC_SPDIF is not set
# CONFIG_SND_SOC_SRC4XXX_I2C is not set
# CONFIG_SND_SOC_SSM2305 is not set
# CONFIG_SND_SOC_SSM2518 is not set
# CONFIG_SND_SOC_SSM2602_SPI is not set
# CONFIG_SND_SOC_SSM2602_I2C is not set
# CONFIG_SND_SOC_SSM3515 is not set
# CONFIG_SND_SOC_SSM4567 is not set
# CONFIG_SND_SOC_STA32X is not set
# CONFIG_SND_SOC_STA350 is not set
# CONFIG_SND_SOC_STI_SAS is not set
# CONFIG_SND_SOC_TAS2552 is not set
# CONFIG_SND_SOC_TAS2562 is not set
# CONFIG_SND_SOC_TAS2764 is not set
# CONFIG_SND_SOC_TAS2770 is not set
# CONFIG_SND_SOC_TAS2780 is not set
# CONFIG_SND_SOC_TAS2781_I2C is not set
# CONFIG_SND_SOC_TAS5086 is not set
# CONFIG_SND_SOC_TAS571X is not set
# CONFIG_SND_SOC_TAS5720 is not set
# CONFIG_SND_SOC_TAS5805M is not set
# CONFIG_SND_SOC_TAS6424 is not set
# CONFIG_SND_SOC_TDA7419 is not set
# CONFIG_SND_SOC_TFA9879 is not set
# CONFIG_SND_SOC_TFA989X is not set
# CONFIG_SND_SOC_TLV320ADC3XXX is not set
# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
# CONFIG_SND_SOC_TLV320AIC31XX is not set
# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set
# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set
# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set
# CONFIG_SND_SOC_TLV320AIC3X_SPI is not set
# CONFIG_SND_SOC_TLV320ADCX140 is not set
# CONFIG_SND_SOC_TS3A227E is not set
# CONFIG_SND_SOC_TSCS42XX is not set
# CONFIG_SND_SOC_TSCS454 is not set
# CONFIG_SND_SOC_UDA1334 is not set
# CONFIG_SND_SOC_UDA1342 is not set
# CONFIG_SND_SOC_WCD937X_SDW is not set
# CONFIG_SND_SOC_WCD938X_SDW is not set
# CONFIG_SND_SOC_WCD939X_SDW is not set
# CONFIG_SND_SOC_WM8510 is not set
# CONFIG_SND_SOC_WM8523 is not set
# CONFIG_SND_SOC_WM8524 is not set
# CONFIG_SND_SOC_WM8580 is not set
# CONFIG_SND_SOC_WM8711 is not set
# CONFIG_SND_SOC_WM8728 is not set
# CONFIG_SND_SOC_WM8731_I2C is not set
# CONFIG_SND_SOC_WM8731_SPI is not set
# CONFIG_SND_SOC_WM8737 is not set
# CONFIG_SND_SOC_WM8741 is not set
# CONFIG_SND_SOC_WM8750 is not set
# CONFIG_SND_SOC_WM8753 is not set
# CONFIG_SND_SOC_WM8770 is not set
# CONFIG_SND_SOC_WM8776 is not set
# CONFIG_SND_SOC_WM8782 is not set
# CONFIG_SND_SOC_WM8804_I2C is not set
# CONFIG_SND_SOC_WM8804_SPI is not set
# CONFIG_SND_SOC_WM8903 is not set
# CONFIG_SND_SOC_WM8904 is not set
# CONFIG_SND_SOC_WM8940 is not set
# CONFIG_SND_SOC_WM8960 is not set
# CONFIG_SND_SOC_WM8961 is not set
# CONFIG_SND_SOC_WM8962 is not set
# CONFIG_SND_SOC_WM8974 is not set
# CONFIG_SND_SOC_WM8978 is not set
# CONFIG_SND_SOC_WM8985 is not set
# CONFIG_SND_SOC_WSA881X is not set
# CONFIG_SND_SOC_WSA883X is not set
# CONFIG_SND_SOC_WSA884X is not set
# CONFIG_SND_SOC_ZL38060 is not set
# CONFIG_SND_SOC_MAX9759 is not set
# CONFIG_SND_SOC_MT6351 is not set
# CONFIG_SND_SOC_MT6357 is not set
# CONFIG_SND_SOC_MT6358 is not set
# CONFIG_SND_SOC_MT6660 is not set
# CONFIG_SND_SOC_NAU8315 is not set
# CONFIG_SND_SOC_NAU8325 is not set
# CONFIG_SND_SOC_NAU8540 is not set
# CONFIG_SND_SOC_NAU8810 is not set
# CONFIG_SND_SOC_NAU8821 is not set
# CONFIG_SND_SOC_NAU8822 is not set
# CONFIG_SND_SOC_NAU8824 is not set
# CONFIG_SND_SOC_NTP8918 is not set
# CONFIG_SND_SOC_NTP8835 is not set
# CONFIG_SND_SOC_TPA6130A2 is not set
# CONFIG_SND_SOC_LPASS_WSA_MACRO is not set
# CONFIG_SND_SOC_LPASS_VA_MACRO is not set
# CONFIG_SND_SOC_LPASS_RX_MACRO is not set
# CONFIG_SND_SOC_LPASS_TX_MACRO is not set
# end of CODEC drivers

#
# Generic drivers
#
# CONFIG_SND_SIMPLE_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD2 is not set
# CONFIG_SND_TEST_COMPONENT is not set
# end of Generic drivers

CONFIG_SND_X86=y
# CONFIG_HDMI_LPE_AUDIO is not set
CONFIG_SND_VIRTIO=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
CONFIG_UHID=y
CONFIG_HID_GENERIC=y
CONFIG_HID_HAPTIC=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_ACCUTOUCH=y
CONFIG_HID_ACRUX=y
CONFIG_HID_ACRUX_FF=y
CONFIG_HID_APPLE=y
CONFIG_HID_APPLEIR=y
# CONFIG_HID_APPLETB_BL is not set
# CONFIG_HID_APPLETB_KBD is not set
CONFIG_HID_ASUS=y
CONFIG_HID_AUREAL=y
CONFIG_HID_BELKIN=y
CONFIG_HID_BETOP_FF=y
CONFIG_HID_BIGBEN_FF=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
CONFIG_HID_CORSAIR=y
CONFIG_HID_COUGAR=y
CONFIG_HID_MACALLY=y
CONFIG_HID_PRODIKEYS=y
CONFIG_HID_CMEDIA=y
CONFIG_HID_CP2112=y
CONFIG_HID_CREATIVE_SB0540=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
CONFIG_HID_EMS_FF=y
CONFIG_HID_ELAN=y
CONFIG_HID_ELECOM=y
CONFIG_HID_ELO=y
CONFIG_HID_EVISION=y
CONFIG_HID_EZKEY=y
CONFIG_HID_FT260=y
CONFIG_HID_GEMBIRD=y
CONFIG_HID_GFRM=y
CONFIG_HID_GLORIOUS=y
CONFIG_HID_HOLTEK=y
CONFIG_HOLTEK_FF=y
CONFIG_HID_VIVALDI_COMMON=y
# CONFIG_HID_GOODIX_SPI is not set
CONFIG_HID_GOOGLE_STADIA_FF=y
CONFIG_HID_VIVALDI=y
CONFIG_HID_GT683R=y
CONFIG_HID_KEYTOUCH=y
CONFIG_HID_KYE=y
# CONFIG_HID_KYSONA is not set
CONFIG_HID_UCLOGIC=y
CONFIG_HID_WALTOP=y
CONFIG_HID_VIEWSONIC=y
CONFIG_HID_VRC2=y
CONFIG_HID_XIAOMI=y
CONFIG_HID_GYRATION=y
CONFIG_HID_ICADE=y
CONFIG_HID_ITE=y
CONFIG_HID_JABRA=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LCPOWER=y
CONFIG_HID_LED=y
CONFIG_HID_LENOVO=y
CONFIG_HID_LETSKETCH=y
CONFIG_HID_LOGITECH=y
CONFIG_HID_LOGITECH_DJ=y
CONFIG_HID_LOGITECH_HIDPP=y
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_LOGIG940_FF=y
CONFIG_LOGIWHEELS_FF=y
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MALTRON=y
CONFIG_HID_MAYFLASH=y
CONFIG_HID_MEGAWORLD_FF=y
CONFIG_HID_REDRAGON=y
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
CONFIG_HID_MULTITOUCH=y
CONFIG_HID_NINTENDO=y
CONFIG_NINTENDO_FF=y
CONFIG_HID_NTI=y
CONFIG_HID_NTRIG=y
CONFIG_HID_NVIDIA_SHIELD=y
CONFIG_NVIDIA_SHIELD_FF=y
CONFIG_HID_ORTEK=y
CONFIG_HID_PANTHERLORD=y
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PENMOUNT=y
CONFIG_HID_PETALYNX=y
CONFIG_HID_PICOLCD=y
CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
CONFIG_HID_PICOLCD_CIR=y
CONFIG_HID_PLANTRONICS=y
CONFIG_HID_PLAYSTATION=y
CONFIG_PLAYSTATION_FF=y
CONFIG_HID_PXRC=y
CONFIG_HID_RAZER=y
CONFIG_HID_PRIMAX=y
CONFIG_HID_RETRODE=y
CONFIG_HID_ROCCAT=y
CONFIG_HID_SAITEK=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SEMITEK=y
CONFIG_HID_SIGMAMICRO=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_SPEEDLINK=y
CONFIG_HID_STEAM=y
CONFIG_STEAM_FF=y
CONFIG_HID_STEELSERIES=y
CONFIG_HID_SUNPLUS=y
CONFIG_HID_RMI=y
CONFIG_HID_GREENASIA=y
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_HID_TIVO=y
CONFIG_HID_TOPSEED=y
CONFIG_HID_TOPRE=y
CONFIG_HID_THINGM=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
CONFIG_HID_UDRAW_PS3=y
CONFIG_HID_U2FZERO=y
# CONFIG_HID_UNIVERSAL_PIDFF is not set
CONFIG_HID_WACOM=y
CONFIG_HID_WIIMOTE=y
# CONFIG_HID_WINWING is not set
CONFIG_HID_XINMO=y
CONFIG_HID_ZEROPLUS=y
CONFIG_ZEROPLUS_FF=y
CONFIG_HID_ZYDACRON=y
CONFIG_HID_SENSOR_HUB=y
CONFIG_HID_SENSOR_CUSTOM_SENSOR=y
CONFIG_HID_ALPS=y
CONFIG_HID_MCP2200=y
CONFIG_HID_MCP2221=y
# end of Special HID drivers

#
# HID-BPF support
#
# end of HID-BPF support

CONFIG_I2C_HID=y
CONFIG_I2C_HID_ACPI=y
CONFIG_I2C_HID_OF=y
# CONFIG_I2C_HID_OF_ELAN is not set
# CONFIG_I2C_HID_OF_GOODIX is not set
CONFIG_I2C_HID_CORE=y

#
# Intel ISH HID support
#
CONFIG_INTEL_ISH_HID=y
CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER=y
# end of Intel ISH HID support

#
# AMD SFH HID Support
#
CONFIG_AMD_SFH_HID=y
# end of AMD SFH HID Support

#
# Surface System Aggregator Module HID support
#
CONFIG_SURFACE_HID=y
CONFIG_SURFACE_KBD=y
# end of Surface System Aggregator Module HID support

CONFIG_SURFACE_HID_CORE=y

#
# Intel THC HID Support
#
# CONFIG_INTEL_THC_HID is not set
# end of Intel THC HID Support

#
# USB HID support
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
# end of USB HID support

CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_LED_TRIG=y
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_PCI=y
CONFIG_USB_PCI_AMD=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_FEW_INIT_RETRIES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_PRODUCTLIST is not set
# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set
CONFIG_USB_OTG_FSM=y
CONFIG_USB_LEDS_TRIGGER_USBPORT=y
CONFIG_USB_AUTOSUSPEND_DELAY=2
CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1
CONFIG_USB_MON=y

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DBGCAP=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PCI_RENESAS=y
CONFIG_USB_XHCI_PLATFORM=y
# CONFIG_USB_XHCI_SIDEBAND is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_FSL=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OXU210HP_HCD=y
CONFIG_USB_ISP116X_HCD=y
CONFIG_USB_MAX3421_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
# CONFIG_USB_OHCI_HCD_SSB is not set
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD=y
CONFIG_USB_SL811_HCD_ISO=y
CONFIG_USB_SL811_CS=y
CONFIG_USB_R8A66597_HCD=y
CONFIG_USB_HCD_BCMA=y
CONFIG_USB_HCD_SSB=y
# CONFIG_USB_HCD_TEST_MODE is not set

#
# USB Device Class drivers
#
CONFIG_USB_ACM=y
CONFIG_USB_PRINTER=y
CONFIG_USB_WDM=y
CONFIG_USB_TMC=y

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_REALTEK=y
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_ONETOUCH=y
CONFIG_USB_STORAGE_KARMA=y
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_USB_STORAGE_ENE_UB6250=y
CONFIG_USB_UAS=y

#
# USB Imaging devices
#
CONFIG_USB_MDC800=y
CONFIG_USB_MICROTEK=y
CONFIG_USBIP_CORE=y
CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_VHCI_HC_PORTS=8
CONFIG_USBIP_VHCI_NR_HCS=16
CONFIG_USBIP_HOST=y
CONFIG_USBIP_VUDC=y
# CONFIG_USBIP_DEBUG is not set

#
# USB dual-mode controller drivers
#
CONFIG_USB_CDNS_SUPPORT=y
CONFIG_USB_CDNS_HOST=y
CONFIG_USB_CDNS3=y
CONFIG_USB_CDNS3_GADGET=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_PCI_WRAP=y
CONFIG_USB_CDNSP_PCI=y
CONFIG_USB_CDNSP_GADGET=y
CONFIG_USB_CDNSP_HOST=y
CONFIG_USB_MUSB_HDRC=y
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_GADGET is not set
CONFIG_USB_MUSB_DUAL_ROLE=y

#
# Platform Glue Layer
#

#
# MUSB DMA mode
#
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_ULPI=y
# CONFIG_USB_DWC3_HOST is not set
CONFIG_USB_DWC3_GADGET=y
# CONFIG_USB_DWC3_DUAL_ROLE is not set

#
# Platform Glue Driver Support
#
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_HAPS=y
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_DWC3_GENERIC_PLAT=y
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_HOST=y

#
# Gadget/Dual-role mode requires USB Gadget support to be enabled
#
# CONFIG_USB_DWC2_PERIPHERAL is not set
# CONFIG_USB_DWC2_DUAL_ROLE is not set
CONFIG_USB_DWC2_PCI=y
# CONFIG_USB_DWC2_DEBUG is not set
# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_CHIPIDEA_PCI=y
CONFIG_USB_CHIPIDEA_MSM=y
CONFIG_USB_CHIPIDEA_NPCM=y
# CONFIG_USB_CHIPIDEA_IMX is not set
CONFIG_USB_CHIPIDEA_GENERIC=y
# CONFIG_USB_CHIPIDEA_TEGRA is not set
CONFIG_USB_ISP1760=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_ISP1761_UDC=y
# CONFIG_USB_ISP1760_HOST_ROLE is not set
# CONFIG_USB_ISP1760_GADGET_ROLE is not set
CONFIG_USB_ISP1760_DUAL_ROLE=y

#
# USB port drivers
#
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=y
CONFIG_USB_SERIAL_AIRCABLE=y
CONFIG_USB_SERIAL_ARK3116=y
CONFIG_USB_SERIAL_BELKIN=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_USB_SERIAL_WHITEHEAT=y
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=y
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_CYPRESS_M8=y
CONFIG_USB_SERIAL_EMPEG=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_VISOR=y
CONFIG_USB_SERIAL_IPAQ=y
CONFIG_USB_SERIAL_IR=y
CONFIG_USB_SERIAL_EDGEPORT=y
CONFIG_USB_SERIAL_EDGEPORT_TI=y
CONFIG_USB_SERIAL_F81232=y
CONFIG_USB_SERIAL_F8153X=y
CONFIG_USB_SERIAL_GARMIN=y
CONFIG_USB_SERIAL_IPW=y
CONFIG_USB_SERIAL_IUU=y
CONFIG_USB_SERIAL_KEYSPAN_PDA=y
CONFIG_USB_SERIAL_KEYSPAN=y
CONFIG_USB_SERIAL_KLSI=y
CONFIG_USB_SERIAL_KOBIL_SCT=y
CONFIG_USB_SERIAL_MCT_U232=y
CONFIG_USB_SERIAL_METRO=y
CONFIG_USB_SERIAL_MOS7720=y
CONFIG_USB_SERIAL_MOS7715_PARPORT=y
CONFIG_USB_SERIAL_MOS7840=y
CONFIG_USB_SERIAL_MXUPORT=y
CONFIG_USB_SERIAL_NAVMAN=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_OTI6858=y
CONFIG_USB_SERIAL_QCAUX=y
CONFIG_USB_SERIAL_QUALCOMM=y
CONFIG_USB_SERIAL_SPCP8X5=y
CONFIG_USB_SERIAL_SAFE=y
# CONFIG_USB_SERIAL_SAFE_PADDED is not set
CONFIG_USB_SERIAL_SIERRAWIRELESS=y
CONFIG_USB_SERIAL_SYMBOL=y
CONFIG_USB_SERIAL_TI=y
CONFIG_USB_SERIAL_CYBERJACK=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
CONFIG_USB_SERIAL_OMNINET=y
CONFIG_USB_SERIAL_OPTICON=y
CONFIG_USB_SERIAL_XSENS_MT=y
CONFIG_USB_SERIAL_WISHBONE=y
CONFIG_USB_SERIAL_SSU100=y
CONFIG_USB_SERIAL_QT2=y
CONFIG_USB_SERIAL_UPD78F0730=y
CONFIG_USB_SERIAL_XR=y
CONFIG_USB_SERIAL_DEBUG=y

#
# USB Miscellaneous drivers
#
CONFIG_USB_USS720=y
CONFIG_USB_EMI62=y
CONFIG_USB_EMI26=y
CONFIG_USB_ADUTUX=y
CONFIG_USB_SEVSEG=y
CONFIG_USB_LEGOTOWER=y
CONFIG_USB_LCD=y
CONFIG_USB_CYPRESS_CY7C63=y
CONFIG_USB_CYTHERM=y
CONFIG_USB_IDMOUSE=y
CONFIG_USB_APPLEDISPLAY=y
CONFIG_APPLE_MFI_FASTCHARGE=y
CONFIG_USB_LJCA=y
# CONFIG_USB_USBIO is not set
CONFIG_USB_SISUSBVGA=y
CONFIG_USB_LD=y
CONFIG_USB_TRANCEVIBRATOR=y
CONFIG_USB_IOWARRIOR=y
CONFIG_USB_TEST=y
CONFIG_USB_EHSET_TEST_FIXTURE=y
CONFIG_USB_ISIGHTFW=y
CONFIG_USB_YUREX=y
CONFIG_USB_EZUSB_FX2=y
CONFIG_USB_HUB_USB251XB=y
CONFIG_USB_HSIC_USB3503=y
CONFIG_USB_HSIC_USB4604=y
CONFIG_USB_LINK_LAYER_TEST=y
CONFIG_USB_CHAOSKEY=y
# CONFIG_USB_ONBOARD_DEV is not set
CONFIG_USB_ATM=y
CONFIG_USB_SPEEDTOUCH=y
CONFIG_USB_CXACRU=y
CONFIG_USB_UEAGLEATM=y
CONFIG_USB_XUSBATM=y

#
# USB Physical Layer drivers
#
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_TAHVO_USB=y
CONFIG_TAHVO_USB_HOST_BY_DEFAULT=y
CONFIG_USB_ISP1301=y
# end of USB Physical Layer drivers

CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_U_SERIAL_CONSOLE=y

#
# USB Peripheral Controller
#
CONFIG_USB_GR_UDC=y
CONFIG_USB_R8A66597=y
CONFIG_USB_PXA27X=y
CONFIG_USB_SNP_CORE=y
# CONFIG_USB_SNP_UDC_PLAT is not set
# CONFIG_USB_M66592 is not set
CONFIG_USB_BDC_UDC=y
CONFIG_USB_AMD5536UDC=y
CONFIG_USB_NET2280=y
CONFIG_USB_GOKU=y
CONFIG_USB_EG20T=y
# CONFIG_USB_GADGET_XILINX is not set
CONFIG_USB_MAX3420_UDC=y
CONFIG_USB_CDNS2_UDC=y
CONFIG_USB_DUMMY_HCD=y
# end of USB Peripheral Controller

CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_F_ACM=y
CONFIG_USB_F_SS_LB=y
CONFIG_USB_U_SERIAL=y
CONFIG_USB_U_ETHER=y
CONFIG_USB_U_AUDIO=y
CONFIG_USB_F_SERIAL=y
CONFIG_USB_F_OBEX=y
CONFIG_USB_F_NCM=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_PHONET=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_SUBSET=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_FS=y
CONFIG_USB_F_UAC1=y
CONFIG_USB_F_UAC1_LEGACY=y
CONFIG_USB_F_UAC2=y
CONFIG_USB_F_UVC=y
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_MIDI2=y
CONFIG_USB_F_HID=y
CONFIG_USB_F_PRINTER=y
CONFIG_USB_F_TCM=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_PHONET=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_MIDI2=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_CONFIGFS_F_TCM=y

#
# USB Gadget precomposed configurations
#
# CONFIG_USB_ZERO is not set
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_ETH is not set
# CONFIG_USB_G_NCM is not set
CONFIG_USB_GADGETFS=y
# CONFIG_USB_FUNCTIONFS is not set
# CONFIG_USB_MASS_STORAGE is not set
# CONFIG_USB_GADGET_TARGET is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_NOKIA is not set
# CONFIG_USB_G_ACM_MS is not set
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
# CONFIG_USB_G_WEBCAM is not set
CONFIG_USB_RAW_GADGET=y
# end of USB Gadget precomposed configurations

CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_TYPEC_MT6360=y
CONFIG_TYPEC_TCPCI_MT6370=y
CONFIG_TYPEC_TCPCI_MAXIM=y
CONFIG_TYPEC_FUSB302=y
CONFIG_TYPEC_WCOVE=y
CONFIG_TYPEC_UCSI=y
CONFIG_UCSI_CCG=y
CONFIG_UCSI_ACPI=y
CONFIG_UCSI_STM32G0=y
CONFIG_TYPEC_TPS6598X=y
CONFIG_TYPEC_ANX7411=y
CONFIG_TYPEC_RT1719=y
CONFIG_TYPEC_HD3SS3220=y
CONFIG_TYPEC_STUSB160X=y
CONFIG_TYPEC_WUSB3801=y

#
# USB Type-C Multiplexer/DeMultiplexer Switch support
#
CONFIG_TYPEC_MUX_FSA4480=y
CONFIG_TYPEC_MUX_GPIO_SBU=y
CONFIG_TYPEC_MUX_PI3USB30532=y
CONFIG_TYPEC_MUX_INTEL_PMC=y
# CONFIG_TYPEC_MUX_IT5205 is not set
CONFIG_TYPEC_MUX_NB7VPQ904M=y
# CONFIG_TYPEC_MUX_PS883X is not set
CONFIG_TYPEC_MUX_PTN36502=y
# CONFIG_TYPEC_MUX_TUSB1046 is not set
CONFIG_TYPEC_MUX_WCD939X_USBSS=y
# end of USB Type-C Multiplexer/DeMultiplexer Switch support

#
# USB Type-C Alternate Mode drivers
#
CONFIG_TYPEC_DP_ALTMODE=y
CONFIG_TYPEC_NVIDIA_ALTMODE=y
# CONFIG_TYPEC_TBT_ALTMODE is not set
# end of USB Type-C Alternate Mode drivers

CONFIG_USB_ROLE_SWITCH=y
CONFIG_USB_ROLES_INTEL_XHCI=y
CONFIG_MMC=y
# CONFIG_PWRSEQ_EMMC is not set
# CONFIG_PWRSEQ_SD8787 is not set
# CONFIG_PWRSEQ_SIMPLE is not set
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set
# CONFIG_MMC_CRYPTO is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_TIFM_SD is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_SDRICOH_CS is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_VUB300=y
CONFIG_MMC_USHC=y
# CONFIG_MMC_USDHI6ROL0 is not set
CONFIG_MMC_REALTEK_USB=y
# CONFIG_MMC_CQHCI is not set
# CONFIG_MMC_HSQ is not set
# CONFIG_MMC_TOSHIBA_PCI is not set
# CONFIG_MMC_MTK is not set
# CONFIG_SCSI_UFSHCD is not set
CONFIG_MEMSTICK=y
# CONFIG_MEMSTICK_DEBUG is not set

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
# CONFIG_MSPRO_BLOCK is not set
# CONFIG_MS_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
# CONFIG_MEMSTICK_TIFM_MS is not set
# CONFIG_MEMSTICK_JMICRON_38X is not set
# CONFIG_MEMSTICK_R592 is not set
CONFIG_MEMSTICK_REALTEK_USB=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_CLASS_FLASH is not set
CONFIG_LEDS_CLASS_MULTICOLOR=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set

#
# LED drivers
#
# CONFIG_LEDS_AN30259A is not set
# CONFIG_LEDS_APU is not set
# CONFIG_LEDS_AW200XX is not set
# CONFIG_LEDS_AW2013 is not set
# CONFIG_LEDS_BCM6328 is not set
# CONFIG_LEDS_BCM6358 is not set
# CONFIG_LEDS_CHT_WCOVE is not set
# CONFIG_LEDS_CR0014114 is not set
# CONFIG_LEDS_EL15203000 is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3532 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_LM3692X is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP3952 is not set
# CONFIG_LEDS_LP50XX is not set
# CONFIG_LEDS_LP55XX_COMMON is not set
# CONFIG_LEDS_LP8860 is not set
# CONFIG_LEDS_LP8864 is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA963X is not set
# CONFIG_LEDS_PCA995X is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2606MVV is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_TLC591XX is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_IS31FL319X is not set
# CONFIG_LEDS_IS31FL32XX is not set

#
# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
#
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_SYSCON is not set
# CONFIG_LEDS_MLXCPLD is not set
# CONFIG_LEDS_MLXREG is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LEDS_NIC78BX is not set
# CONFIG_LEDS_SPI_BYTE is not set
# CONFIG_LEDS_LM3697 is not set
# CONFIG_LEDS_ST1202 is not set
# CONFIG_LEDS_LGM is not set

#
# Flash and Torch LED drivers
#

#
# RGB LED drivers
#
# CONFIG_LEDS_GROUP_MULTICOLOR is not set
# CONFIG_LEDS_KTD202X is not set
# CONFIG_LEDS_NCP5623 is not set
# CONFIG_LEDS_MT6370_RGB is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_DISK is not set
# CONFIG_LEDS_TRIGGER_MTD is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
# CONFIG_LEDS_TRIGGER_ACTIVITY is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_LEDS_TRIGGER_PANIC is not set
# CONFIG_LEDS_TRIGGER_NETDEV is not set
# CONFIG_LEDS_TRIGGER_PATTERN is not set
# CONFIG_LEDS_TRIGGER_TTY is not set
# CONFIG_LEDS_TRIGGER_INPUT_EVENTS is not set

#
# Simatic LED drivers
#
# CONFIG_ACCESSIBILITY is not set
CONFIG_INFINIBAND=y
CONFIG_INFINIBAND_USER_MAD=y
CONFIG_INFINIBAND_USER_ACCESS=y
CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_ON_DEMAND_PAGING=y
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y
CONFIG_INFINIBAND_VIRT_DMA=y
# CONFIG_INFINIBAND_EFA is not set
# CONFIG_INFINIBAND_ERDMA is not set
CONFIG_MLX4_INFINIBAND=y
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_OCRDMA is not set
# CONFIG_INFINIBAND_USNIC is not set
# CONFIG_INFINIBAND_VMWARE_PVRDMA is not set
# CONFIG_INFINIBAND_RDMAVT is not set
CONFIG_RDMA_RXE=y
CONFIG_RDMA_SIW=y
CONFIG_INFINIBAND_IPOIB=y
CONFIG_INFINIBAND_IPOIB_CM=y
CONFIG_INFINIBAND_IPOIB_DEBUG=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
CONFIG_INFINIBAND_SRP=y
# CONFIG_INFINIBAND_SRPT is not set
CONFIG_INFINIBAND_ISER=y
CONFIG_INFINIBAND_RTRS=y
CONFIG_INFINIBAND_RTRS_CLIENT=y
# CONFIG_INFINIBAND_RTRS_SERVER is not set
# CONFIG_INFINIBAND_OPA_VNIC is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EDAC=y
# CONFIG_EDAC_DEBUG is not set
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_SCRUB is not set
# CONFIG_EDAC_ECS is not set
# CONFIG_EDAC_MEM_REPAIR is not set
# CONFIG_EDAC_E752X is not set
# CONFIG_EDAC_I82975X is not set
# CONFIG_EDAC_I3000 is not set
# CONFIG_EDAC_I3200 is not set
# CONFIG_EDAC_IE31200 is not set
# CONFIG_EDAC_X38 is not set
# CONFIG_EDAC_I5400 is not set
# CONFIG_EDAC_I7CORE is not set
# CONFIG_EDAC_I5100 is not set
# CONFIG_EDAC_I7300 is not set
# CONFIG_EDAC_SBRIDGE is not set
# CONFIG_EDAC_SKX is not set
# CONFIG_EDAC_I10NM is not set
# CONFIG_EDAC_IMH is not set
# CONFIG_EDAC_PND2 is not set
# CONFIG_EDAC_IGEN6 is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
# CONFIG_RTC_NVMEM is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_ABB5ZES3 is not set
# CONFIG_RTC_DRV_ABEOZ9 is not set
# CONFIG_RTC_DRV_ABX80X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX31335 is not set
# CONFIG_RTC_DRV_NVIDIA_VRS10 is not set
# CONFIG_RTC_DRV_NCT3018Y is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12026 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF85363 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_TWL4030 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8010 is not set
# CONFIG_RTC_DRV_RX8111 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3028 is not set
# CONFIG_RTC_DRV_RV3032 is not set
# CONFIG_RTC_DRV_RV8803 is not set
# CONFIG_RTC_DRV_SD2405AL is not set
# CONFIG_RTC_DRV_SD3078 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1302 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1343 is not set
# CONFIG_RTC_DRV_DS1347 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6916 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RX4581 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_MCP795 is not set
CONFIG_RTC_I2C_AND_SPI=y

#
# SPI and I2C RTC drivers
#
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_PCF85063 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RX6110 is not set

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_ZYNQMP is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_CADENCE is not set
# CONFIG_RTC_DRV_FTRTC010 is not set
# CONFIG_RTC_DRV_R7301 is not set
# CONFIG_RTC_DRV_GOLDFISH is not set

#
# HID Sensor RTC drivers
#
CONFIG_RTC_DRV_HID_SENSOR_TIME=y
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DMA_ACPI=y
CONFIG_DMA_OF=y
# CONFIG_ALTERA_MSGDMA is not set
# CONFIG_DW_AXI_DMAC is not set
# CONFIG_FSL_EDMA is not set
CONFIG_INTEL_IDMA64=y
# CONFIG_INTEL_IDXD is not set
# CONFIG_INTEL_IDXD_COMPAT is not set
CONFIG_INTEL_IOATDMA=y
# CONFIG_PLX_DMA is not set
# CONFIG_XILINX_DMA is not set
# CONFIG_XILINX_XDMA is not set
# CONFIG_XILINX_ZYNQMP_DPDMA is not set
# CONFIG_AMD_PTDMA is not set
# CONFIG_AMD_QDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_HIDMA is not set
CONFIG_DW_DMAC_CORE=y
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
# CONFIG_DW_EDMA is not set
CONFIG_HSU_DMA=y
# CONFIG_SF_PDMA is not set
# CONFIG_INTEL_LDMA is not set

#
# DMA Clients
#
CONFIG_ASYNC_TX_DMA=y
# CONFIG_DMATEST is not set
CONFIG_DMA_ENGINE_RAID=y

#
# DMABUF options
#
CONFIG_SYNC_FILE=y
CONFIG_SW_SYNC=y
CONFIG_UDMABUF=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_DEBUG is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_SYSFS_STATS is not set
CONFIG_DMABUF_HEAPS_SYSTEM=y
CONFIG_DMABUF_HEAPS_CMA=y
# end of DMABUF options

CONFIG_DCA=y
# CONFIG_UIO is not set
CONFIG_VFIO=y
CONFIG_VFIO_DEVICE_CDEV=y
# CONFIG_VFIO_GROUP is not set
CONFIG_VFIO_VIRQFD=y
# CONFIG_VFIO_DEBUGFS is not set

#
# VFIO support for PCI devices
#
CONFIG_VFIO_PCI_CORE=y
CONFIG_VFIO_PCI_INTX=y
CONFIG_VFIO_PCI=y
# CONFIG_VFIO_PCI_VGA is not set
# CONFIG_VFIO_PCI_IGD is not set
# CONFIG_VIRTIO_VFIO_PCI is not set
# end of VFIO support for PCI devices

CONFIG_IRQ_BYPASS_MANAGER=y
# CONFIG_VIRT_DRIVERS is not set
CONFIG_VIRTIO_ANCHOR=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI_LIB=y
CONFIG_VIRTIO_PCI_LIB_LEGACY=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_ADMIN_LEGACY=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_VDPA=y
CONFIG_VIRTIO_PMEM=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MEM=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
# CONFIG_VIRTIO_DEBUG is not set
# CONFIG_VIRTIO_RTC is not set
CONFIG_VDPA=y
CONFIG_VDPA_SIM=y
CONFIG_VDPA_SIM_NET=y
CONFIG_VDPA_SIM_BLOCK=y
# CONFIG_VDPA_USER is not set
# CONFIG_IFCVF is not set
# CONFIG_MLX5_VDPA_STEERING_DEBUG is not set
CONFIG_VP_VDPA=y
# CONFIG_ALIBABA_ENI_VDPA is not set
# CONFIG_SNET_VDPA is not set
# CONFIG_OCTEONEP_VDPA is not set
CONFIG_VHOST_IOTLB=y
CONFIG_VHOST_RING=y
CONFIG_VHOST_TASK=y
CONFIG_VHOST=y
CONFIG_VHOST_MENU=y
CONFIG_VHOST_NET=y
# CONFIG_VHOST_SCSI is not set
CONFIG_VHOST_VSOCK=y
CONFIG_VHOST_VDPA=y
CONFIG_VHOST_CROSS_ENDIAN_LEGACY=y
CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set
# end of Microsoft Hyper-V guest support

CONFIG_GREYBUS=y
# CONFIG_GREYBUS_BEAGLEPLAY is not set
CONFIG_GREYBUS_ES2=y
CONFIG_COMEDI=y
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
CONFIG_COMEDI_MISC_DRIVERS=y
CONFIG_COMEDI_BOND=y
CONFIG_COMEDI_TEST=y
CONFIG_COMEDI_PARPORT=y
CONFIG_COMEDI_ISA_DRIVERS=y
CONFIG_COMEDI_PCL711=y
CONFIG_COMEDI_PCL724=y
CONFIG_COMEDI_PCL726=y
CONFIG_COMEDI_PCL730=y
CONFIG_COMEDI_PCL812=y
CONFIG_COMEDI_PCL816=y
CONFIG_COMEDI_PCL818=y
CONFIG_COMEDI_PCM3724=y
CONFIG_COMEDI_AMPLC_DIO200_ISA=y
CONFIG_COMEDI_AMPLC_PC236_ISA=y
CONFIG_COMEDI_AMPLC_PC263_ISA=y
CONFIG_COMEDI_RTI800=y
CONFIG_COMEDI_RTI802=y
CONFIG_COMEDI_DAC02=y
CONFIG_COMEDI_DAS16M1=y
CONFIG_COMEDI_DAS08_ISA=y
# CONFIG_COMEDI_DAS16 is not set
CONFIG_COMEDI_DAS800=y
CONFIG_COMEDI_DAS1800=y
CONFIG_COMEDI_DAS6402=y
CONFIG_COMEDI_DT2801=y
CONFIG_COMEDI_DT2811=y
CONFIG_COMEDI_DT2814=y
CONFIG_COMEDI_DT2815=y
CONFIG_COMEDI_DT2817=y
CONFIG_COMEDI_DT282X=y
CONFIG_COMEDI_DMM32AT=y
CONFIG_COMEDI_FL512=y
CONFIG_COMEDI_AIO_AIO12_8=y
CONFIG_COMEDI_AIO_IIRO_16=y
# CONFIG_COMEDI_II_PCI20KC is not set
CONFIG_COMEDI_C6XDIGIO=y
CONFIG_COMEDI_MPC624=y
CONFIG_COMEDI_ADQ12B=y
CONFIG_COMEDI_NI_AT_A2150=y
CONFIG_COMEDI_NI_AT_AO=y
# CONFIG_COMEDI_NI_ATMIO is not set
CONFIG_COMEDI_NI_ATMIO16D=y
CONFIG_COMEDI_NI_LABPC_ISA=y
CONFIG_COMEDI_PCMAD=y
CONFIG_COMEDI_PCMDA12=y
CONFIG_COMEDI_PCMMIO=y
CONFIG_COMEDI_PCMUIO=y
CONFIG_COMEDI_MULTIQ3=y
CONFIG_COMEDI_S526=y
CONFIG_COMEDI_PCI_DRIVERS=y
CONFIG_COMEDI_8255_PCI=y
# CONFIG_COMEDI_ADDI_APCI_1032 is not set
# CONFIG_COMEDI_ADDI_APCI_1500 is not set
# CONFIG_COMEDI_ADDI_APCI_1516 is not set
# CONFIG_COMEDI_ADDI_APCI_1564 is not set
# CONFIG_COMEDI_ADDI_APCI_16XX is not set
# CONFIG_COMEDI_ADDI_APCI_2032 is not set
# CONFIG_COMEDI_ADDI_APCI_2200 is not set
# CONFIG_COMEDI_ADDI_APCI_3120 is not set
# CONFIG_COMEDI_ADDI_APCI_3501 is not set
# CONFIG_COMEDI_ADDI_APCI_3XXX is not set
# CONFIG_COMEDI_ADL_PCI6208 is not set
# CONFIG_COMEDI_ADL_PCI7250 is not set
# CONFIG_COMEDI_ADL_PCI7X3X is not set
# CONFIG_COMEDI_ADL_PCI8164 is not set
# CONFIG_COMEDI_ADL_PCI9111 is not set
CONFIG_COMEDI_ADL_PCI9118=y
# CONFIG_COMEDI_ADV_PCI1710 is not set
# CONFIG_COMEDI_ADV_PCI1720 is not set
# CONFIG_COMEDI_ADV_PCI1723 is not set
# CONFIG_COMEDI_ADV_PCI1724 is not set
# CONFIG_COMEDI_ADV_PCI1760 is not set
# CONFIG_COMEDI_ADV_PCI_DIO is not set
# CONFIG_COMEDI_AMPLC_DIO200_PCI is not set
# CONFIG_COMEDI_AMPLC_PC236_PCI is not set
# CONFIG_COMEDI_AMPLC_PC263_PCI is not set
# CONFIG_COMEDI_AMPLC_PCI224 is not set
# CONFIG_COMEDI_AMPLC_PCI230 is not set
# CONFIG_COMEDI_CONTEC_PCI_DIO is not set
# CONFIG_COMEDI_DAS08_PCI is not set
# CONFIG_COMEDI_DT3000 is not set
# CONFIG_COMEDI_DYNA_PCI10XX is not set
# CONFIG_COMEDI_GSC_HPDI is not set
# CONFIG_COMEDI_MF6X4 is not set
# CONFIG_COMEDI_ICP_MULTI is not set
# CONFIG_COMEDI_DAQBOARD2000 is not set
# CONFIG_COMEDI_JR3_PCI is not set
# CONFIG_COMEDI_KE_COUNTER is not set
# CONFIG_COMEDI_CB_PCIDAS64 is not set
# CONFIG_COMEDI_CB_PCIDAS is not set
# CONFIG_COMEDI_CB_PCIDDA is not set
# CONFIG_COMEDI_CB_PCIMDAS is not set
# CONFIG_COMEDI_CB_PCIMDDA is not set
# CONFIG_COMEDI_ME4000 is not set
# CONFIG_COMEDI_ME_DAQ is not set
# CONFIG_COMEDI_NI_6527 is not set
# CONFIG_COMEDI_NI_65XX is not set
# CONFIG_COMEDI_NI_660X is not set
# CONFIG_COMEDI_NI_670X is not set
CONFIG_COMEDI_NI_LABPC_PCI=y
# CONFIG_COMEDI_NI_PCIDIO is not set
# CONFIG_COMEDI_NI_PCIMIO is not set
# CONFIG_COMEDI_RTD520 is not set
# CONFIG_COMEDI_S626 is not set
CONFIG_COMEDI_PCMCIA_DRIVERS=y
# CONFIG_COMEDI_CB_DAS16_CS is not set
# CONFIG_COMEDI_DAS08_CS is not set
CONFIG_COMEDI_NI_DAQ_700_CS=y
# CONFIG_COMEDI_NI_DAQ_DIO24_CS is not set
CONFIG_COMEDI_NI_LABPC_CS=y
# CONFIG_COMEDI_NI_MIO_CS is not set
# CONFIG_COMEDI_QUATECH_DAQP_CS is not set
CONFIG_COMEDI_USB_DRIVERS=y
CONFIG_COMEDI_DT9812=y
CONFIG_COMEDI_NI_USB6501=y
CONFIG_COMEDI_USBDUX=y
CONFIG_COMEDI_USBDUXFAST=y
CONFIG_COMEDI_USBDUXSIGMA=y
CONFIG_COMEDI_VMK80XX=y
CONFIG_COMEDI_8254=y
CONFIG_COMEDI_8255=y
CONFIG_COMEDI_8255_SA=y
CONFIG_COMEDI_KCOMEDILIB=y
CONFIG_COMEDI_AMPLC_DIO200=y
CONFIG_COMEDI_AMPLC_PC236=y
CONFIG_COMEDI_DAS08=y
CONFIG_COMEDI_ISADMA=y
CONFIG_COMEDI_NI_LABPC=y
CONFIG_COMEDI_NI_LABPC_ISADMA=y
# CONFIG_COMEDI_TESTS is not set
# CONFIG_GPIB is not set
CONFIG_STAGING=y
# CONFIG_RTL8723BS is not set

#
# IIO staging drivers
#

#
# Accelerometers
#
# CONFIG_ADIS16203 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD7816 is not set
# end of Analog to digital converters

#
# Analog digital bi-direction converters
#
# CONFIG_ADT7316 is not set
# end of Analog digital bi-direction converters

#
# Direct Digital Synthesis
#
# CONFIG_AD9832 is not set
# CONFIG_AD9834 is not set
# end of Direct Digital Synthesis

#
# Network Analyzer, Impedance Converters
#
# CONFIG_AD5933 is not set
# end of Network Analyzer, Impedance Converters
# end of IIO staging drivers

# CONFIG_FB_SM750 is not set
# CONFIG_STAGING_MEDIA is not set
# CONFIG_FB_TFT is not set
# CONFIG_MOST_COMPONENTS is not set
# CONFIG_GREYBUS_AUDIO is not set
# CONFIG_GREYBUS_BOOTROM is not set
# CONFIG_GREYBUS_FIRMWARE is not set
CONFIG_GREYBUS_HID=y
# CONFIG_GREYBUS_LOG is not set
# CONFIG_GREYBUS_LOOPBACK is not set
# CONFIG_GREYBUS_POWER is not set
# CONFIG_GREYBUS_RAW is not set
# CONFIG_GREYBUS_VIBRATOR is not set
CONFIG_GREYBUS_BRIDGED_PHY=y
# CONFIG_GREYBUS_GPIO is not set
# CONFIG_GREYBUS_I2C is not set
# CONFIG_GREYBUS_SDIO is not set
# CONFIG_GREYBUS_SPI is not set
# CONFIG_GREYBUS_UART is not set
CONFIG_GREYBUS_USB=y
# CONFIG_XIL_AXIS_FIFO is not set
# CONFIG_VME_BUS is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
# CONFIG_MELLANOX_PLATFORM is not set
CONFIG_SURFACE_PLATFORMS=y
# CONFIG_SURFACE3_WMI is not set
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_ACPI_NOTIFY is not set
# CONFIG_SURFACE_AGGREGATOR_CDEV is not set
# CONFIG_SURFACE_AGGREGATOR_HUB is not set
CONFIG_SURFACE_AGGREGATOR_REGISTRY=y
# CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH is not set
# CONFIG_SURFACE_DTX is not set
# CONFIG_SURFACE_GPE is not set
# CONFIG_SURFACE_HOTPLUG is not set
# CONFIG_SURFACE_PLATFORM_PROFILE is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
CONFIG_SURFACE_AGGREGATOR=y
CONFIG_SURFACE_AGGREGATOR_BUS=y
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_WMI_BMOF=y
# CONFIG_HUAWEI_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_UNIWILL is not set
# CONFIG_MXM_WMI is not set
# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set
# CONFIG_XIAOMI_WMI is not set
# CONFIG_REDMI_WMI is not set
# CONFIG_GIGABYTE_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ACER_WIRELESS is not set
# CONFIG_ACER_WMI is not set

#
# AMD HSMP Driver
#
# CONFIG_AMD_HSMP_ACPI is not set
# CONFIG_AMD_HSMP_PLAT is not set
# end of AMD HSMP Driver

# CONFIG_AMD_PMC is not set
# CONFIG_AMD_HFI is not set
# CONFIG_AMD_3D_VCACHE is not set
# CONFIG_AMD_WBRF is not set
# CONFIG_AMD_ISP_PLATFORM is not set
# CONFIG_ADV_SWBUTTON is not set
# CONFIG_APPLE_GMUX is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_ASUS_WIRELESS is not set
# CONFIG_ASUS_ARMOURY is not set
CONFIG_ASUS_WMI=y
# CONFIG_ASUS_WMI_DEPRECATED_ATTRS is not set
# CONFIG_ASUS_NB_WMI is not set
CONFIG_ASUS_TF103C_DOCK=y
# CONFIG_AYANEO_EC is not set
CONFIG_EEEPC_LAPTOP=y
# CONFIG_EEEPC_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_DELL is not set
# CONFIG_AMILO_RFKILL is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_GPD_POCKET_FAN is not set
# CONFIG_X86_PLATFORM_DRIVERS_HP is not set
# CONFIG_WIRELESS_HOTKEY is not set
# CONFIG_IBM_RTL is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_ATOMISP2_PM is not set
# CONFIG_INTEL_IFS is not set
# CONFIG_INTEL_SAR_INT1092 is not set
# CONFIG_INTEL_SKL_INT3472 is not set

#
# Intel Speed Select Technology interface support
#
# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set
# end of Intel Speed Select Technology interface support

# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set
# CONFIG_INTEL_WMI_THUNDERBOLT is not set

#
# Intel Uncore Frequency Control
#
# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set
# end of Intel Uncore Frequency Control

# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_VBTN is not set
# CONFIG_INTEL_EHL_PSE_IO is not set
# CONFIG_INTEL_INT0002_VGPIO is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_INTEL_BXTWC_PMIC_TMU is not set
CONFIG_INTEL_CHTWC_INT33FE=y
CONFIG_INTEL_ISHTP_ECLITE=y
# CONFIG_INTEL_PUNIT_IPC is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_INTEL_TURBO_MAX_3 is not set
# CONFIG_INTEL_VSEC is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_LENOVO_WMI_HOTKEY_UTILITIES is not set
# CONFIG_LENOVO_WMI_CAMERA is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_THINKPAD_LMI is not set
# CONFIG_YOGABOOK is not set
# CONFIG_YT2_1380 is not set
# CONFIG_LENOVO_WMI_GAMEZONE is not set
# CONFIG_LENOVO_WMI_TUNING is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_MEEGOPAD_ANX7428 is not set
# CONFIG_MSI_EC is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_MSI_WMI is not set
# CONFIG_MSI_WMI_PLATFORM is not set
# CONFIG_PCENGINES_APU2 is not set
# CONFIG_PORTWELL_EC is not set
# CONFIG_BARCO_P50_GPIO is not set
# CONFIG_SAMSUNG_GALAXYBOOK is not set
# CONFIG_SAMSUNG_LAPTOP is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_LG_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_SYSTEM76_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_SERIAL_MULTI_INSTANTIATE is not set
# CONFIG_INSPUR_PLATFORM_PROFILE is not set
# CONFIG_DASHARO_ACPI is not set
# CONFIG_INTEL_IPS is not set
CONFIG_INTEL_SCU_IPC=y
# CONFIG_INTEL_SCU_PCI is not set
# CONFIG_INTEL_SCU_PLATFORM is not set
# CONFIG_SIEMENS_SIMATIC_IPC is not set
# CONFIG_SILICOM_PLATFORM is not set
# CONFIG_WINMATE_FM07_KEYS is not set
# CONFIG_OXP_EC is not set
# CONFIG_TUXEDO_NB04_WMI_AB is not set
CONFIG_P2SB=y
CONFIG_ACPI_WMI=y
# CONFIG_ACPI_WMI_LEGACY_DEVICE_NAMES is not set
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y
# CONFIG_LMK04832 is not set
# CONFIG_COMMON_CLK_MAX9485 is not set
# CONFIG_COMMON_CLK_SI5341 is not set
# CONFIG_COMMON_CLK_SI5351 is not set
# CONFIG_COMMON_CLK_SI514 is not set
# CONFIG_COMMON_CLK_SI544 is not set
# CONFIG_COMMON_CLK_SI570 is not set
# CONFIG_COMMON_CLK_CDCE706 is not set
# CONFIG_COMMON_CLK_CDCE925 is not set
# CONFIG_COMMON_CLK_CS2000_CP is not set
# CONFIG_CLK_TWL is not set
# CONFIG_COMMON_CLK_AXI_CLKGEN is not set
# CONFIG_COMMON_CLK_RS9_PCIE is not set
# CONFIG_COMMON_CLK_SI521XX is not set
# CONFIG_COMMON_CLK_VC3 is not set
# CONFIG_COMMON_CLK_VC5 is not set
# CONFIG_COMMON_CLK_VC7 is not set
# CONFIG_COMMON_CLK_FIXED_MMIO is not set
# CONFIG_CLK_LGM_CGU is not set
# CONFIG_XILINX_VCU is not set
# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set
# CONFIG_HWSPINLOCK is not set

#
# Clock Source drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# end of Clock Source drivers

CONFIG_MAILBOX=y
# CONFIG_PLATFORM_MHU is not set
CONFIG_PCC=y
# CONFIG_ALTERA_MBOX is not set
# CONFIG_MAILBOX_TEST is not set
CONFIG_IOMMU_IOVA=y
CONFIG_IOMMU_API=y
CONFIG_IOMMUFD_DRIVER=y
CONFIG_IOMMU_SUPPORT=y

#
# Generic IOMMU Pagetable Support
#
# end of Generic IOMMU Pagetable Support

# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set
CONFIG_IOMMU_DEFAULT_DMA_LAZY=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_OF_IOMMU=y
CONFIG_IOMMU_DMA=y
CONFIG_IOMMU_SVA=y
CONFIG_IOMMU_IOPF=y
CONFIG_AMD_IOMMU=y
CONFIG_DMAR_TABLE=y
CONFIG_INTEL_IOMMU=y
CONFIG_INTEL_IOMMU_SVM=y
CONFIG_INTEL_IOMMU_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_PERF_EVENTS=y
CONFIG_IOMMUFD_DRIVER_CORE=y
CONFIG_IOMMUFD=y
CONFIG_IOMMUFD_TEST=y
CONFIG_IRQ_REMAP=y
# CONFIG_VIRTIO_IOMMU is not set
CONFIG_GENERIC_PT=y
CONFIG_DEBUG_GENERIC_PT=y
CONFIG_IOMMU_PT=y
CONFIG_IOMMU_PT_AMDV1=y
CONFIG_IOMMU_PT_VTDSS=y
CONFIG_IOMMU_PT_X86_64=y

#
# Remoteproc drivers
#
# CONFIG_REMOTEPROC is not set
# end of Remoteproc drivers

#
# Rpmsg drivers
#
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
# CONFIG_RPMSG_VIRTIO is not set
# end of Rpmsg drivers

CONFIG_SOUNDWIRE=y

#
# SoundWire Devices
#
# CONFIG_SOUNDWIRE_AMD is not set
# CONFIG_SOUNDWIRE_INTEL is not set
# CONFIG_SOUNDWIRE_QCOM is not set

#
# SOC (System On Chip) specific Drivers
#

#
# Amlogic SoC drivers
#
# end of Amlogic SoC drivers

#
# Broadcom SoC drivers
#
# end of Broadcom SoC drivers

#
# NXP/Freescale QorIQ SoC drivers
#
# end of NXP/Freescale QorIQ SoC drivers

#
# fujitsu SoC drivers
#
# end of fujitsu SoC drivers

#
# i.MX SoC drivers
#
# end of i.MX SoC drivers

#
# Enable LiteX SoC Builder specific drivers
#
# CONFIG_LITEX_SOC_CONTROLLER is not set
# end of Enable LiteX SoC Builder specific drivers

# CONFIG_WPCM450_SOC is not set

#
# Qualcomm SoC drivers
#
CONFIG_QCOM_QMI_HELPERS=y
# end of Qualcomm SoC drivers

# CONFIG_SOC_TI is not set

#
# Xilinx SoC drivers
#
# end of Xilinx SoC drivers
# end of SOC (System On Chip) specific Drivers

#
# PM Domains
#

#
# Amlogic PM Domains
#
# end of Amlogic PM Domains

#
# Broadcom PM Domains
#
# end of Broadcom PM Domains

#
# i.MX PM Domains
#
# end of i.MX PM Domains

#
# Qualcomm PM Domains
#
# end of Qualcomm PM Domains
# end of PM Domains

# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_ADC_JACK is not set
# CONFIG_EXTCON_FSA9480 is not set
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_INTEL_INT3496 is not set
CONFIG_EXTCON_INTEL_CHT_WC=y
# CONFIG_EXTCON_LC824206XA is not set
# CONFIG_EXTCON_MAX3355 is not set
# CONFIG_EXTCON_MAX14526 is not set
CONFIG_EXTCON_PTN5150=y
# CONFIG_EXTCON_RT8973A is not set
# CONFIG_EXTCON_SM5502 is not set
# CONFIG_EXTCON_USB_GPIO is not set
CONFIG_EXTCON_USBC_TUSB320=y
# CONFIG_MEMORY is not set
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
# CONFIG_IIO_BUFFER_CB is not set
# CONFIG_IIO_BUFFER_DMA is not set
# CONFIG_IIO_BUFFER_DMAENGINE is not set
# CONFIG_IIO_BUFFER_HW_CONSUMER is not set
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_TRIGGERED_BUFFER=y
# CONFIG_IIO_CONFIGFS is not set
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_IIO_SW_DEVICE is not set
# CONFIG_IIO_SW_TRIGGER is not set
# CONFIG_IIO_TRIGGERED_EVENT is not set

#
# Accelerometers
#
# CONFIG_ADIS16201 is not set
# CONFIG_ADIS16209 is not set
# CONFIG_ADXL313_I2C is not set
# CONFIG_ADXL313_SPI is not set
# CONFIG_ADXL345_I2C is not set
# CONFIG_ADXL345_SPI is not set
# CONFIG_ADXL355_I2C is not set
# CONFIG_ADXL355_SPI is not set
# CONFIG_ADXL367_SPI is not set
# CONFIG_ADXL367_I2C is not set
# CONFIG_ADXL372_SPI is not set
# CONFIG_ADXL372_I2C is not set
# CONFIG_ADXL380_SPI is not set
# CONFIG_ADXL380_I2C is not set
# CONFIG_BMA180 is not set
# CONFIG_BMA220 is not set
# CONFIG_BMA400 is not set
# CONFIG_BMC150_ACCEL is not set
# CONFIG_BMI088_ACCEL is not set
# CONFIG_DA280 is not set
# CONFIG_DA311 is not set
# CONFIG_DMARD06 is not set
# CONFIG_DMARD09 is not set
# CONFIG_DMARD10 is not set
# CONFIG_FXLS8962AF_I2C is not set
# CONFIG_FXLS8962AF_SPI is not set
CONFIG_HID_SENSOR_ACCEL_3D=y
# CONFIG_IIO_ST_ACCEL_3AXIS is not set
# CONFIG_IIO_KX022A_SPI is not set
# CONFIG_IIO_KX022A_I2C is not set
# CONFIG_KXSD9 is not set
# CONFIG_KXCJK1013 is not set
# CONFIG_MC3230 is not set
# CONFIG_MMA7455_I2C is not set
# CONFIG_MMA7455_SPI is not set
# CONFIG_MMA7660 is not set
# CONFIG_MMA8452 is not set
# CONFIG_MMA9551 is not set
# CONFIG_MMA9553 is not set
# CONFIG_MSA311 is not set
# CONFIG_MXC4005 is not set
# CONFIG_MXC6255 is not set
# CONFIG_SCA3000 is not set
# CONFIG_SCA3300 is not set
# CONFIG_STK8312 is not set
# CONFIG_STK8BA50 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD4000 is not set
# CONFIG_AD4030 is not set
# CONFIG_AD4080 is not set
# CONFIG_AD4130 is not set
# CONFIG_AD4170_4 is not set
# CONFIG_AD4695 is not set
# CONFIG_AD7091R5 is not set
# CONFIG_AD7091R8 is not set
# CONFIG_AD7124 is not set
# CONFIG_AD7173 is not set
# CONFIG_AD7191 is not set
# CONFIG_AD7192 is not set
# CONFIG_AD7266 is not set
# CONFIG_AD7280 is not set
# CONFIG_AD7291 is not set
# CONFIG_AD7292 is not set
# CONFIG_AD7298 is not set
# CONFIG_AD7380 is not set
# CONFIG_AD7476 is not set
# CONFIG_AD7606_IFACE_PARALLEL is not set
# CONFIG_AD7606_IFACE_SPI is not set
# CONFIG_AD7766 is not set
# CONFIG_AD7768_1 is not set
# CONFIG_AD7779 is not set
# CONFIG_AD7780 is not set
# CONFIG_AD7791 is not set
# CONFIG_AD7793 is not set
# CONFIG_AD7887 is not set
# CONFIG_AD7923 is not set
# CONFIG_AD7944 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
# CONFIG_AD9467 is not set
# CONFIG_ADE9000 is not set
# CONFIG_CC10001_ADC is not set
CONFIG_DLN2_ADC=y
# CONFIG_ENVELOPE_DETECTOR is not set
# CONFIG_GEHC_PMC_ADC is not set
# CONFIG_HI8435 is not set
# CONFIG_HX711 is not set
# CONFIG_INA2XX_ADC is not set
# CONFIG_LTC2309 is not set
# CONFIG_LTC2471 is not set
# CONFIG_LTC2485 is not set
# CONFIG_LTC2496 is not set
# CONFIG_LTC2497 is not set
# CONFIG_MAX1027 is not set
# CONFIG_MAX11100 is not set
# CONFIG_MAX1118 is not set
# CONFIG_MAX11205 is not set
# CONFIG_MAX11410 is not set
# CONFIG_MAX1241 is not set
# CONFIG_MAX1363 is not set
# CONFIG_MAX14001 is not set
# CONFIG_MAX34408 is not set
# CONFIG_MAX9611 is not set
# CONFIG_MCP320X is not set
# CONFIG_MCP3422 is not set
# CONFIG_MCP3564 is not set
# CONFIG_MCP3911 is not set
# CONFIG_MEDIATEK_MT6360_ADC is not set
# CONFIG_MEDIATEK_MT6370_ADC is not set
# CONFIG_NAU7802 is not set
# CONFIG_NCT7201 is not set
# CONFIG_PAC1921 is not set
# CONFIG_PAC1934 is not set
# CONFIG_ROHM_BD79112 is not set
# CONFIG_ROHM_BD79124 is not set
# CONFIG_RICHTEK_RTQ6056 is not set
# CONFIG_SD_ADC_MODULATOR is not set
# CONFIG_TI_ADC081C is not set
# CONFIG_TI_ADC0832 is not set
# CONFIG_TI_ADC084S021 is not set
# CONFIG_TI_ADC108S102 is not set
# CONFIG_TI_ADC12138 is not set
# CONFIG_TI_ADC128S052 is not set
# CONFIG_TI_ADC161S626 is not set
# CONFIG_TI_ADS1015 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1119 is not set
# CONFIG_TI_ADS124S08 is not set
# CONFIG_TI_ADS1298 is not set
# CONFIG_TI_ADS131E08 is not set
# CONFIG_TI_ADS7138 is not set
# CONFIG_TI_ADS7924 is not set
# CONFIG_TI_ADS7950 is not set
# CONFIG_TI_ADS8344 is not set
# CONFIG_TI_ADS8688 is not set
# CONFIG_TI_LMP92064 is not set
# CONFIG_TI_TLC4541 is not set
# CONFIG_TI_TSC2046 is not set
# CONFIG_TWL4030_MADC is not set
# CONFIG_TWL6030_GPADC is not set
# CONFIG_VF610_ADC is not set
CONFIG_VIPERBOARD_ADC=y
# CONFIG_XILINX_XADC is not set
# end of Analog to digital converters

#
# Analog to digital and digital to analog converters
#
# CONFIG_AD74115 is not set
# CONFIG_AD74413R is not set
# end of Analog to digital and digital to analog converters

#
# Analog Front Ends
#
# CONFIG_IIO_RESCALE is not set
# end of Analog Front Ends

#
# Amplifiers
#
# CONFIG_AD8366 is not set
# CONFIG_ADA4250 is not set
# CONFIG_HMC425 is not set
# end of Amplifiers

#
# Capacitance to digital converters
#
# CONFIG_AD7150 is not set
# CONFIG_AD7746 is not set
# end of Capacitance to digital converters

#
# Chemical Sensors
#
# CONFIG_AOSONG_AGS02MA is not set
# CONFIG_ATLAS_PH_SENSOR is not set
# CONFIG_ATLAS_EZO_SENSOR is not set
# CONFIG_BME680 is not set
# CONFIG_CCS811 is not set
# CONFIG_ENS160 is not set
# CONFIG_IAQCORE is not set
# CONFIG_MHZ19B is not set
# CONFIG_PMS7003 is not set
# CONFIG_SCD30_CORE is not set
# CONFIG_SCD4X is not set
# CONFIG_SEN0322 is not set
# CONFIG_SENSIRION_SGP30 is not set
# CONFIG_SENSIRION_SGP40 is not set
# CONFIG_SPS30_I2C is not set
# CONFIG_SPS30_SERIAL is not set
# CONFIG_SENSEAIR_SUNRISE_CO2 is not set
# CONFIG_VZ89X is not set
# end of Chemical Sensors

#
# Hid Sensor IIO Common
#
CONFIG_HID_SENSOR_IIO_COMMON=y
CONFIG_HID_SENSOR_IIO_TRIGGER=y
# end of Hid Sensor IIO Common

#
# IIO SCMI Sensors
#
# end of IIO SCMI Sensors

#
# SSP Sensor Common
#
# CONFIG_IIO_SSP_SENSORHUB is not set
# end of SSP Sensor Common

#
# Digital to analog converters
#
# CONFIG_AD3530R is not set
# CONFIG_AD3552R_HS is not set
# CONFIG_AD3552R is not set
# CONFIG_AD5064 is not set
# CONFIG_AD5360 is not set
# CONFIG_AD5380 is not set
# CONFIG_AD5421 is not set
# CONFIG_AD5446_SPI is not set
# CONFIG_AD5446_I2C is not set
# CONFIG_AD5449 is not set
# CONFIG_AD5592R is not set
# CONFIG_AD5593R is not set
# CONFIG_AD5504 is not set
# CONFIG_AD5624R_SPI is not set
# CONFIG_AD9739A is not set
# CONFIG_LTC2688 is not set
# CONFIG_AD5686_SPI is not set
# CONFIG_AD5696_I2C is not set
# CONFIG_AD5755 is not set
# CONFIG_AD5758 is not set
# CONFIG_AD5761 is not set
# CONFIG_AD5764 is not set
# CONFIG_AD5766 is not set
# CONFIG_AD5770R is not set
# CONFIG_AD5791 is not set
# CONFIG_AD7293 is not set
# CONFIG_AD7303 is not set
# CONFIG_AD8460 is not set
# CONFIG_AD8801 is not set
# CONFIG_BD79703 is not set
# CONFIG_CIO_DAC is not set
# CONFIG_DPOT_DAC is not set
# CONFIG_DS4424 is not set
# CONFIG_LTC1660 is not set
# CONFIG_LTC2632 is not set
# CONFIG_LTC2664 is not set
# CONFIG_M62332 is not set
# CONFIG_MAX517 is not set
# CONFIG_MAX5522 is not set
# CONFIG_MAX5821 is not set
# CONFIG_MCP4725 is not set
# CONFIG_MCP4728 is not set
# CONFIG_MCP4821 is not set
# CONFIG_MCP4922 is not set
# CONFIG_TI_DAC082S085 is not set
# CONFIG_TI_DAC5571 is not set
# CONFIG_TI_DAC7311 is not set
# CONFIG_TI_DAC7612 is not set
# CONFIG_VF610_DAC is not set
# end of Digital to analog converters

#
# IIO dummy driver
#
# end of IIO dummy driver

#
# Filters
#
# CONFIG_ADMV8818 is not set
# end of Filters

#
# Frequency Synthesizers DDS/PLL
#

#
# Clock Generator/Distribution
#
# CONFIG_AD9523 is not set
# end of Clock Generator/Distribution

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF4350 is not set
# CONFIG_ADF4371 is not set
# CONFIG_ADF4377 is not set
# CONFIG_ADMFM2000 is not set
# CONFIG_ADMV1013 is not set
# CONFIG_ADMV1014 is not set
# CONFIG_ADMV4420 is not set
# CONFIG_ADRF6780 is not set
# end of Phase-Locked Loop (PLL) frequency synthesizers
# end of Frequency Synthesizers DDS/PLL

#
# Digital gyroscope sensors
#
# CONFIG_ADIS16080 is not set
# CONFIG_ADIS16130 is not set
# CONFIG_ADIS16136 is not set
# CONFIG_ADIS16260 is not set
# CONFIG_ADXRS290 is not set
# CONFIG_ADXRS450 is not set
# CONFIG_BMG160 is not set
# CONFIG_FXAS21002C is not set
CONFIG_HID_SENSOR_GYRO_3D=y
# CONFIG_MPU3050_I2C is not set
# CONFIG_IIO_ST_GYRO_3AXIS is not set
# CONFIG_ITG3200 is not set
# end of Digital gyroscope sensors

#
# Health Sensors
#

#
# Heart Rate Monitors
#
# CONFIG_AFE4403 is not set
# CONFIG_AFE4404 is not set
# CONFIG_MAX30100 is not set
# CONFIG_MAX30102 is not set
# end of Heart Rate Monitors
# end of Health Sensors

#
# Humidity sensors
#
# CONFIG_AM2315 is not set
# CONFIG_DHT11 is not set
# CONFIG_ENS210 is not set
# CONFIG_HDC100X is not set
# CONFIG_HDC2010 is not set
# CONFIG_HDC3020 is not set
CONFIG_HID_SENSOR_HUMIDITY=y
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_SI7005 is not set
# CONFIG_SI7020 is not set
# end of Humidity sensors

#
# Inertial measurement units
#
# CONFIG_ADIS16400 is not set
# CONFIG_ADIS16460 is not set
# CONFIG_ADIS16475 is not set
# CONFIG_ADIS16480 is not set
# CONFIG_ADIS16550 is not set
# CONFIG_BMI160_I2C is not set
# CONFIG_BMI160_SPI is not set
# CONFIG_BMI270_I2C is not set
# CONFIG_BMI270_SPI is not set
# CONFIG_BMI323_I2C is not set
# CONFIG_BMI323_SPI is not set
# CONFIG_BOSCH_BNO055_SERIAL is not set
# CONFIG_BOSCH_BNO055_I2C is not set
# CONFIG_FXOS8700_I2C is not set
# CONFIG_FXOS8700_SPI is not set
# CONFIG_KMX61 is not set
# CONFIG_INV_ICM42600_I2C is not set
# CONFIG_INV_ICM42600_SPI is not set
# CONFIG_INV_ICM45600_I2C is not set
# CONFIG_INV_ICM45600_SPI is not set
# CONFIG_INV_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_SPI is not set
# CONFIG_SMI240 is not set
# CONFIG_SMI330_I2C is not set
# CONFIG_SMI330_SPI is not set
# CONFIG_IIO_ST_LSM6DSX is not set
# CONFIG_IIO_ST_LSM9DS0 is not set
# end of Inertial measurement units

#
# Light sensors
#
# CONFIG_ACPI_ALS is not set
# CONFIG_ADJD_S311 is not set
# CONFIG_ADUX1020 is not set
# CONFIG_AL3000A is not set
# CONFIG_AL3010 is not set
# CONFIG_AL3320A is not set
# CONFIG_APDS9160 is not set
# CONFIG_APDS9300 is not set
# CONFIG_APDS9306 is not set
# CONFIG_APDS9960 is not set
# CONFIG_AS73211 is not set
# CONFIG_BH1745 is not set
# CONFIG_BH1750 is not set
# CONFIG_BH1780 is not set
# CONFIG_CM32181 is not set
# CONFIG_CM3232 is not set
# CONFIG_CM3323 is not set
# CONFIG_CM3605 is not set
# CONFIG_CM36651 is not set
# CONFIG_GP2AP002 is not set
# CONFIG_GP2AP020A00F is not set
# CONFIG_SENSORS_ISL29018 is not set
# CONFIG_SENSORS_ISL29028 is not set
# CONFIG_ISL29125 is not set
# CONFIG_ISL76682 is not set
CONFIG_HID_SENSOR_ALS=y
CONFIG_HID_SENSOR_PROX=y
# CONFIG_JSA1212 is not set
# CONFIG_ROHM_BU27034 is not set
# CONFIG_RPR0521 is not set
# CONFIG_LTR390 is not set
# CONFIG_LTR501 is not set
# CONFIG_LTRF216A is not set
# CONFIG_LV0104CS is not set
# CONFIG_MAX44000 is not set
# CONFIG_MAX44009 is not set
# CONFIG_NOA1305 is not set
# CONFIG_OPT3001 is not set
# CONFIG_OPT4001 is not set
# CONFIG_OPT4060 is not set
# CONFIG_PA12203001 is not set
# CONFIG_SI1133 is not set
# CONFIG_SI1145 is not set
# CONFIG_STK3310 is not set
# CONFIG_ST_UVIS25 is not set
# CONFIG_TCS3414 is not set
# CONFIG_TCS3472 is not set
# CONFIG_SENSORS_TSL2563 is not set
# CONFIG_TSL2583 is not set
# CONFIG_TSL2591 is not set
# CONFIG_TSL2772 is not set
# CONFIG_TSL4531 is not set
# CONFIG_US5182D is not set
# CONFIG_VCNL4000 is not set
# CONFIG_VCNL4035 is not set
# CONFIG_VEML3235 is not set
# CONFIG_VEML6030 is not set
# CONFIG_VEML6040 is not set
# CONFIG_VEML6046X00 is not set
# CONFIG_VEML6070 is not set
# CONFIG_VEML6075 is not set
# CONFIG_VL6180 is not set
# CONFIG_ZOPT2201 is not set
# end of Light sensors

#
# Magnetometer sensors
#
# CONFIG_AF8133J is not set
# CONFIG_AK8974 is not set
# CONFIG_AK8975 is not set
# CONFIG_AK09911 is not set
# CONFIG_ALS31300 is not set
# CONFIG_BMC150_MAGN_I2C is not set
# CONFIG_BMC150_MAGN_SPI is not set
# CONFIG_MAG3110 is not set
CONFIG_HID_SENSOR_MAGNETOMETER_3D=y
# CONFIG_MMC35240 is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
# CONFIG_INFINEON_TLV493D is not set
# CONFIG_SENSORS_HMC5843_I2C is not set
# CONFIG_SENSORS_HMC5843_SPI is not set
# CONFIG_SENSORS_RM3100_I2C is not set
# CONFIG_SENSORS_RM3100_SPI is not set
# CONFIG_SI7210 is not set
# CONFIG_TI_TMAG5273 is not set
# CONFIG_YAMAHA_YAS530 is not set
# end of Magnetometer sensors

#
# Multiplexers
#
# CONFIG_IIO_MUX is not set
# end of Multiplexers

#
# Inclinometer sensors
#
CONFIG_HID_SENSOR_INCLINOMETER_3D=y
CONFIG_HID_SENSOR_DEVICE_ROTATION=y
# end of Inclinometer sensors

#
# Triggers - standalone
#
# CONFIG_IIO_INTERRUPT_TRIGGER is not set
# CONFIG_IIO_SYSFS_TRIGGER is not set
# end of Triggers - standalone

#
# Linear and angular position sensors
#
CONFIG_HID_SENSOR_CUSTOM_INTEL_HINGE=y
# end of Linear and angular position sensors

#
# Digital potentiometers
#
# CONFIG_AD5110 is not set
# CONFIG_AD5272 is not set
# CONFIG_DS1803 is not set
# CONFIG_MAX5432 is not set
# CONFIG_MAX5481 is not set
# CONFIG_MAX5487 is not set
# CONFIG_MCP4018 is not set
# CONFIG_MCP4131 is not set
# CONFIG_MCP4531 is not set
# CONFIG_MCP41010 is not set
# CONFIG_TPL0102 is not set
# CONFIG_X9250 is not set
# end of Digital potentiometers

#
# Digital potentiostats
#
# CONFIG_LMP91000 is not set
# end of Digital potentiostats

#
# Pressure sensors
#
# CONFIG_ABP060MG is not set
# CONFIG_ROHM_BM1390 is not set
# CONFIG_BMP280 is not set
# CONFIG_DLHL60D is not set
# CONFIG_DPS310 is not set
CONFIG_HID_SENSOR_PRESS=y
# CONFIG_HP03 is not set
# CONFIG_HSC030PA is not set
# CONFIG_ICP10100 is not set
# CONFIG_MPL115_I2C is not set
# CONFIG_MPL115_SPI is not set
# CONFIG_MPL3115 is not set
# CONFIG_MPRLS0025PA is not set
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_SDP500 is not set
# CONFIG_IIO_ST_PRESS is not set
# CONFIG_T5403 is not set
# CONFIG_HP206C is not set
# CONFIG_ZPA2326 is not set
# CONFIG_ADP810 is not set
# end of Pressure sensors

#
# Lightning sensors
#
# CONFIG_AS3935 is not set
# end of Lightning sensors

#
# Proximity and distance sensors
#
# CONFIG_D3323AA is not set
# CONFIG_HX9023S is not set
# CONFIG_IRSD200 is not set
# CONFIG_ISL29501 is not set
# CONFIG_LIDAR_LITE_V2 is not set
# CONFIG_MB1232 is not set
# CONFIG_PING is not set
# CONFIG_RFD77402 is not set
# CONFIG_SRF04 is not set
# CONFIG_SX9310 is not set
# CONFIG_SX9324 is not set
# CONFIG_SX9360 is not set
# CONFIG_SX9500 is not set
# CONFIG_SRF08 is not set
# CONFIG_VCNL3020 is not set
# CONFIG_VL53L0X_I2C is not set
# CONFIG_AW96103 is not set
# end of Proximity and distance sensors

#
# Resolver to digital converters
#
# CONFIG_AD2S90 is not set
# CONFIG_AD2S1200 is not set
# CONFIG_AD2S1210 is not set
# end of Resolver to digital converters

#
# Temperature sensors
#
# CONFIG_LTC2983 is not set
# CONFIG_MAXIM_THERMOCOUPLE is not set
CONFIG_HID_SENSOR_TEMP=y
# CONFIG_MLX90614 is not set
# CONFIG_MLX90632 is not set
# CONFIG_MLX90635 is not set
# CONFIG_TMP006 is not set
# CONFIG_TMP007 is not set
# CONFIG_TMP117 is not set
# CONFIG_TSYS01 is not set
# CONFIG_TSYS02D is not set
# CONFIG_MAX30208 is not set
# CONFIG_MAX31856 is not set
# CONFIG_MAX31865 is not set
# CONFIG_MCP9600 is not set
# end of Temperature sensors

# CONFIG_NTB is not set
# CONFIG_PWM is not set

#
# IRQ chip support
#
CONFIG_IRQCHIP=y
CONFIG_IRQ_MSI_LIB=y
# CONFIG_AL_FIC is not set
# CONFIG_XILINX_INTC is not set
# end of IRQ chip support

# CONFIG_IPACK_BUS is not set
CONFIG_RESET_CONTROLLER=y
# CONFIG_RESET_GPIO is not set
# CONFIG_RESET_INTEL_GW is not set
# CONFIG_RESET_SIMPLE is not set
# CONFIG_RESET_TI_SYSCON is not set
# CONFIG_RESET_TI_TPS380X is not set

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
CONFIG_USB_LGM_PHY=y
# CONFIG_PHY_CAN_TRANSCEIVER is not set
# CONFIG_PHY_NXP_PTN3222 is not set

#
# PHY drivers for Broadcom platforms
#
# CONFIG_BCM_KONA_USB2_PHY is not set
# end of PHY drivers for Broadcom platforms

# CONFIG_PHY_CADENCE_TORRENT is not set
# CONFIG_PHY_CADENCE_DPHY is not set
# CONFIG_PHY_CADENCE_DPHY_RX is not set
# CONFIG_PHY_CADENCE_SIERRA is not set
# CONFIG_PHY_CADENCE_SALVO is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
CONFIG_PHY_CPCAP_USB=y
# CONFIG_PHY_MAPPHONE_MDM6600 is not set
# CONFIG_PHY_OCELOT_SERDES is not set
CONFIG_PHY_QCOM_USB_HS=y
CONFIG_PHY_QCOM_USB_HSIC=y
CONFIG_PHY_SAMSUNG_USB2=y
CONFIG_PHY_TUSB1210=y
# CONFIG_PHY_INTEL_LGM_COMBO is not set
# CONFIG_PHY_INTEL_LGM_EMMC is not set
# end of PHY Subsystem

# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set

#
# Performance monitor support
#
# CONFIG_DWC_PCIE_PMU is not set
# end of Performance monitor support

CONFIG_RAS=y
CONFIG_USB4=y
# CONFIG_USB4_DEBUGFS_WRITE is not set
# CONFIG_USB4_DMA_TEST is not set

#
# Android
#
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder0,binder1"
# end of Android

CONFIG_LIBNVDIMM=y
CONFIG_BLK_DEV_PMEM=y
CONFIG_ND_CLAIM=y
CONFIG_ND_BTT=y
CONFIG_BTT=y
CONFIG_ND_PFN=y
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
CONFIG_OF_PMEM=y
# CONFIG_RAMDAX is not set
CONFIG_NVDIMM_KEYS=y
# CONFIG_NVDIMM_SECURITY_TEST is not set
CONFIG_DAX=y
CONFIG_DEV_DAX=y
# CONFIG_DEV_DAX_PMEM is not set
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
CONFIG_NVMEM_LAYOUTS=y

#
# Layout Types
#
# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set
# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set
# CONFIG_NVMEM_LAYOUT_U_BOOT_ENV is not set
# end of Layout Types

# CONFIG_NVMEM_RMEM is not set
# CONFIG_NVMEM_U_BOOT_ENV is not set

#
# HW tracing support
#
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set
# end of HW tracing support

# CONFIG_FPGA is not set
# CONFIG_FSI is not set
CONFIG_TEE=y
CONFIG_TEE_DMABUF_HEAPS=y
CONFIG_OPTEE_STATIC_PROTMEM_POOL=y
# CONFIG_SIOX is not set
# CONFIG_SLIMBUS is not set
# CONFIG_INTERCONNECT is not set
CONFIG_COUNTER=y
# CONFIG_INTEL_QEP is not set
# CONFIG_INTERRUPT_CNT is not set
CONFIG_MOST=y
CONFIG_MOST_USB_HDM=y
# CONFIG_MOST_CDEV is not set
# CONFIG_MOST_SND is not set
# CONFIG_PECI is not set
# CONFIG_HTE is not set
# end of Device Drivers

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_VALIDATE_FS_PARSER=y
CONFIG_FS_IOMAP=y
CONFIG_FS_STACK=y
CONFIG_BUFFER_HEAD=y
CONFIG_LEGACY_DIRECT_IO=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_JFS_FS=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_JFS_DEBUG=y
# CONFIG_JFS_STATISTICS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_SUPPORT_V4 is not set
# CONFIG_XFS_SUPPORT_ASCII_CI is not set
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_ONLINE_SCRUB is not set
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=y
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=y
CONFIG_OCFS2_FS_STATS=y
# CONFIG_OCFS2_DEBUG_MASKLOG is not set
CONFIG_OCFS2_DEBUG_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
# CONFIG_BTRFS_EXPERIMENTAL is not set
CONFIG_NILFS2_FS=y
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FAULT_INJECTION=y
CONFIG_F2FS_FS_COMPRESSION=y
CONFIG_F2FS_FS_LZO=y
CONFIG_F2FS_FS_LZORLE=y
CONFIG_F2FS_FS_LZ4=y
CONFIG_F2FS_FS_LZ4HC=y
CONFIG_F2FS_FS_ZSTD=y
# CONFIG_F2FS_IOSTAT is not set
# CONFIG_F2FS_UNFAIR_RWSEM is not set
CONFIG_ZONEFS_FS=y
CONFIG_FS_DAX=y
CONFIG_FS_DAX_PMD=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FILE_LOCKING=y
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=y
# CONFIG_FS_ENCRYPTION_INLINE_CRYPT is not set
CONFIG_FS_VERITY=y
CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
CONFIG_VIRTIO_FS=y
CONFIG_FUSE_DAX=y
# CONFIG_FUSE_PASSTHROUGH is not set
# CONFIG_FUSE_IO_URING is not set
CONFIG_OVERLAY_FS=y
CONFIG_OVERLAY_FS_REDIRECT_DIR=y
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
CONFIG_OVERLAY_FS_INDEX=y
# CONFIG_OVERLAY_FS_NFS_EXPORT is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
CONFIG_OVERLAY_FS_DEBUG=y

#
# Caches
#
CONFIG_NETFS_SUPPORT=y
# CONFIG_NETFS_STATS is not set
# CONFIG_NETFS_DEBUG is not set
CONFIG_FSCACHE=y
# CONFIG_FSCACHE_STATS is not set
CONFIG_CACHEFILES=y
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_ERROR_INJECTION is not set
# CONFIG_CACHEFILES_ONDEMAND is not set
# end of Caches

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=y
# end of CD-ROM/DVD Filesystems

#
# DOS/FAT/EXFAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_FAT_DEFAULT_UTF8 is not set
CONFIG_EXFAT_FS=y
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS3_FS=y
# CONFIG_NTFS3_64BIT_CLUSTER is not set
CONFIG_NTFS3_LZX_XPRESS=y
CONFIG_NTFS3_FS_POSIX_ACL=y
# CONFIG_NTFS_FS is not set
# end of DOS/FAT/EXFAT/NT Filesystems

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_PROC_CHILDREN=y
CONFIG_PROC_PID_ARCH_STATUS=y
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_TMPFS_INODE64 is not set
CONFIG_TMPFS_QUOTA=y
CONFIG_ARCH_SUPPORTS_HUGETLBFS=y
CONFIG_HUGETLBFS=y
# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
CONFIG_CONFIGFS_FS=y
# end of Pseudo filesystems

CONFIG_MISC_FILESYSTEMS=y
CONFIG_ORANGEFS_FS=y
CONFIG_ADFS_FS=y
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=y
CONFIG_ECRYPT_FS=y
CONFIG_ECRYPT_FS_MESSAGING=y
CONFIG_HFS_FS=y
CONFIG_HFSPLUS_FS=y
CONFIG_BEFS_FS=y
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=y
CONFIG_EFS_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
# CONFIG_UBIFS_FS_AUTHENTICATION is not set
CONFIG_CRAMFS=y
CONFIG_CRAMFS_BLOCKDEV=y
CONFIG_CRAMFS_MTD=y
CONFIG_SQUASHFS=y
# CONFIG_SQUASHFS_FILE_CACHE is not set
CONFIG_SQUASHFS_FILE_DIRECT=y
CONFIG_SQUASHFS_DECOMP_MULTI=y
# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set
# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set
CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI=y
# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set
# CONFIG_SQUASHFS_MOUNT_DECOMP_THREADS is not set
CONFIG_SQUASHFS_XATTR=y
# CONFIG_SQUASHFS_COMP_CACHE_FULL is not set
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZ4=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_VXFS_FS=y
CONFIG_MINIX_FS=y
CONFIG_OMFS_FS=y
CONFIG_HPFS_FS=y
CONFIG_QNX4FS_FS=y
CONFIG_QNX6FS_FS=y
# CONFIG_QNX6FS_DEBUG is not set
CONFIG_ROMFS_FS=y
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_PSTORE=y
CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240
CONFIG_PSTORE_COMPRESS=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_PMSG is not set
# CONFIG_PSTORE_RAM is not set
# CONFIG_PSTORE_BLK is not set
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
CONFIG_EROFS_FS=y
# CONFIG_EROFS_FS_DEBUG is not set
CONFIG_EROFS_FS_XATTR=y
CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
# CONFIG_EROFS_FS_BACKED_BY_FILE is not set
CONFIG_EROFS_FS_ZIP=y
# CONFIG_EROFS_FS_ZIP_LZMA is not set
# CONFIG_EROFS_FS_ZIP_DEFLATE is not set
# CONFIG_EROFS_FS_ZIP_ZSTD is not set
# CONFIG_EROFS_FS_ZIP_ACCEL is not set
# CONFIG_EROFS_FS_ONDEMAND is not set
# CONFIG_EROFS_FS_PCPU_KTHREAD is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V2 is not set
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_PNFS_FLEXFILE_LAYOUT=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_NFS_V4_1_MIGRATION is not set
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_ROOT_NFS=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
CONFIG_NFS_V4_2_READ_PLUS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V2 is not set
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_FLEXFILELAYOUT=y
CONFIG_NFSD_V4_2_INTER_SSC=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
# CONFIG_NFSD_V4_DELEG_TIMESTAMPS is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
# CONFIG_NFS_LOCALIO is not set
CONFIG_NFS_V4_2_SSC_HELPER=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1 is not set
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_CAMELLIA is not set
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_SUNRPC_XPRT_RDMA is not set
CONFIG_CEPH_FS=y
CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
# CONFIG_CEPH_FS_SECURITY_LABEL is not set
CONFIG_CIFS=y
# CONFIG_CIFS_STATS2 is not set
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SWN_UPCALL=y
CONFIG_CIFS_SMB_DIRECT=y
CONFIG_CIFS_FSCACHE=y
# CONFIG_CIFS_ROOT is not set
# CONFIG_CIFS_COMPRESSION is not set
CONFIG_SMB_SERVER=y
# CONFIG_SMB_SERVER_SMBDIRECT is not set
# CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN is not set
# CONFIG_SMB_SERVER_KERBEROS5 is not set
CONFIG_SMBFS=y
# CONFIG_CODA_FS is not set
CONFIG_AFS_FS=y
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y
# CONFIG_AFS_DEBUG_CURSOR is not set
CONFIG_9P_FS=y
CONFIG_9P_FSCACHE=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_9P_FS_SECURITY=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_ISO8859_3=y
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_MAC_ROMAN=y
CONFIG_NLS_MAC_CELTIC=y
CONFIG_NLS_MAC_CENTEURO=y
CONFIG_NLS_MAC_CROATIAN=y
CONFIG_NLS_MAC_CYRILLIC=y
CONFIG_NLS_MAC_GAELIC=y
CONFIG_NLS_MAC_GREEK=y
CONFIG_NLS_MAC_ICELAND=y
CONFIG_NLS_MAC_INUIT=y
CONFIG_NLS_MAC_ROMANIAN=y
CONFIG_NLS_MAC_TURKISH=y
CONFIG_NLS_UTF8=y
CONFIG_NLS_UCS2_UTILS=y
CONFIG_DLM=y
# CONFIG_DLM_DEBUG is not set
CONFIG_UNICODE=y
CONFIG_IO_WQ=y
# end of File systems

#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_REQUEST_CACHE=y
CONFIG_PERSISTENT_KEYRINGS=y
CONFIG_BIG_KEYS=y
CONFIG_TRUSTED_KEYS=y
# CONFIG_TRUSTED_KEYS_TPM is not set
# CONFIG_TRUSTED_KEYS_TEE is not set

#
# No trust source selected!
#
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_USER_DECRYPTED_DATA is not set
CONFIG_KEY_DH_OPERATIONS=y
CONFIG_KEY_NOTIFICATIONS=y
# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_PROC_MEM_ALWAYS_FORCE=y
# CONFIG_PROC_MEM_FORCE_PTRACE is not set
# CONFIG_PROC_MEM_NO_FORCE is not set
CONFIG_SECURITY=y
CONFIG_HAS_SECURITY_AUDIT=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_INFINIBAND=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
# CONFIG_INTEL_TXT is not set
# CONFIG_STATIC_USERMODEHELPER is not set
# CONFIG_SECURITY_SELINUX is not set
# CONFIG_SECURITY_SMACK is not set
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=64
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=32
CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER=y
CONFIG_SECURITY_TOMOYO_INSECURE_BUILTIN_SETTING=y
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_DEBUG=y
CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS=y
# CONFIG_SECURITY_APPARMOR_DEBUG_MESSAGES is not set
CONFIG_SECURITY_APPARMOR_INTROSPECT_POLICY=y
CONFIG_SECURITY_APPARMOR_HASH=y
CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y
# CONFIG_SECURITY_APPARMOR_EXPORT_BINARY is not set
# CONFIG_SECURITY_APPARMOR_PARANOID_LOAD is not set
# CONFIG_SECURITY_LOADPIN is not set
CONFIG_SECURITY_YAMA=y
CONFIG_SECURITY_SAFESETID=y
CONFIG_SECURITY_LOCKDOWN_LSM=y
CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
CONFIG_SECURITY_LANDLOCK=y
# CONFIG_SECURITY_IPE is not set
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
CONFIG_INTEGRITY_TRUSTED_KEYRING=y
CONFIG_INTEGRITY_AUDIT=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
CONFIG_IMA_LSM_RULES=y
CONFIG_IMA_NG_TEMPLATE=y
# CONFIG_IMA_SIG_TEMPLATE is not set
CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng"
# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set
CONFIG_IMA_DEFAULT_HASH_SHA256=y
# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set
# CONFIG_IMA_DEFAULT_HASH_WP512 is not set
CONFIG_IMA_DEFAULT_HASH="sha256"
CONFIG_IMA_WRITE_POLICY=y
CONFIG_IMA_READ_POLICY=y
CONFIG_IMA_APPRAISE=y
# CONFIG_IMA_ARCH_POLICY is not set
# CONFIG_IMA_APPRAISE_BUILD_POLICY is not set
# CONFIG_IMA_APPRAISE_BOOTPARAM is not set
CONFIG_IMA_APPRAISE_MODSIG=y
# CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY is not set
# CONFIG_IMA_BLACKLIST_KEYRING is not set
# CONFIG_IMA_LOAD_X509 is not set
CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y
CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y
# CONFIG_IMA_DISABLE_HTABLE is not set
CONFIG_EVM=y
CONFIG_EVM_ATTR_FSUUID=y
CONFIG_EVM_ADD_XATTRS=y
# CONFIG_EVM_LOAD_X509 is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_LSM="landlock,lockdown,yama,safesetid,integrity,tomoyo,apparmor,bpf"

#
# Kernel hardening options
#

#
# Memory initialization
#
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
# CONFIG_INIT_STACK_NONE is not set
# CONFIG_INIT_STACK_ALL_PATTERN is not set
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
# CONFIG_ZERO_CALL_USED_REGS is not set
# end of Memory initialization

#
# Bounds checking
#
CONFIG_FORTIFY_SOURCE=y
CONFIG_HARDENED_USERCOPY=y
# CONFIG_HARDENED_USERCOPY_DEFAULT_ON is not set
# end of Bounds checking

#
# Hardening of kernel data structures
#
CONFIG_LIST_HARDENED=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Hardening of kernel data structures

CONFIG_RANDSTRUCT_NONE=y
# end of Kernel hardening options
# end of Security options

CONFIG_XOR_BLOCKS=y
CONFIG_ASYNC_CORE=y
CONFIG_ASYNC_MEMCPY=y
CONFIG_ASYNC_XOR=y
CONFIG_ASYNC_PQ=y
CONFIG_ASYNC_RAID6_RECOV=y
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_SIG=y
CONFIG_CRYPTO_SIG2=y
CONFIG_CRYPTO_SKCIPHER=y
CONFIG_CRYPTO_SKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_AKCIPHER2=y
CONFIG_CRYPTO_AKCIPHER=y
CONFIG_CRYPTO_KPP2=y
CONFIG_CRYPTO_KPP=y
CONFIG_CRYPTO_ACOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_SELFTESTS is not set
# CONFIG_CRYPTO_NULL is not set
CONFIG_CRYPTO_PCRYPT=y
CONFIG_CRYPTO_CRYPTD=y
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_KRB5ENC=y
# CONFIG_CRYPTO_BENCHMARK is not set
CONFIG_CRYPTO_ENGINE=y
# end of Crypto core or helper

#
# Public-key cryptography
#
CONFIG_CRYPTO_RSA=y
CONFIG_CRYPTO_DH=y
# CONFIG_CRYPTO_DH_RFC7919_GROUPS is not set
CONFIG_CRYPTO_ECC=y
CONFIG_CRYPTO_ECDH=y
# CONFIG_CRYPTO_ECDSA is not set
CONFIG_CRYPTO_ECRDSA=y
# end of Public-key cryptography

#
# Block ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_TI=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARIA=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_BLOWFISH_COMMON=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_CAST_COMMON=y
CONFIG_CRYPTO_CAST5=y
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SEED=y
CONFIG_CRYPTO_SERPENT=y
CONFIG_CRYPTO_SM4=y
CONFIG_CRYPTO_SM4_GENERIC=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
# end of Block ciphers

#
# Length-preserving ciphers and modes
#
CONFIG_CRYPTO_ADIANTUM=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_CHACHA20=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_HCTR2=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_PCBC=y
CONFIG_CRYPTO_XCTR=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_NHPOLY1305=y
# end of Length-preserving ciphers and modes

#
# AEAD (authenticated encryption with associated data) ciphers
#
CONFIG_CRYPTO_AEGIS128=y
CONFIG_CRYPTO_CHACHA20POLY1305=y
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_GENIV=y
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ESSIV=y
# end of AEAD (authenticated encryption with associated data) ciphers

#
# Hashes, digests, and MACs
#
CONFIG_CRYPTO_BLAKE2B=y
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_GHASH=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
CONFIG_CRYPTO_MICHAEL_MIC=y
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA3=y
# CONFIG_CRYPTO_SM3_GENERIC is not set
CONFIG_CRYPTO_STREEBOG=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_XCBC=y
CONFIG_CRYPTO_XXHASH=y
# end of Hashes, digests, and MACs

#
# CRCs (cyclic redundancy checks)
#
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# end of CRCs (cyclic redundancy checks)

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_842=y
CONFIG_CRYPTO_LZ4=y
CONFIG_CRYPTO_LZ4HC=y
CONFIG_CRYPTO_ZSTD=y
# end of Compression

#
# Random number generation
#
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_DRBG_HMAC=y
CONFIG_CRYPTO_DRBG_HASH=y
CONFIG_CRYPTO_DRBG_CTR=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
CONFIG_CRYPTO_KDF800108_CTR=y
CONFIG_CRYPTO_DF80090A=y
# end of Random number generation

#
# Userspace interface
#
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
# end of Userspace interface

#
# Accelerated Cryptographic Algorithms for CPU (x86)
#
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_BLOWFISH_X86_64=y
CONFIG_CRYPTO_CAMELLIA_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_CAST5_AVX_X86_64=y
CONFIG_CRYPTO_CAST6_AVX_X86_64=y
CONFIG_CRYPTO_DES3_EDE_X86_64=y
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX2_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=y
CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64=y
# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set
# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set
CONFIG_CRYPTO_AEGIS128_AESNI_SSE2=y
# CONFIG_CRYPTO_NHPOLY1305_SSE2 is not set
# CONFIG_CRYPTO_NHPOLY1305_AVX2 is not set
CONFIG_CRYPTO_SM3_AVX_X86_64=y
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=y
# end of Accelerated Cryptographic Algorithms for CPU (x86)

CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=y
CONFIG_CRYPTO_DEV_PADLOCK_AES=y
CONFIG_CRYPTO_DEV_PADLOCK_SHA=y
# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set
# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set
CONFIG_CRYPTO_DEV_CCP=y
CONFIG_CRYPTO_DEV_CCP_DD=y
# CONFIG_CRYPTO_DEV_SP_CCP is not set
# CONFIG_CRYPTO_DEV_SP_PSP is not set
# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set
CONFIG_CRYPTO_DEV_QAT=y
CONFIG_CRYPTO_DEV_QAT_DH895xCC=y
CONFIG_CRYPTO_DEV_QAT_C3XXX=y
CONFIG_CRYPTO_DEV_QAT_C62X=y
# CONFIG_CRYPTO_DEV_QAT_4XXX is not set
# CONFIG_CRYPTO_DEV_QAT_420XX is not set
# CONFIG_CRYPTO_DEV_QAT_6XXX is not set
CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=y
CONFIG_CRYPTO_DEV_QAT_C3XXXVF=y
CONFIG_CRYPTO_DEV_QAT_C62XVF=y
# CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION is not set
CONFIG_CRYPTO_DEV_VIRTIO=y
# CONFIG_CRYPTO_DEV_SAFEXCEL is not set
# CONFIG_CRYPTO_DEV_CCREE is not set
# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS8_PRIVATE_KEY_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
CONFIG_PKCS7_TEST_KEY=y
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
# CONFIG_FIPS_SIGNATURE_SELFTEST is not set

#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
CONFIG_MODULE_SIG_KEY_TYPE_RSA=y
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""
# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
CONFIG_SECONDARY_TRUSTED_KEYRING=y
# CONFIG_SECONDARY_TRUSTED_KEYRING_SIGNED_BY_BUILTIN is not set
# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set
# end of Certificates for signature checking

CONFIG_CRYPTO_KRB5=y
# CONFIG_CRYPTO_KRB5_SELFTESTS is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_RAID6_PQ=y
# CONFIG_RAID6_PQ_BENCHMARK is not set
CONFIG_LINEAR_RANGES=y
# CONFIG_PACKING is not set
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
# CONFIG_CORDIC is not set
# CONFIG_PRIME_NUMBERS is not set
CONFIG_RATIONAL=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y
CONFIG_CRC8=y
CONFIG_CRC16=y
CONFIG_CRC_CCITT=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_T10DIF_ARCH=y
CONFIG_CRC32=y
CONFIG_CRC32_ARCH=y
CONFIG_CRC64=y
CONFIG_CRC64_ARCH=y
CONFIG_CRC_OPTIMIZATIONS=y

#
# Crypto library routines
#
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_BLAKE2B=y
CONFIG_CRYPTO_LIB_BLAKE2S_ARCH=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CURVE25519_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_LIB_MD5=y
CONFIG_CRYPTO_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
CONFIG_CRYPTO_LIB_POLYVAL=y
CONFIG_CRYPTO_LIB_POLYVAL_ARCH=y
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA1_ARCH=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_LIB_SHA256_ARCH=y
CONFIG_CRYPTO_LIB_SHA512=y
CONFIG_CRYPTO_LIB_SHA512_ARCH=y
CONFIG_CRYPTO_LIB_SHA3=y
CONFIG_CRYPTO_LIB_SM3=y
# end of Crypto library routines

CONFIG_XXHASH=y
# CONFIG_RANDOM32_SELFTEST is not set
CONFIG_842_COMPRESS=y
CONFIG_842_DECOMPRESS=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_COMPRESS=y
CONFIG_LZ4HC_COMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_ZSTD_COMMON=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_ARM64=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_RISCV=y
# CONFIG_XZ_DEC_MICROLZMA is not set
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=y
CONFIG_DECOMPRESS_ZSTD=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_DEC8=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=y
CONFIG_TEXTSEARCH_BM=y
CONFIG_TEXTSEARCH_FSM=y
CONFIG_INTERVAL_TREE=y
CONFIG_INTERVAL_TREE_SPAN_ITER=y
CONFIG_XARRAY_MULTI=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_CLOSURES=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_DMA_OPS_HELPERS=y
CONFIG_NEED_SG_DMA_FLAGS=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DMA_DECLARE_COHERENT=y
CONFIG_SWIOTLB=y
# CONFIG_SWIOTLB_DYNAMIC is not set
CONFIG_DMA_NEED_SYNC=y
# CONFIG_DMA_RESTRICTED_POOL is not set
CONFIG_DMA_CMA=y
# CONFIG_DMA_NUMA_CMA is not set

#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CMA_SIZE_PERCENTAGE=0
# CONFIG_CMA_SIZE_SEL_MBYTES is not set
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
CONFIG_CMA_SIZE_SEL_MAX=y
CONFIG_CMA_ALIGNMENT=8
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_MAP_BENCHMARK is not set
CONFIG_SGL_ALLOC=y
CONFIG_CHECK_SIGNATURE=y
# CONFIG_CPUMASK_OFFSTACK is not set
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_GLOB=y
# CONFIG_GLOB_SELFTEST is not set
CONFIG_NLATTR=y
CONFIG_CLZ_TAB=y
CONFIG_IRQ_POLL=y
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_DIMLIB=y
CONFIG_LIBFDT=y
CONFIG_OID_REGISTRY=y
CONFIG_HAVE_GENERIC_VDSO=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y
CONFIG_VDSO_GETRANDOM=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_SG_POOL=y
CONFIG_ARCH_HAS_PMEM_API=y
CONFIG_MEMREGION=y
CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y
CONFIG_ARCH_HAS_COPY_MC=y
CONFIG_ARCH_STACKWALK=y
CONFIG_STACKDEPOT=y
CONFIG_STACKDEPOT_ALWAYS_INIT=y
CONFIG_STACKDEPOT_MAX_FRAMES=64
CONFIG_REF_TRACKER=y
CONFIG_SBITMAP=y
# CONFIG_LWQ_TEST is not set
# end of Library routines

CONFIG_FIRMWARE_TABLE=y
CONFIG_UNION_FIND=y

#
# Kernel hacking
#

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_PRINTK_CALLER=y
# CONFIG_STACKTRACE_BUILD_ID is not set
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
CONFIG_CONSOLE_LOGLEVEL_QUIET=4
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y
CONFIG_SYMBOLIC_ERRNAME=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_BUGVERBOSE_DETAILED=y
# end of printk and dmesg options

CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y

#
# Compile-time checks and compiler options
#
CONFIG_DEBUG_INFO=y
CONFIG_AS_HAS_NON_CONST_ULEB128=y
# CONFIG_DEBUG_INFO_NONE is not set
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
CONFIG_DEBUG_INFO_DWARF4=y
# CONFIG_DEBUG_INFO_DWARF5 is not set
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZSTD is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_BTF is not set
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_HEADERS_INSTALL is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set
CONFIG_OBJTOOL=y
# CONFIG_OBJTOOL_WERROR is not set
CONFIG_NOINSTR_VALIDATION=y
# CONFIG_VMLINUX_MAP is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# end of Compile-time checks and compiler options

#
# Generic Kernel Debugging Instruments
#
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARCH_HAS_UBSAN=y
CONFIG_UBSAN=y
# CONFIG_UBSAN_TRAP is not set
CONFIG_CC_HAS_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_DIV_ZERO is not set
# CONFIG_UBSAN_BOOL is not set
# CONFIG_UBSAN_ENUM is not set
# CONFIG_UBSAN_ALIGNMENT is not set
# CONFIG_TEST_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y
# end of Generic Kernel Debugging Instruments

#
# Networking Debugging
#
CONFIG_NET_DEV_REFCNT_TRACKER=y
CONFIG_NET_NS_REFCNT_TRACKER=y
CONFIG_DEBUG_NET=y
# CONFIG_DEBUG_NET_SMALL_RTNL is not set
# end of Networking Debugging

#
# Memory Debugging
#
CONFIG_PAGE_EXTENSION=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_RCU_DEBUG=y
CONFIG_PAGE_OWNER=y
CONFIG_PAGE_TABLE_CHECK=y
CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_ARCH_HAS_DEBUG_WX=y
CONFIG_DEBUG_WX=y
CONFIG_ARCH_HAS_PTDUMP=y
CONFIG_PTDUMP=y
CONFIG_PTDUMP_DEBUGFS=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_PER_VMA_LOCK_STATS is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y
CONFIG_DEBUG_OBJECTS_WORK=y
CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
# CONFIG_SHRINKER_DEBUG is not set
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y
CONFIG_DEBUG_VFS=y
CONFIG_DEBUG_VM_IRQSOFF=y
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VM_MAPLE_TREE=y
CONFIG_DEBUG_VM_RB=y
CONFIG_DEBUG_VM_PGFLAGS=y
CONFIG_DEBUG_VM_PGTABLE=y
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_DEBUG_KMAP_LOCAL=y
CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y
CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP=y
# CONFIG_MEM_ALLOC_PROFILING is not set
CONFIG_HAVE_ARCH_KASAN=y
CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CC_HAS_KASAN_SW_TAGS=y
CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
CONFIG_KASAN=y
CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX=y
CONFIG_KASAN_GENERIC=y
# CONFIG_KASAN_OUTLINE is not set
CONFIG_KASAN_INLINE=y
CONFIG_KASAN_STACK=y
CONFIG_KASAN_VMALLOC=y
# CONFIG_KASAN_EXTRA_INFO is not set
CONFIG_HAVE_ARCH_KFENCE=y
CONFIG_KFENCE=y
CONFIG_KFENCE_SAMPLE_INTERVAL=100
CONFIG_KFENCE_NUM_OBJECTS=255
# CONFIG_KFENCE_DEFERRABLE is not set
CONFIG_KFENCE_STATIC_KEYS=y
CONFIG_KFENCE_STRESS_TEST_FAULTS=0
CONFIG_HAVE_ARCH_KMSAN=y
# end of Memory Debugging

# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Oops, Lockups and Hangs
#
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=86400
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM is not set
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set
CONFIG_HARDLOCKUP_DETECTOR_PERF=y
# CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set
# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set
CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=140
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=1
# CONFIG_DETECT_HUNG_TASK_BLOCKER is not set
CONFIG_WQ_WATCHDOG=y
# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set
# CONFIG_TEST_LOCKUP is not set
# end of Debug Oops, Lockups and Hangs

#
# Scheduler Debugging
#
CONFIG_SCHED_INFO=y
CONFIG_SCHEDSTATS=y
# end of Scheduler Debugging

CONFIG_DEBUG_PREEMPT=y

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RAW_LOCK_NESTING=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_RWSEMS=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_LOCKDEP=y
CONFIG_LOCKDEP_BITS=20
CONFIG_LOCKDEP_CHAINS_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_WW_MUTEX_SELFTEST is not set
# CONFIG_SCF_TORTURE_TEST is not set
CONFIG_CSD_LOCK_WAIT_DEBUG=y
# CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT is not set
# end of Lock Debugging (spinlocks, mutexes, etc...)

CONFIG_TRACE_IRQFLAGS=y
CONFIG_TRACE_IRQFLAGS_NMI=y
CONFIG_NMI_CHECK_CPU=y
CONFIG_DEBUG_IRQFLAGS=y
CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_KOBJECT_RELEASE is not set

#
# Debug kernel data structures
#
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_PLIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
# CONFIG_DEBUG_CLOSURES is not set
CONFIG_DEBUG_MAPLE_TREE=y
# end of Debug kernel data structures

#
# RCU Debugging
#
CONFIG_PROVE_RCU=y
# CONFIG_RCU_SCALE_TEST is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_REF_SCALE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=100
CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0
# CONFIG_RCU_CPU_STALL_CPUTIME is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_EQS_DEBUG=y
# end of RCU Debugging

# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
# CONFIG_LATENCYTOP is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_REGS_HAVING_PT_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_JMP=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_OBJTOOL_MCOUNT=y
CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_TRACEFS_AUTOMOUNT_DEPRECATED=y
# CONFIG_BOOTTIME_TRACING is not set
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_PREEMPT_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_HWLAT_TRACER is not set
# CONFIG_OSNOISE_TRACER is not set
# CONFIG_TIMERLAT_TRACER is not set
# CONFIG_MMIOTRACE is not set
# CONFIG_FTRACE_SYSCALLS is not set
# CONFIG_TRACER_SNAPSHOT is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_UPROBE_EVENTS=y
CONFIG_EPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_DYNAMIC_EVENTS=y
CONFIG_PROBE_EVENTS=y
# CONFIG_SYNTH_EVENTS is not set
# CONFIG_USER_EVENTS is not set
# CONFIG_HIST_TRIGGERS is not set
CONFIG_TRACE_EVENT_INJECT=y
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS=y
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
# CONFIG_RV is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_SAMPLES is not set
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
# CONFIG_STRICT_DEVMEM is not set

#
# x86 Debugging
#
CONFIG_EARLY_PRINTK_USB=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_EARLY_PRINTK_USB_XDBC is not set
# CONFIG_DEBUG_TLBFLUSH is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEBUG_BOOT_PARAMS=y
# CONFIG_CPA_DEBUG is not set
CONFIG_DEBUG_ENTRY=y
# CONFIG_DEBUG_NMI_SELFTEST is not set
CONFIG_X86_DEBUG_FPU=y
# CONFIG_PUNIT_ATOM_DEBUG is not set
CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
# end of x86 Debugging

#
# Kernel Testing and Coverage
#
# CONFIG_KUNIT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
CONFIG_FAULT_INJECTION=y
CONFIG_FAILSLAB=y
CONFIG_FAIL_PAGE_ALLOC=y
CONFIG_FAULT_INJECTION_USERCOPY=y
CONFIG_FAIL_MAKE_REQUEST=y
CONFIG_FAIL_IO_TIMEOUT=y
CONFIG_FAIL_FUTEX=y
CONFIG_FAULT_INJECTION_DEBUG_FS=y
# CONFIG_FAIL_MMC_REQUEST is not set
# CONFIG_FAIL_SKB_REALLOC is not set
CONFIG_FAULT_INJECTION_CONFIGFS=y
# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
CONFIG_ARCH_HAS_KCOV=y
CONFIG_KCOV=y
CONFIG_KCOV_ENABLE_COMPARISONS=y
CONFIG_KCOV_INSTRUMENT_ALL=y
CONFIG_KCOV_IRQ_AREA_SIZE=0x40000
# CONFIG_KCOV_SELFTEST is not set
CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_TEST_DHRY is not set
# CONFIG_LKDTM is not set
# CONFIG_TEST_MIN_HEAP is not set
# CONFIG_TEST_DIV64 is not set
# CONFIG_TEST_MULDIV64 is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_TEST_REF_TRACKER is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_REED_SOLOMON_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_PERCPU_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_UUID is not set
# CONFIG_TEST_XARRAY is not set
# CONFIG_TEST_MAPLE_TREE is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_TEST_IDA is not set
# CONFIG_TEST_LKM is not set
# CONFIG_TEST_BITOPS is not set
# CONFIG_TEST_VMALLOC is not set
# CONFIG_TEST_BPF is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_TEST_DYNAMIC_DEBUG is not set
# CONFIG_TEST_KMOD is not set
# CONFIG_TEST_KALLSYMS is not set
# CONFIG_TEST_DEBUG_VIRTUAL is not set
# CONFIG_TEST_MEMCAT_P is not set
# CONFIG_TEST_MEMINIT is not set
# CONFIG_TEST_HMM is not set
# CONFIG_TEST_FREE_PAGES is not set
# CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set
# CONFIG_TEST_OBJPOOL is not set
CONFIG_ARCH_USE_MEMTEST=y
# CONFIG_MEMTEST is not set
# end of Kernel Testing and Coverage

#
# Rust hacking
#
# end of Rust hacking
# end of Kernel hacking

CONFIG_IO_URING_ZCRX=y
KernelRepo git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
ReproCID 6668500078166016
ReproOpts
Show (103 bytes)
{"procs":1,"slowdown":1,"sandbox":"","sandbox_arg":0,"close_fds":false,"segv":true,"callcomments":true}
ReproSyzID 5765299325894656
SyzkallerCommit 018ebef2bbad9aa0e117fb8e7768c481e0dd4dd4
TargetArch amd64
TargetOS linux

Current Stage: moderation
Next Stage: upstream

Reporting Stages and Comments:
Stage Source Reported At Ext ID Comments
moderation lore 2026/08/31 22:11 <b112c135-ed93-4de0-ba6b-dabe2296b519@mail.kernel.org>
1 Comments
  • syzbot@kernel.org (2026/08/31 22:14):
    In blk_register_tracepoints(), register_trace_*() functions are called with
    WARN_ON(ret). Tracepoint registration allocates memory for probe arrays and
    can legitimately fail with -ENOMEM under memory pressure. WARN_ON() must
    not be used for conditions that can legitimately happen.
    
    WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints
    kernel/trace/blktrace.c:1332 [inline]
    WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470
    kernel/trace/blktrace.c:492
    RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
    RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
    Call Trace:
     <TASK>
     blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
     sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
     kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
     vfs_write+0x612/0xba0 fs/read_write.c:687
     ksys_write+0x150/0x270 fs/read_write.c:739
     do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    Furthermore, blk_register_tracepoints() ignores registration errors and
    continues, leaving tracepoints in a partially registered state. When
    blktrace is later stopped, blk_unregister_tracepoints() unconditionally
    attempts to unregister all tracepoints, which fails with -ENOENT and
    triggers an additional warning in tracepoint_remove_func().
    
    Fix this by removing WARN_ON() and properly handling registration failures
    in blk_register_tracepoints(). If any registration fails, unwinding is
    performed by unregistering previously registered tracepoints in reverse
    order, synchronizing tracepoint unregistration, and returning the error
    code. In addition, propagate the error through get_probe_ref(),
    blk_trace_setup_finalize(), and the setup entry points (blk_trace_setup(),
    blk_trace_setup2(), compat_blk_trace_setup(), and blk_trace_setup_queue()),
    properly cleaning up allocated resources on failure.
    
    Fixes: 5f3ea37c7716 ("blktrace: port to tracepoints")
    Assisted-by: Gemini:gemini-3.7-flash Gemini:gemini-3.1-pro-preview syzbot
    Reported-by: syzbot+c54ded83396afee31eb1@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=c54ded83396afee31eb1
    Link: https://syzkaller.appspot.com/ai_job?id=b81a3c49-0fe5-44e7-bf10-a4e460a67fe2
    To: "Jens Axboe" <axboe@kernel.dk>
    To: <linux-block@vger.kernel.org>
    To: <linux-trace-kernel@vger.kernel.org>
    To: "Masami Hiramatsu" <mhiramat@kernel.org>
    To: "Steven Rostedt" <rostedt@goodmis.org>
    To: "Arnaldo Carvalho de Melo" <acme@redhat.com>
    Cc: <linux-kernel@vger.kernel.org>
    Cc: "Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>
    
    ---
    diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
    index 8cd2520b4..c2324298c 100644
    --- a/kernel/trace/blktrace.c
    +++ b/kernel/trace/blktrace.c
    @@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
     static DEFINE_MUTEX(blk_probe_mutex);
     static int blk_probes_ref;
     
    -static void blk_register_tracepoints(void);
    +static int blk_register_tracepoints(void);
     static void blk_unregister_tracepoints(void);
     
     static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
    @@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
     	kfree(bt);
     }
     
    -static void get_probe_ref(void)
    +static int get_probe_ref(void)
     {
    +	int ret = 0;
    +
     	mutex_lock(&blk_probe_mutex);
    -	if (++blk_probes_ref == 1)
    -		blk_register_tracepoints();
    +	if (++blk_probes_ref == 1) {
    +		ret = blk_register_tracepoints();
    +		if (ret)
    +			blk_probes_ref--;
    +	}
     	mutex_unlock(&blk_probe_mutex);
    +	return ret;
     }
     
     static void put_probe_ref(void)
    @@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
     	return ERR_PTR(ret);
     }
     
    -static void blk_trace_setup_finalize(struct request_queue *q,
    -				     char *name, int version,
    -				     struct blk_trace *bt,
    -				     struct blk_user_trace_setup2 *buts)
    +static int blk_trace_setup_finalize(struct request_queue *q,
    +				    char *name, int version,
    +				    struct blk_trace *bt,
    +				    struct blk_user_trace_setup2 *buts)
     
     {
    +	int ret;
    +
     	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
     
     	/*
    @@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
     	bt->pid = buts->pid;
     	bt->trace_state = Blktrace_setup;
     
    +	ret = get_probe_ref();
    +	if (ret)
    +		return ret;
    +
     	rcu_assign_pointer(q->blk_trace, bt);
    -	get_probe_ref();
    +	return 0;
     }
     
     int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
    @@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
     		blk_debugfs_unlock(q, memflags);
     		return PTR_ERR(bt);
     	}
    -	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
    +	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
    +	if (ret) {
    +		blk_trace_free(q, bt);
    +		blk_debugfs_unlock(q, memflags);
    +		return ret;
    +	}
     	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
     	blk_debugfs_unlock(q, memflags);
     
    @@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
     	struct blk_user_trace_setup2 buts2;
     	struct blk_trace *bt;
     	unsigned int memflags;
    +	int ret;
     
     	if (copy_from_user(&buts2, arg, sizeof(buts2)))
     		return -EFAULT;
    @@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
     		blk_debugfs_unlock(q, memflags);
     		return PTR_ERR(bt);
     	}
    -	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
    +	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
    +	if (ret) {
    +		blk_trace_free(q, bt);
    +		blk_debugfs_unlock(q, memflags);
    +		return ret;
    +	}
     	blk_debugfs_unlock(q, memflags);
     
     	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
    @@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
     	struct compat_blk_user_trace_setup cbuts;
     	struct blk_trace *bt;
     	unsigned int memflags;
    +	int ret;
     
     	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
     		return -EFAULT;
    @@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
     		blk_debugfs_unlock(q, memflags);
     		return PTR_ERR(bt);
     	}
    -	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
    +	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
    +	if (ret) {
    +		blk_trace_free(q, bt);
    +		blk_debugfs_unlock(q, memflags);
    +		return ret;
    +	}
     	blk_debugfs_unlock(q, memflags);
     
     	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
    @@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
     }
     EXPORT_SYMBOL_GPL(blk_add_driver_data);
     
    -static void blk_register_tracepoints(void)
    +static int blk_register_tracepoints(void)
     {
     	int ret;
     
     	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out;
     	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_rq_insert;
     	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_rq_issue;
     	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_rq_merge;
     	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_rq_requeue;
     	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_rq_complete;
     	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_bio_complete;
     	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_bio_backmerge;
     	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_bio_frontmerge;
     	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_bio_queue;
     	ret = register_trace_blk_zone_append_update_request_bio(
     		blk_add_trace_zone_update_request, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_getrq;
     	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
     						     NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_zone_update_request;
     	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
     						NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_zone_plug;
     	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_zone_unplug;
     	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_plug;
     	ret = register_trace_block_split(blk_add_trace_split, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_unplug;
     	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_split;
     	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
    -	WARN_ON(ret);
    +	if (ret)
    +		goto out_bio_remap;
    +
    +	return 0;
    +
    +out_bio_remap:
    +	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
    +out_split:
    +	unregister_trace_block_split(blk_add_trace_split, NULL);
    +out_unplug:
    +	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
    +out_plug:
    +	unregister_trace_block_plug(blk_add_trace_plug, NULL);
    +out_zone_unplug:
    +	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
    +out_zone_plug:
    +	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
    +out_zone_update_request:
    +	unregister_trace_blk_zone_append_update_request_bio(
    +		blk_add_trace_zone_update_request, NULL);
    +out_getrq:
    +	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
    +out_bio_queue:
    +	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
    +out_bio_frontmerge:
    +	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
    +out_bio_backmerge:
    +	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
    +out_bio_complete:
    +	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
    +out_rq_complete:
    +	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
    +out_rq_requeue:
    +	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
    +out_rq_merge:
    +	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
    +out_rq_issue:
    +	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
    +out_rq_insert:
    +	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
    +	tracepoint_synchronize_unregister();
    +out:
    +	return ret;
     }
     
     static void blk_unregister_tracepoints(void)
    @@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
     
     	blk_trace_setup_lba(bt, bdev);
     
    +	ret = get_probe_ref();
    +	if (ret)
    +		goto free_bt;
    +
     	rcu_assign_pointer(q->blk_trace, bt);
    -	get_probe_ref();
     	return 0;
     
     free_bt:
    
    
    base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
    -- 
    This is an AI-generated patch subject to moderation.
    Reply with '#syz upstream' to Sign-off the patch as a human author
    and send it to the upstream kernel mailing lists.
    Reply with '#syz reject' to reject it ('#syz unreject' to undo).
    
    See https://goo.gle/syzbot-ai-patches for information about AI-generated patches.
    You can comment on the patch as usual, syzbot will try to address
    the comments and send a new version of the patch if necessary.
    syzbot engineers can be reached at syzkaller@googlegroups.com.
    

Outputs:
AckedBy
[]
Fixes
map[AuthorEmail:acme@redhat.com AuthorName:Arnaldo Carvalho de Melo Hash:5f3ea37c7716db4e894a480e0c18b24399595b6b Title:blktrace: port to tracepoints]
KernelBranch
master
KernelCommit
cee9395acd8043be0644b25c34bfa86623f2b935
KernelRepo
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
PatchDescription
blktrace: handle tracepoint registration failures

In blk_register_tracepoints(), register_trace_*() functions are called with
WARN_ON(ret). Tracepoint registration allocates memory for probe arrays and
can legitimately fail with -ENOMEM under memory pressure. WARN_ON() must
not be used for conditions that can legitimately happen.

WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints
kernel/trace/blktrace.c:1332 [inline]
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470
kernel/trace/blktrace.c:492
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>

Furthermore, blk_register_tracepoints() ignores registration errors and
continues, leaving tracepoints in a partially registered state. When
blktrace is later stopped, blk_unregister_tracepoints() unconditionally
attempts to unregister all tracepoints, which fails with -ENOENT and
triggers an additional warning in tracepoint_remove_func().

Fix this by removing WARN_ON() and properly handling registration failures
in blk_register_tracepoints(). If any registration fails, unwinding is
performed by unregistering previously registered tracepoints in reverse
order, synchronizing tracepoint unregistration, and returning the error
code. In addition, propagate the error through get_probe_ref(),
blk_trace_setup_finalize(), and the setup entry points (blk_trace_setup(),
blk_trace_setup2(), compat_blk_trace_setup(), and blk_trace_setup_queue()),
properly cleaning up allocated resources on failure.
PatchDiff
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:
Recipients
[map[Email:axboe@kernel.dk Name:Jens Axboe To:true] map[Email:linux-block@vger.kernel.org Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:linux-trace-kernel@vger.kernel.org Name: To:true] map[Email:mathieu.desnoyers@efficios.com Name:Mathieu Desnoyers To:false] map[Email:mhiramat@kernel.org Name:Masami Hiramatsu To:true] map[Email:rostedt@goodmis.org Name:Steven Rostedt To:true] map[Email:acme@redhat.com Name:Arnaldo Carvalho de Melo To:true]]
ReportedBy
[]
ReviewedBy
[]
SuggestedBy
[]
TestedBy
[]

Crash report:
RSP: 002b:00007fffbd9dcb98 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f7fda015fa0 RCX: 00007f7fd9d9aeb9
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fffbd9dcc00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007f7fda015fac R14: 00007f7fda015fa0 R15: 00007f7fda015fa0
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1330 at blk_register_tracepoints+0x33c/0x440 kernel/trace/blktrace.c:1330, CPU#0: syz.0.17/6030
Modules linked in:
CPU: 0 UID: 0 PID: 6030 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
RIP: 0010:blk_register_tracepoints+0x33c/0x440 kernel/trace/blktrace.c:1330
Code: 90 e8 38 d9 f9 ff 31 ff 89 c3 89 c6 e8 4d f1 f7 ff 85 db 0f 85 f9 00 00 00 e8 90 f6 f7 ff 5b c3 cc cc cc cc e8 85 f6 f7 ff 90 <0f> 0b 90 e9 ea fc ff ff e8 77 f6 f7 ff 90 0f 0b 90 e9 09 fd ff ff
RSP: 0018:ffffc90003bdfb30 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000fffffff4 RCX: ffffffff820e5126
RDX: ffff88803377db80 RSI: ffffffff820e543b RDI: ffff88803377db80
RBP: 0000000000002000 R08: 0000000000000005 R09: 0000000000000000
R10: 00000000fffffff4 R11: 0000000000000001 R12: ffff888026311c98
R13: 0000000000000000 R14: ffff888026311c98 R15: 0000000000000081
FS:  000055555c078500(0000) GS:ffff8881245e3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ff63fff CR3: 000000007375a000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 get_probe_ref kernel/trace/blktrace.c:493 [inline]
 blk_trace_setup_queue+0x269/0x300 kernel/trace/blktrace.c:1897
 sysfs_blk_trace_attr_store+0x6e2/0xa20 kernel/trace/blktrace.c:2092
 dev_attr_store+0x58/0x80 drivers/base/core.c:2437
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:142
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:352
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x6ac/0x1070 fs/read_write.c:686
 ksys_write+0x12a/0x250 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7fd9d9aeb9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffbd9dcb98 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f7fda015fa0 RCX: 00007f7fd9d9aeb9
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fffbd9dcc00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007f7fda015fac R14: 00007f7fda015fa0 R15: 00007f7fda015fa0
 </TASK>

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/31 20:45 flow patching
1h25m Results:
map[AckedBy:[] Fixes:map[AuthorEmail:acme@redhat.com AuthorName:Arnaldo Carvalho de Melo Hash:5f3ea37c7716db4e894a480e0c18b24399595b6b Title:blktrace: port to tracepoints] KernelBranch:master KernelCommit:cee9395acd8043be0644b25c34bfa86623f2b935 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git PatchDescription:blktrace: handle tracepoint registration failures

In blk_register_tracepoints(), register_trace_*() functions are called with
WARN_ON(ret). Tracepoint registration allocates memory for probe arrays and
can legitimately fail with -ENOMEM under memory pressure. WARN_ON() must
not be used for conditions that can legitimately happen.

WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints
kernel/trace/blktrace.c:1332 [inline]
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470
kernel/trace/blktrace.c:492
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>

Furthermore, blk_register_tracepoints() ignores registration errors and
continues, leaving tracepoints in a partially registered state. When
blktrace is later stopped, blk_unregister_tracepoints() unconditionally
attempts to unregister all tracepoints, which fails with -ENOENT and
triggers an additional warning in tracepoint_remove_func().

Fix this by removing WARN_ON() and properly handling registration failures
in blk_register_tracepoints(). If any registration fails, unwinding is
performed by unregistering previously registered tracepoints in reverse
order, synchronizing tracepoint unregistration, and returning the error
code. In addition, propagate the error through get_probe_ref(),
blk_trace_setup_finalize(), and the setup entry points (blk_trace_setup(),
blk_trace_setup2(), compat_blk_trace_setup(), and blk_trace_setup_queue()),
properly cleaning up allocated resources on failure. PatchDiff:diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:
 Recipients:[map[Email:axboe@kernel.dk Name:Jens Axboe To:true] map[Email:linux-block@vger.kernel.org Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:linux-trace-kernel@vger.kernel.org Name: To:true] map[Email:mathieu.desnoyers@efficios.com Name:Mathieu Desnoyers To:false] map[Email:mhiramat@kernel.org Name:Masami Hiramatsu To:true] map[Email:rostedt@goodmis.org Name:Steven Rostedt To:true] map[Email:acme@redhat.com Name:Arnaldo Carvalho de Melo To:true]] ReportedBy:[] ReviewedBy:[] SuggestedBy:[] TestedBy:[]]

1/1 2026/08/31 20:45 action base-commit-picker
0m Results:
map[KernelBranch:master KernelCommit:cee9395acd8043be0644b25c34bfa86623f2b935 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git]

2/1 2026/08/31 20:45 action syz-repro-to-c-repro
0m Results:
map[SimplifiedCRepro:// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

static bool write_file(const char* file, const char* what, ...)
{
	char buf[1024];
	va_list args;
	va_start(args, what);
	vsnprintf(buf, sizeof(buf), what, args);
	va_end(args);
	buf[sizeof(buf) - 1] = 0;
	int len = strlen(buf);
	int fd = open(file, O_WRONLY | O_CLOEXEC);
	if (fd == -1)
		return false;
	if (write(fd, buf, len) != len) {
		int err = errno;
		close(fd);
		errno = err;
		return false;
	}
	close(fd);
	return true;
}

static int inject_fault(int nth)
{
	int fd;
	fd = open("/proc/thread-self/fail-nth", O_RDWR);
	if (fd == -1)
	exit(1);
	char buf[16];
	sprintf(buf, "%d", nth);
	if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf))
	exit(1);
	return fd;
}

static const char* setup_fault()
{
	int fd = open("/proc/self/make-it-fail", O_WRONLY);
	if (fd == -1)
		return "CONFIG_FAULT_INJECTION is not enabled";
	close(fd);
	fd = open("/proc/thread-self/fail-nth", O_WRONLY);
	if (fd == -1)
		return "kernel does not have systematic fault injection support";
	close(fd);
	static struct {
		const char* file;
		const char* val;
		bool fatal;
	} files[] = {
	    {"/sys/kernel/debug/failslab/ignore-gfp-wait", "N", true},
	    {"/sys/kernel/debug/fail_futex/ignore-private", "N", false},
	    {"/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem", "N", false},
	    {"/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait", "N", false},
	    {"/sys/kernel/debug/fail_page_alloc/min-order", "0", false},
	};
	unsigned i;
	for (i = 0; i < sizeof(files) / sizeof(files[0]); i++) {
		if (!write_file(files[i].file, files[i].val)) {
			if (files[i].fatal)
				return "failed to write fault injection file";
		}
	}
	return NULL;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	const char* reason;
	(void)reason;
	if ((reason = setup_fault()))
		printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason);
				intptr_t res = 0;
	if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
//  openat$auto_kernfs_file_fops_kernfs_internal arguments: [
//    fd: const = 0xffffffffffffff9c (8 bytes)
//    file: ptr[in, buffer] {
//      buffer: {2f 73 79 73 2f 64 65 76 69 63 65 73 2f 76 69 72 74 75 61 6c 2f 62 6c 6f 63 6b 2f 72 61 6d 34 2f 74 72 61 63 65 2f 73 74 61 72 74 5f 6c 62 61 00} (length 0x30)
//    }
//    flags: open_flags = 0xa001 (4 bytes)
//    mode: const = 0x0 (2 bytes)
//  ]
//  returns fd_kernfs_file_fops_kernfs_internal
memcpy((void*)0x200000000080, "/sys/devices/virtual/block/ram4/trace/start_lba\000", 48);
	res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000080ul, /*flags=O_LARGEFILE|FASYNC|O_WRONLY*/0xa001, /*mode=*/0);
	if (res != -1)
		r[0] = res;
//  write$auto arguments: [
//    fd: fd (resource)
//    buf: ptr[in, buffer] {
//      buffer: {30 00 5c a0 04 7c 03 cb 12 fa 08 1c c7 6b 3e c8 1f ad f6 f0 ef e4 73 95 f2 00 97 53 b9 4f ac be d6 5c 4a 3c 02 59 4b d6 4d e6 e7 a0 b8 c3 5b 01 c5 e8 7c b0 b0 80 bf a5 3f 3d 69 88 55 42 1d 8e d3 c2 94 39 b6 fb 00 36 02 9c 83 14 13 99 c7 b4 29 4d ed 09 4e 20 24 d4 90 5e 3f 4a 92 9a 3f f8 62 03 d8 dd 84 df 92 f0 cd d8 ba ab 15 80 9e 6f 2c c8 f2 82 d2 88 be 4c a0 1a d3 d5 4f 66 95 ee 13 65 eb 7d 6f 9b 86 5f f0 3f 0c 3c f3 74 37 b6 0f 93 c7 39 40 d8 78 9e ef 21 00 36 08 db 57 42 84 dd ac da 75 86 67 8f 02 40 4f 37 0f f8 8d 28 9c f2 4e 79 44 7f 33 14 9e 67 86 25 29 d6 08 cd 1f 03 00 3a a6 83 27 f4 f2 9d 64 f4 7a 89 c5 44 c4 02 5c 81 cf 02 45 70 f6 60 de 2a 1d 56} (length 0xde)
//    }
//    count: intptr = 0x81 (8 bytes)
//  ]
memcpy((void*)0x2000000002c0, "... [truncated large byte array] ...", 222);
	inject_fault(4);
	syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x2000000002c0ul, /*count=*/0x81ul);
	return 0;
}
]

3/1 2026/08/31 20:45 action kernel-checkouter
1m Results:
map[KernelSrc:/app/workdir/cache/src/d20ee096b85bb6348b207ca05fcfd1899d452eaa]

4/1 2026/08/31 20:46 action kernel-builder
19m Results:
map[KernelObj:/app/workdir/cache/build/85a2179a93aa925c1e713bb553e825af78c84e67]

5/1 2026/08/31 21:05 action crash-reproducer
2m Results:
map[OtherCrashReports:<nil> ReproducedBugTitle:WARNING in get_probe_ref ReproducedCrashReport:R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
 ReproducedFaultInjection:FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
Call Trace:
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 fail_dump lib/fault-inject.c:73 [inline]
 should_fail_ex+0x410/0x560 lib/fault-inject.c:174
 should_failslab+0xa8/0x100 mm/failslab.c:46
 slab_pre_alloc_hook mm/slub.c:4638 [inline]
 slab_alloc_node mm/slub.c:4974 [inline]
 __do_kmalloc_node mm/slub.c:5413 [inline]
 __kmalloc_noprof+0xfe/0x720 mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 allocate_probes kernel/tracepoint.c:106 [inline]
 func_add kernel/tracepoint.c:168 [inline]
 tracepoint_add_func+0x351/0xa90 kernel/tracepoint.c:301
 tracepoint_probe_register_prio kernel/tracepoint.c:475 [inline]
 tracepoint_probe_register+0x5d/0x90 kernel/tracepoint.c:495
 register_trace_block_rq_insert include/trace/events/block.h:297 [inline]
 blk_register_tracepoints kernel/trace/blktrace.c:1331 [inline]
 get_probe_ref+0x4f/0x470 kernel/trace/blktrace.c:492
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f]

6/1 2026/08/31 21:08 action codesearch-prepare
11m Results:
map[Index:codesearch-index]

7/1 2026/08/31 21:19 agent debugger
6m Model:
deep-reasoning

Instruction:
You are an experienced Linux kernel developer tasked with debugging a kernel crash root cause.
You need to provide a detailed explanation of the root cause for another developer to be
able to write a fix for the bug based on your explanation. Include all relevant details
into the response: function/struct/field/etc names, code snippets, line numbers,
macro/enum values, etc.



Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash is:

R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>


The following C code is a draft of the vulnerable syscall sequence. Keep in mind that
it may lack the precise threading, sandboxing, and some arguments of a working reproducer:

// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

static bool write_file(const char* file, const char* what, ...)
{
	char buf[1024];
	va_list args;
	va_start(args, what);
	vsnprintf(buf, sizeof(buf), what, args);
	va_end(args);
	buf[sizeof(buf) - 1] = 0;
	int len = strlen(buf);
	int fd = open(file, O_WRONLY | O_CLOEXEC);
	if (fd == -1)
		return false;
	if (write(fd, buf, len) != len) {
		int err = errno;
		close(fd);
		errno = err;
		return false;
	}
	close(fd);
	return true;
}

static int inject_fault(int nth)
{
	int fd;
	fd = open("/proc/thread-self/fail-nth", O_RDWR);
	if (fd == -1)
	exit(1);
	char buf[16];
	sprintf(buf, "%d", nth);
	if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf))
	exit(1);
	return fd;
}

static const char* setup_fault()
{
	int fd = open("/proc/self/make-it-fail", O_WRONLY);
	if (fd == -1)
		return "CONFIG_FAULT_INJECTION is not enabled";
	close(fd);
	fd = open("/proc/thread-self/fail-nth", O_WRONLY);
	if (fd == -1)
		return "kernel does not have systematic fault injection support";
	close(fd);
	static struct {
		const char* file;
		const char* val;
		bool fatal;
	} files[] = {
	    {"/sys/kernel/debug/failslab/ignore-gfp-wait", "N", true},
	    {"/sys/kernel/debug/fail_futex/ignore-private", "N", false},
	    {"/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem", "N", false},
	    {"/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait", "N", false},
	    {"/sys/kernel/debug/fail_page_alloc/min-order", "0", false},
	};
	unsigned i;
	for (i = 0; i < sizeof(files) / sizeof(files[0]); i++) {
		if (!write_file(files[i].file, files[i].val)) {
			if (files[i].fatal)
				return "failed to write fault injection file";
		}
	}
	return NULL;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	const char* reason;
	(void)reason;
	if ((reason = setup_fault()))
		printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason);
				intptr_t res = 0;
	if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
//  openat$auto_kernfs_file_fops_kernfs_internal arguments: [
//    fd: const = 0xffffffffffffff9c (8 bytes)
//    file: ptr[in, buffer] {
//      buffer: {2f 73 79 73 2f 64 65 76 69 63 65 73 2f 76 69 72 74 75 61 6c 2f 62 6c 6f 63 6b 2f 72 61 6d 34 2f 74 72 61 63 65 2f 73 74 61 72 74 5f 6c 62 61 00} (length 0x30)
//    }
//    flags: open_flags = 0xa001 (4 bytes)
//    mode: const = 0x0 (2 bytes)
//  ]
//  returns fd_kernfs_file_fops_kernfs_internal
memcpy((void*)0x200000000080, "/sys/devices/virtual/block/ram4/trace/start_lba\000", 48);
	res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000080ul, /*flags=O_LARGEFILE|FASYNC|O_WRONLY*/0xa001, /*mode=*/0);
	if (res != -1)
		r[0] = res;
//  write$auto arguments: [
//    fd: fd (resource)
//    buf: ptr[in, buffer] {
//      buffer: {30 00 5c a0 04 7c 03 cb 12 fa 08 1c c7 6b 3e c8 1f ad f6 f0 ef e4 73 95 f2 00 97 53 b9 4f ac be d6 5c 4a 3c 02 59 4b d6 4d e6 e7 a0 b8 c3 5b 01 c5 e8 7c b0 b0 80 bf a5 3f 3d 69 88 55 42 1d 8e d3 c2 94 39 b6 fb 00 36 02 9c 83 14 13 99 c7 b4 29 4d ed 09 4e 20 24 d4 90 5e 3f 4a 92 9a 3f f8 62 03 d8 dd 84 df 92 f0 cd d8 ba ab 15 80 9e 6f 2c c8 f2 82 d2 88 be 4c a0 1a d3 d5 4f 66 95 ee 13 65 eb 7d 6f 9b 86 5f f0 3f 0c 3c f3 74 37 b6 0f 93 c7 39 40 d8 78 9e ef 21 00 36 08 db 57 42 84 dd ac da 75 86 67 8f 02 40 4f 37 0f f8 8d 28 9c f2 4e 79 44 7f 33 14 9e 67 86 25 29 d6 08 cd 1f 03 00 3a a6 83 27 f4 f2 9d 64 f4 7a 89 c5 44 c4 02 5c 81 cf 02 45 70 f6 60 de 2a 1d 56} (length 0xde)
//    }
//    count: intptr = 0x81 (8 bytes)
//  ]
memcpy((void*)0x2000000002c0, "... [truncated large byte array] ...", 222);
	inject_fault(4);
	syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x2000000002c0ul, /*count=*/0x81ul);
	return 0;
}




The reproducer uses fault injection to force allocation failure at a specific point.
These injected failures often exercise rarely used error-handling paths,
so the bug is frequently in that error handling.
The following fault injection report(s) show what was injected:

FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
Call Trace:
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 fail_dump lib/fault-inject.c:73 [inline]
 should_fail_ex+0x410/0x560 lib/fault-inject.c:174
 should_failslab+0xa8/0x100 mm/failslab.c:46
 slab_pre_alloc_hook mm/slub.c:4638 [inline]
 slab_alloc_node mm/slub.c:4974 [inline]
 __do_kmalloc_node mm/slub.c:5413 [inline]
 __kmalloc_noprof+0xfe/0x720 mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 allocate_probes kernel/tracepoint.c:106 [inline]
 func_add kernel/tracepoint.c:168 [inline]
 tracepoint_add_func+0x351/0xa90 kernel/tracepoint.c:301
 tracepoint_probe_register_prio kernel/tracepoint.c:475 [inline]
 tracepoint_probe_register+0x5d/0x90 kernel/tracepoint.c:495
 register_trace_block_rq_insert include/trace/events/block.h:297 [inline]
 blk_register_tracepoints kernel/trace/blktrace.c:1331 [inline]
 get_probe_ref+0x4f/0x470 kernel/trace/blktrace.c:492
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f


Reply:
The root cause of the crash is that `blk_register_tracepoints()` uses `WARN_ON(ret)` to check the return values of `register_trace_block_*()` functions. These tracepoint registration functions allocate memory for the probe array and can fail with `-ENOMEM` (e.g., under memory pressure or fault injection, as seen in the syzbot report). When they fail, `WARN_ON()` triggers a kernel panic if `panic_on_warn` is set.

Furthermore, `blk_register_tracepoints()` currently ignores the error and continues, leaving the tracepoints in a partially registered state. Later, when tracing is stopped, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. Unregistering a tracepoint that was not successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers another `WARN_ON_ONCE` inside `tracepoint_remove_func()`.

To fix this, we need to properly handle the registration failures by returning the error, unregistering the successfully registered tracepoints, and propagating the error up the call stack to fail the blktrace setup.

### Fix Details

1. **Change `blk_register_tracepoints()` to return an `int` and handle errors:**
   Instead of `WARN_ON(ret)`, check the return value of each `register_trace_*()` call. If it fails, use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error.

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		return ret;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto err_issue;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto err_merge;
        // ... (do this for all 18 tracepoints) ...
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto err_rq_remap;
	return 0;

err_rq_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
// ... (unregister labels in reverse order) ...
err_merge:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
err_issue:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	return ret;
}
```

2. **Propagate the error through `get_probe_ref()`:**
```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

3. **Propagate the error through `blk_trace_setup_finalize()`:**
```c
static int blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)
{
	int ret;
        // ... existing code ...
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
}
```

4. **Handle the error in the callers of `blk_trace_setup_finalize()`:**
   In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, check the return value of `blk_trace_setup_finalize()`. If it fails, clean up the allocated `bt` and return the error:
```c
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
```

5. **Handle the error in `blk_trace_setup_queue()`:**
```c
static int blk_trace_setup_queue(struct request_queue *q,
				 struct block_device *bdev)
{
        // ... existing code ...
	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt:
	blk_trace_free(q, bt);
	return ret;
}
```

8/2 2026/08/31 21:19 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8796
							output: 38
							thoughts: 189
						

Thoughts:
**Analyzing a Kernel Crash in blktrace**

Okay, so I've got a crash, a WARNING specifically, in `blk_register_tracepoints`. The stack trace points me right to `kernel/trace/blktrace.c:1332`. That's the starting point. It looks like it's happening during the `blk_register_tracepoints` function itself, but the backtrace also includes `get_probe_ref` which is interesting... and at line 492 of the same file. CPU #1, process `syz.0.17/6119`. Let's dig into that `blktrace.c` file and see what's happening around line 1332, and then look around line 492 too. There's a good chance this is a race condition or some kind of resource conflict within the tracepoint registration, or, perhaps, within probe ref counting. I need to understand what's triggering this WARNING.



9/2 2026/08/31 21:19 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1320 LineCount:50]

Results:
map[Contents:1320:		__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0,
1321:					BLK_TA_DRV_DATA, 0, len, data,
1322:					blk_trace_request_get_cgid(rq));
1323:		rcu_read_unlock();
1324:	}
1325:	EXPORT_SYMBOL_GPL(blk_add_driver_data);
1326:	
1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
]

10/2 2026/08/31 21:19 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10257
							output: 37
							thoughts: 599
						

Thoughts:
**Analyzing a Fault Injection Scenario**

Okay, so I'm looking at this fault injection report and immediately my eye goes to line 1332 with that `WARN_ON(ret);` call. Right, it's triggered because `register_trace_block_rq_insert` returned an error. Looking at the call stack, I see the fault is simulated in `allocate_probes` which is called during the memory allocation in `slab_alloc_node`.  This is a simulated failure, a "failslab" injection, to test error handling.

The interesting question is: if `register_trace_block_rq_insert` fails, what happens next? Does the system gracefully handle the failure and continue registering other tracepoints?  My concern is that `blk_register_tracepoints` might just blindly trigger the `WARN_ON` call and move on. I need to look at the surrounding code in `blk_register_tracepoints` and the `get_probe_ref` function to fully understand the consequences of this failure. It's important to understand the overall architecture so that I can accurately access the impacts of this fault.



11/2 2026/08/31 21:20 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:480 LineCount:40]

Results:
map[Contents: 480:		} else {
 481:			debugfs_remove(bt->dir);
 482:		}
 483:		free_percpu(bt->sequence);
 484:		free_percpu(bt->msg_data);
 485:		kfree(bt);
 486:	}
 487:	
 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
 495:	
 496:	static void put_probe_ref(void)
 497:	{
 498:		mutex_lock(&blk_probe_mutex);
 499:		if (!--blk_probes_ref)
 500:			blk_unregister_tracepoints();
 501:		mutex_unlock(&blk_probe_mutex);
 502:	}
 503:	
 504:	static int blk_trace_start(struct blk_trace *bt)
 505:	{
 506:		if (bt->trace_state != Blktrace_setup &&
 507:		    bt->trace_state != Blktrace_stopped)
 508:			return -EINVAL;
 509:	
 510:		blktrace_seq++;
 511:		smp_mb();
 512:		bt->trace_state = Blktrace_running;
 513:		raw_spin_lock_irq(&running_trace_lock);
 514:		list_add(&bt->running_list, &running_trace_list);
 515:		raw_spin_unlock_irq(&running_trace_lock);
 516:		trace_note_time(bt);
 517:	
 518:		return 0;
 519:	}
]

12/2 2026/08/31 21:20 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11701
							output: 37
							thoughts: 266
						

Thoughts:
**Analyzing a Kernel Tracepoint Registration Issue**

Okay, so I'm looking at this syzbot report and it's pointing to a `WARN_ON` within `blk_register_tracepoints`. My initial thought is that `get_probe_ref` is the entry point – it increments `blk_probes_ref` and then calls `blk_register_tracepoints` if this is the first probe. The problem seems to stem from the fact that `blk_register_tracepoints` calls a few `register_trace_*` functions, but only cares about their return values enough to trigger a `WARN_ON` on failure, which is exactly what we're seeing in the report.

My immediate instinct is to ask, is this `WARN_ON` necessary? If a `register_trace_*` function fails, it returns an error, most likely `-ENOMEM`. If that happens, those tracepoints don't get registered, which is expected. But, here's the kicker: `blk_register_tracepoints` is defined with a `void` return type! That means the error signal is essentially being discarded, and the code just continues execution. The `WARN_ON` is acting as a signal that something is wrong, and presumably it would indicate the reason for not registering the tracepoints.

So, is the fact that `blk_register_tracepoints` is `void` and relies on `WARN_ON` instead of returning an error code a bug? This seems like a potential flaw, and it's worth digging into the commit history of `blk_register_tracepoints` to understand the rationale behind this design. Perhaps there was a specific reason for this approach that I'm missing, but at first glance, it feels like a potential area for improvement or at least clarification.



13/2 2026/08/31 21:20 tool git-log
0m Error:
log-in to see details

Args:
map[PathPrefix:kernel/trace/blktrace.c SymbolName:blk_register_tracepoints]

Results:
map[Output:]

14/2 2026/08/31 21:20 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12408
							output: 37
							thoughts: 19
						

Thoughts:
Okay, here's the summary, rendered as a first-person thought process, geared towards an expert:

**Refining My Search Strategy**

Right, thinking about this symbol search... I should really be leveraging `SourcePath` instead of `PathPrefix`. I keep defaulting to `PathPrefix` in these scenarios, but I know `SourcePath` will offer a more accurate and targeted result. It's a subtle distinction, but a critical one for performance and precision, especially when dealing with the scope I'm used to. Time to adjust the workflow and get the most optimal search results.



15/2 2026/08/31 21:20 tool git-log
0m Args:
map[SourcePath:kernel/trace/blktrace.c SymbolName:blk_register_tracepoints]

Results:
map[Output:3c289ba7c320 blktrace: remove blk_probe_mutex
5f3ea37c7716 blktrace: port to tracepoints
]

16/2 2026/08/31 21:21 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12644
							output: 26
							thoughts: 17
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as if it were my own, assuming the user is an expert.

**Deconstructing the Identifier: `5f3ea37c7716`**

Alright, let's take a look at this identifier: `5f3ea37c7716`. Immediately, my mind starts sifting through potential interpretations. The format screams hexadecimal, which instantly narrows the possibilities. Given my experience, I'd instantly start considering context. Is this a database ID? A hash value from a cryptographic algorithm? Perhaps a commit ID in version control? Or maybe a segment of memory address from my program?

My first instinct is to try and correlate this string with my current project or recent work. Did I encounter something similar in my debugging log from last night? Do I recognize any part of this identifier to an object or process?

If I have more context, like knowing the programming language, system, or data structure in which it was used, it would help a lot. If I'm coming up empty, it would be useful to look up tools to perform lookups against databases or codebases that could potentially reveal the value's origin or function.
If it's a hash, is it MD5, SHA-1, SHA-256? That will help in determining its age, and whether or not it's something I need to be concerned with.



17/2 2026/08/31 21:21 tool git-show
0m Args:
map[Commit:5f3ea37c7716]

Results:
map[Output:commit 5f3ea37c7716db4e894a480e0c18b24399595b6b
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date:   Thu Oct 30 08:34:33 2008 +0100

    blktrace: port to tracepoints
    
    This was a forward port of work done by Mathieu Desnoyers, I changed it to
    encode the 'what' parameter on the tracepoint name, so that one can register
    interest in specific events and not on classes of events to then check the
    'what' parameter.
    
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/block/Kconfig b/block/Kconfig
index 1ab7c15c8d7a..290b219fad9c 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -47,6 +47,7 @@ config BLK_DEV_IO_TRACE
 	depends on SYSFS
 	select RELAY
 	select DEBUG_FS
+	select TRACEPOINTS
 	help
 	  Say Y here if you want to be able to trace the block layer actions
 	  on a given queue. Tracing allows you to see any traffic happening
diff --git a/block/blk-core.c b/block/blk-core.c
index 10e8a64a5a5b..04267d66a2b9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -28,6 +28,7 @@
 #include <linux/task_io_accounting_ops.h>
 #include <linux/blktrace_api.h>
 #include <linux/fault-inject.h>
+#include <trace/block.h>
 
 #include "blk.h"
 
@@ -205,7 +206,7 @@ void blk_plug_device(struct request_queue *q)
 
 	if (!queue_flag_test_and_set(QUEUE_FLAG_PLUGGED, q)) {
 		mod_timer(&q->unplug_timer, jiffies + q->unplug_delay);
-		blk_add_trace_generic(q, NULL, 0, BLK_TA_PLUG);
+		trace_block_plug(q);
 	}
 }
 EXPORT_SYMBOL(blk_plug_device);
@@ -292,9 +293,7 @@ void blk_unplug_work(struct work_struct *work)
 	struct request_queue *q =
 		container_of(work, struct request_queue, unplug_work);
 
-	blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
-				q->rq.count[READ] + q->rq.count[WRITE]);
-
+	trace_block_unplug_io(q);
 	q->unplug_fn(q);
 }
 
@@ -302,9 +301,7 @@ void blk_unplug_timeout(unsigned long data)
 {
 	struct request_queue *q = (struct request_queue *)data;
 
-	blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_TIMER, NULL,
-				q->rq.count[READ] + q->rq.count[WRITE]);
-
+	trace_block_unplug_timer(q);
 	kblockd_schedule_work(q, &q->unplug_work);
 }
 
@@ -314,9 +311,7 @@ void blk_unplug(struct request_queue *q)
 	 * devices don't necessarily have an ->unplug_fn defined
 	 */
 	if (q->unplug_fn) {
-		blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
-					q->rq.count[READ] + q->rq.count[WRITE]);
-
+		trace_block_unplug_io(q);
 		q->unplug_fn(q);
 	}
 }
@@ -822,7 +817,7 @@ static struct request *get_request(struct request_queue *q, int rw_flags,
 	if (ioc_batching(q, ioc))
 		ioc->nr_batch_requests--;
 
-	blk_add_trace_generic(q, bio, rw, BLK_TA_GETRQ);
+	trace_block_getrq(q, bio, rw);
 out:
 	return rq;
 }
@@ -848,7 +843,7 @@ static struct request *get_request_wait(struct request_queue *q, int rw_flags,
 		prepare_to_wait_exclusive(&rl->wait[rw], &wait,
 				TASK_UNINTERRUPTIBLE);
 
-		blk_add_trace_generic(q, bio, rw, BLK_TA_SLEEPRQ);
+		trace_block_sleeprq(q, bio, rw);
 
 		__generic_unplug_device(q);
 		spin_unlock_irq(q->queue_lock);
@@ -928,7 +923,7 @@ void blk_requeue_request(struct request_queue *q, struct request *rq)
 {
 	blk_delete_timer(rq);
 	blk_clear_rq_complete(rq);
-	blk_add_trace_rq(q, rq, BLK_TA_REQUEUE);
+	trace_block_rq_requeue(q, rq);
 
 	if (blk_rq_tagged(rq))
 		blk_queue_end_tag(q, rq);
@@ -1167,7 +1162,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 		if (!ll_back_merge_fn(q, req, bio))
 			break;
 
-		blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
+		trace_block_bio_backmerge(q, bio);
 
 		req->biotail->bi_next = bio;
 		req->biotail = bio;
@@ -1186,7 +1181,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 		if (!ll_front_merge_fn(q, req, bio))
 			break;
 
-		blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
+		trace_block_bio_frontmerge(q, bio);
 
 		bio->bi_next = req->bio;
 		req->bio = bio;
@@ -1269,7 +1264,7 @@ static inline void blk_partition_remap(struct bio *bio)
 		bio->bi_sector += p->start_sect;
 		bio->bi_bdev = bdev->bd_contains;
 
-		blk_add_trace_remap(bdev_get_queue(bio->bi_bdev), bio,
+		trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
 				    bdev->bd_dev, bio->bi_sector,
 				    bio->bi_sector - p->start_sect);
 	}
@@ -1441,10 +1436,10 @@ static inline void __generic_make_request(struct bio *bio)
 			goto end_io;
 
 		if (old_sector != -1)
-			blk_add_trace_remap(q, bio, old_dev, bio->bi_sector,
+			trace_block_remap(q, bio, old_dev, bio->bi_sector,
 					    old_sector);
 
-		blk_add_trace_bio(q, bio, BLK_TA_QUEUE);
+		trace_block_bio_queue(q, bio);
 
 		old_sector = bio->bi_sector;
 		old_dev = bio->bi_bdev->bd_dev;
@@ -1656,7 +1651,7 @@ static int __end_that_request_first(struct request *req, int error,
 	int total_bytes, bio_nbytes, next_idx = 0;
 	struct bio *bio;
 
-	blk_add_trace_rq(req->q, req, BLK_TA_COMPLETE);
+	trace_block_rq_complete(req->q, req);
 
 	/*
 	 * for a REQ_TYPE_BLOCK_PC request, we want to carry any eventual
diff --git a/block/blktrace.c b/block/blktrace.c
index 85049a7e7a17..b0a2cae886db 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -23,10 +23,18 @@
 #include <linux/mutex.h>
 #include <linux/debugfs.h>
 #include <linux/time.h>
+#include <trace/block.h>
 #include <asm/uaccess.h>
 
 static unsigned int blktrace_seq __read_mostly = 1;
 
+/* Global reference count of probes */
+static DEFINE_MUTEX(blk_probe_mutex);
+static atomic_t blk_probes_ref = ATOMIC_INIT(0);
+
+static int blk_register_tracepoints(void);
+static void blk_unregister_tracepoints(void);
+
 /*
  * Send out a notify message.
  */
@@ -119,7 +127,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK
  * The worker for the various blk_add_trace*() types. Fills out a
  * blk_io_trace structure and places it in a per-cpu subbuffer.
  */
-void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
+static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 		     int rw, u32 what, int error, int pdu_len, void *pdu_data)
 {
 	struct task_struct *tsk = current;
@@ -177,8 +185,6 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 	local_irq_restore(flags);
 }
 
-EXPORT_SYMBOL_GPL(__blk_add_trace);
-
 static struct dentry *blk_tree_root;
 static DEFINE_MUTEX(blk_tree_mutex);
 static unsigned int root_users;
@@ -237,6 +243,10 @@ static void blk_trace_cleanup(struct blk_trace *bt)
 	free_percpu(bt->sequence);
 	free_percpu(bt->msg_data);
 	kfree(bt);
+	mutex_lock(&blk_probe_mutex);
+	if (atomic_dec_and_test(&blk_probes_ref))
+		blk_unregister_tracepoints();
+	mutex_unlock(&blk_probe_mutex);
 }
 
 int blk_trace_remove(struct request_queue *q)
@@ -428,6 +438,14 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	mutex_lock(&blk_probe_mutex);
+	if (atomic_add_return(1, &blk_probes_ref) == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			goto probe_err;
+	}
+	mutex_unlock(&blk_probe_mutex);
+
 	ret = -EBUSY;
 	old_bt = xchg(&q->blk_trace, bt);
 	if (old_bt) {
@@ -436,6 +454,9 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	}
 
 	return 0;
+probe_err:
+	atomic_dec(&blk_probes_ref);
+	mutex_unlock(&blk_probe_mutex);
 err:
 	if (dir)
 		blk_remove_tree(dir);
@@ -562,3 +583,308 @@ void blk_trace_shutdown(struct request_queue *q)
 		blk_trace_remove(q);
 	}
 }
+
+/*
+ * blktrace probes
+ */
+
+/**
+ * blk_add_trace_rq - Add a trace for a request oriented action
+ * @q:		queue the io is for
+ * @rq:		the source request
+ * @what:	the action
+ *
+ * Description:
+ *     Records an action against a request. Will log the bio offset + size.
+ *
+ **/
+static void blk_add_trace_rq(struct request_queue *q, struct request *rq,
+				    u32 what)
+{
+	struct blk_trace *bt = q->blk_trace;
+	int rw = rq->cmd_flags & 0x03;
+
+	if (likely(!bt))
+		return;
+
+	if (blk_discard_rq(rq))
+		rw |= (1 << BIO_RW_DISCARD);
+
+	if (blk_pc_request(rq)) {
+		what |= BLK_TC_ACT(BLK_TC_PC);
+		__blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors,
+				sizeof(rq->cmd), rq->cmd);
+	} else  {
+		what |= BLK_TC_ACT(BLK_TC_FS);
+		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
+				rw, what, rq->errors, 0, NULL);
+	}
+}
+
+static void blk_add_trace_rq_abort(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_ABORT);
+}
+
+static void blk_add_trace_rq_insert(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_INSERT);
+}
+
+static void blk_add_trace_rq_issue(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_ISSUE);
+}
+
+static void blk_add_trace_rq_requeue(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_REQUEUE);
+}
+
+static void blk_add_trace_rq_complete(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_COMPLETE);
+}
+
+/**
+ * blk_add_trace_bio - Add a trace for a bio oriented action
+ * @q:		queue the io is for
+ * @bio:	the source bio
+ * @what:	the action
+ *
+ * Description:
+ *     Records an action against a bio. Will log the bio offset + size.
+ *
+ **/
+static void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
+				     u32 what)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (likely(!bt))
+		return;
+
+	__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what,
+			!bio_flagged(bio, BIO_UPTODATE), 0, NULL);
+}
+
+static void blk_add_trace_bio_bounce(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_BOUNCE);
+}
+
+static void blk_add_trace_bio_complete(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_COMPLETE);
+}
+
+static void blk_add_trace_bio_backmerge(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
+}
+
+static void blk_add_trace_bio_frontmerge(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
+}
+
+static void blk_add_trace_bio_queue(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_QUEUE);
+}
+
+static void blk_add_trace_getrq(struct request_queue *q, struct bio *bio, int rw)
+{
+	if (bio)
+		blk_add_trace_bio(q, bio, BLK_TA_GETRQ);
+	else {
+		struct blk_trace *bt = q->blk_trace;
+
+		if (bt)
+			__blk_add_trace(bt, 0, 0, rw, BLK_TA_GETRQ, 0, 0, NULL);
+	}
+}
+
+
+static void blk_add_trace_sleeprq(struct request_queue *q, struct bio *bio, int rw)
+{
+	if (bio)
+		blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ);
+	else {
+		struct blk_trace *bt = q->blk_trace;
+
+		if (bt)
+			__blk_add_trace(bt, 0, 0, rw, BLK_TA_SLEEPRQ, 0, 0, NULL);
+	}
+}
+
+static void blk_add_trace_plug(struct request_queue *q)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt)
+		__blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL);
+}
+
+static void blk_add_trace_unplug_io(struct request_queue *q)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt) {
+		unsigned int pdu = q->rq.count[READ] + q->rq.count[WRITE];
+		__be64 rpdu = cpu_to_be64(pdu);
+
+		__blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_IO, 0,
+				sizeof(rpdu), &rpdu);
+	}
+}
+
+static void blk_add_trace_unplug_timer(struct request_queue *q)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt) {
+		unsigned int pdu = q->rq.count[READ] + q->rq.count[WRITE];
+		__be64 rpdu = cpu_to_be64(pdu);
+
+		__blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_TIMER, 0,
+				sizeof(rpdu), &rpdu);
+	}
+}
+
+static void blk_add_trace_split(struct request_queue *q, struct bio *bio,
+				unsigned int pdu)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt) {
+		__be64 rpdu = cpu_to_be64(pdu);
+
+		__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw,
+				BLK_TA_SPLIT, !bio_flagged(bio, BIO_UPTODATE),
+				sizeof(rpdu), &rpdu);
+	}
+}
+
+/**
+ * blk_add_trace_remap - Add a trace for a remap operation
+ * @q:		queue the io is for
+ * @bio:	the source bio
+ * @dev:	target device
+ * @from:	source sector
+ * @to:		target sector
+ *
+ * Description:
+ *     Device mapper or raid target sometimes need to split a bio because
+ *     it spans a stripe (or similar). Add a trace for that action.
+ *
+ **/
+static void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
+				       dev_t dev, sector_t from, sector_t to)
+{
+	struct blk_trace *bt = q->blk_trace;
+	struct blk_io_trace_remap r;
+
+	if (likely(!bt))
+		return;
+
+	r.device = cpu_to_be32(dev);
+	r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
+	r.sector = cpu_to_be64(to);
+
+	__blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP,
+			!bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
+}
+
+/**
+ * blk_add_driver_data - Add binary message with driver-specific data
+ * @q:		queue the io is for
+ * @rq:		io request
+ * @data:	driver-specific data
+ * @len:	length of driver-specific data
+ *
+ * Description:
+ *     Some drivers might want to write driver-specific data per request.
+ *
+ **/
+void blk_add_driver_data(struct request_queue *q,
+			 struct request *rq,
+			 void *data, size_t len)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (likely(!bt))
+		return;
+
+	if (blk_pc_request(rq))
+		__blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA,
+				rq->errors, len, data);
+	else
+		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
+				0, BLK_TA_DRV_DATA, rq->errors, len, data);
+}
+EXPORT_SYMBOL_GPL(blk_add_driver_data);
+
+static int blk_register_tracepoints(void)
+{
+	int ret;
+
+	ret = register_trace_block_rq_abort(blk_add_trace_rq_abort);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_bounce(blk_add_trace_bio_bounce);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue);
+	WARN_ON(ret);
+	ret = register_trace_block_getrq(blk_add_trace_getrq);
+	WARN_ON(ret);
+	ret = register_trace_block_sleeprq(blk_add_trace_sleeprq);
+	WARN_ON(ret);
+	ret = register_trace_block_plug(blk_add_trace_plug);
+	WARN_ON(ret);
+	ret = register_trace_block_unplug_timer(blk_add_trace_unplug_timer);
+	WARN_ON(ret);
+	ret = register_trace_block_unplug_io(blk_add_trace_unplug_io);
+	WARN_ON(ret);
+	ret = register_trace_block_split(blk_add_trace_split);
+	WARN_ON(ret);
+	ret = register_trace_block_remap(blk_add_trace_remap);
+	WARN_ON(ret);
+	return 0;
+}
+
+static void blk_unregister_tracepoints(void)
+{
+	unregister_trace_block_remap(blk_add_trace_remap);
+	unregister_trace_block_split(blk_add_trace_split);
+	unregister_trace_block_unplug_io(blk_add_trace_unplug_io);
+	unregister_trace_block_unplug_timer(blk_add_trace_unplug_timer);
+	unregister_trace_block_plug(blk_add_trace_plug);
+	unregister_trace_block_sleeprq(blk_add_trace_sleeprq);
+	unregister_trace_block_getrq(blk_add_trace_getrq);
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue);
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge);
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge);
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete);
+	unregister_trace_block_bio_bounce(blk_add_trace_bio_bounce);
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete);
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue);
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue);
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert);
+	unregister_trace_block_rq_abort(blk_add_trace_rq_abort);
+
+	tracepoint_synchronize_unregister();
+}
diff --git a/block/elevator.c b/block/elevator.c
index 9ac82dde99dd..530fcfe2ef07 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -33,6 +33,7 @@
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 #include <linux/hash.h>
 #include <linux/uaccess.h>
 
@@ -586,7 +587,7 @@ void elv_insert(struct request_queue *q, struct request *rq, int where)
 	unsigned ordseq;
 	int unplug_it = 1;
 
-	blk_add_trace_rq(q, rq, BLK_TA_INSERT);
+	trace_block_rq_insert(q, rq);
 
 	rq->q = q;
 
@@ -772,7 +773,7 @@ struct request *elv_next_request(struct request_queue *q)
 			 * not be passed by new incoming requests
 			 */
 			rq->cmd_flags |= REQ_STARTED;
-			blk_add_trace_rq(q, rq, BLK_TA_ISSUE);
+			trace_block_rq_issue(q, rq);
 		}
 
 		if (!q->boundary_rq || q->boundary_rq == rq) {
@@ -921,7 +922,7 @@ void elv_abort_queue(struct request_queue *q)
 	while (!list_empty(&q->queue_head)) {
 		rq = list_entry_rq(q->queue_head.next);
 		rq->cmd_flags |= REQ_QUIET;
-		blk_add_trace_rq(q, rq, BLK_TA_ABORT);
+		trace_block_rq_abort(q, rq);
 		__blk_end_request(rq, -EIO, blk_rq_bytes(rq));
 	}
 }
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index c99e4728ff41..d23fda178163 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -21,6 +21,7 @@
 #include <linux/idr.h>
 #include <linux/hdreg.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 
 #define DM_MSG_PREFIX "core"
 
@@ -504,8 +505,7 @@ static void dec_pending(struct dm_io *io, int error)
 		end_io_acct(io);
 
 		if (io->error != DM_ENDIO_REQUEUE) {
-			blk_add_trace_bio(io->md->queue, io->bio,
-					  BLK_TA_COMPLETE);
+			trace_block_bio_complete(io->md->queue, io->bio);
 
 			bio_endio(io->bio, io->error);
 		}
@@ -598,7 +598,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
 	if (r == DM_MAPIO_REMAPPED) {
 		/* the bio has been remapped so dispatch it */
 
-		blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone,
+		trace_block_remap(bdev_get_queue(clone->bi_bdev), clone,
 				    tio->io->bio->bi_bdev->bd_dev,
 				    clone->bi_sector, sector);
 
diff --git a/fs/bio.c b/fs/bio.c
index 77a55bcceedb..060859c69092 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -26,6 +26,7 @@
 #include <linux/mempool.h>
 #include <linux/workqueue.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 #include <scsi/sg.h>		/* for struct sg_iovec */
 
 static struct kmem_cache *bio_slab __read_mostly;
@@ -1263,7 +1264,7 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors)
 	if (!bp)
 		return bp;
 
-	blk_add_trace_pdu_int(bdev_get_queue(bi->bi_bdev), BLK_TA_SPLIT, bi,
+	trace_block_split(bdev_get_queue(bi->bi_bdev), bi,
 				bi->bi_sector + first_sectors);
 
 	BUG_ON(bi->bi_vcnt != 1);
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index bdf505d33e77..1dba3493d520 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -160,7 +160,6 @@ struct blk_trace {
 
 extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
 extern void blk_trace_shutdown(struct request_queue *);
-extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
 extern int do_blk_trace_setup(struct request_queue *q,
 	char *name, dev_t dev, struct blk_user_trace_setup *buts);
 extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
@@ -186,168 +185,8 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
 	} while (0)
 #define BLK_TN_MAX_MSG		128
 
-/**
- * blk_add_trace_rq - Add a trace for a request oriented action
- * @q:		queue the io is for
- * @rq:		the source request
- * @what:	the action
- *
- * Description:
- *     Records an action against a request. Will log the bio offset + size.
- *
- **/
-static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
-				    u32 what)
-{
-	struct blk_trace *bt = q->blk_trace;
-	int rw = rq->cmd_flags & 0x03;
-
-	if (likely(!bt))
-		return;
-
-	if (blk_discard_rq(rq))
-		rw |= (1 << BIO_RW_DISCARD);
-
-	if (blk_pc_request(rq)) {
-		what |= BLK_TC_ACT(BLK_TC_PC);
-		__blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd);
-	} else  {
-		what |= BLK_TC_ACT(BLK_TC_FS);
-		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL);
-	}
-}
-
-/**
- * blk_add_trace_bio - Add a trace for a bio oriented action
- * @q:		queue the io is for
- * @bio:	the source bio
- * @what:	the action
- *
- * Description:
- *     Records an action against a bio. Will log the bio offset + size.
- *
- **/
-static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
-				     u32 what)
-{
-	struct blk_trace *bt = q->blk_trace;
-
-	if (likely(!bt))
-		return;
-
-	__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL);
-}
-
-/**
- * blk_add_trace_generic - Add a trace for a generic action
- * @q:		queue the io is for
- * @bio:	the source bio
- * @rw:		the data direction
- * @what:	the action
- *
- * Description:
- *     Records a simple trace
- *
- **/
-static inline void blk_add_trace_generic(struct request_queue *q,
-					 struct bio *bio, int rw, u32 what)
-{
-	struct blk_trace *bt = q->blk_trace;
-
-	if (likely(!bt))
-		return;
-
-	if (bio)
-		blk_add_trace_bio(q, bio, what);
-	else
-		__blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL);
-}
-
-/**
- * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload
- * @q:		queue the io is for
- * @what:	the action
- * @bio:	the source bio
- * @pdu:	the integer payload
- *
- * Description:
- *     Adds a trace with some integer payload. This might be an unplug
- *     option given as the action, with the depth at unplug time given
- *     as the payload
- *
- **/
-static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
-					 struct bio *bio, unsigned int pdu)
-{
-	struct blk_trace *bt = q->blk_trace;
-	__be64 rpdu = cpu_to_be64(pdu);
-
-	if (likely(!bt))
-		return;
-
-	if (bio)
-		__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu);
-	else
-		__blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
-}
-
-/**
- * blk_add_trace_remap - Add a trace for a remap operation
- * @q:		queue the io is for
- * @bio:	the source bio
- * @dev:	target device
- * @from:	source sector
- * @to:		target sector
- *
- * Description:
- *     Device mapper or raid target sometimes need to split a bio because
- *     it spans a stripe (or similar). Add a trace for that action.
- *
- **/
-static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
-				       dev_t dev, sector_t from, sector_t to)
-{
-	struct blk_trace *bt = q->blk_trace;
-	struct blk_io_trace_remap r;
-
-	if (likely(!bt))
-		return;
-
-	r.device = cpu_to_be32(dev);
-	r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
-	r.sector = cpu_to_be64(to);
-
-	__blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
-}
-
-/**
- * blk_add_driver_data - Add binary message with driver-specific data
- * @q:		queue the io is for
- * @rq:		io request
- * @data:	driver-specific data
- * @len:	length of driver-specific data
- *
- * Description:
- *     Some drivers might want to write driver-specific data per request.
- *
- **/
-static inline void blk_add_driver_data(struct request_queue *q,
-				       struct request *rq,
-				       void *data, size_t len)
-{
-	struct blk_trace *bt = q->blk_trace;
-
-	if (likely(!bt))
-		return;
-
-	if (blk_pc_request(rq))
-		__blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA,
-				rq->errors, len, data);
-	else
-		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
-				0, BLK_TA_DRV_DATA, rq->errors, len, data);
-}
-
+extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
+				void *data, size_t len);
 extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 			   char __user *arg);
 extern int blk_trace_startstop(struct request_queue *q, int start);
@@ -356,13 +195,8 @@ extern int blk_trace_remove(struct request_queue *q);
 #else /* !CONFIG_BLK_DEV_IO_TRACE */
 #define blk_trace_ioctl(bdev, cmd, arg)		(-ENOTTY)
 #define blk_trace_shutdown(q)			do { } while (0)
-#define blk_add_trace_rq(q, rq, what)		do { } while (0)
-#define blk_add_trace_bio(q, rq, what)		do { } while (0)
-#define blk_add_trace_generic(q, rq, rw, what)	do { } while (0)
-#define blk_add_trace_pdu_int(q, what, bio, pdu)	do { } while (0)
-#define blk_add_trace_remap(q, bio, dev, f, t)	do {} while (0)
-#define blk_add_driver_data(q, rq, data, len)	do {} while (0)
 #define do_blk_trace_setup(q, name, dev, buts)	(-ENOTTY)
+#define blk_add_driver_data(q, rq, data, len)	do {} while (0)
 #define blk_trace_setup(q, name, dev, arg)	(-ENOTTY)
 #define blk_trace_startstop(q, start)		(-ENOTTY)
 #define blk_trace_remove(q)			(-ENOTTY)
diff --git a/include/trace/block.h b/include/trace/block.h
new file mode 100644
index 000000000000..3cc2675ebf01
--- /dev/null
+++ b/include/trace/block.h
@@ -0,0 +1,60 @@
+#ifndef _TRACE_BLOCK_H
+#define _TRACE_BLOCK_H
+
+#include <linux/blkdev.h>
+#include <linux/tracepoint.h>
+
+DEFINE_TRACE(block_rq_abort,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_insert,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_issue,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_requeue,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_complete,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_bio_bounce,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_complete,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_backmerge,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_frontmerge,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_queue,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_getrq,
+	TPPROTO(struct request_queue *q, struct bio *bio, int rw),
+	TPARGS(q, bio, rw));
+DEFINE_TRACE(block_sleeprq,
+	TPPROTO(struct request_queue *q, struct bio *bio, int rw),
+	TPARGS(q, bio, rw));
+DEFINE_TRACE(block_plug,
+	TPPROTO(struct request_queue *q),
+	TPARGS(q));
+DEFINE_TRACE(block_unplug_timer,
+	TPPROTO(struct request_queue *q),
+	TPARGS(q));
+DEFINE_TRACE(block_unplug_io,
+	TPPROTO(struct request_queue *q),
+	TPARGS(q));
+DEFINE_TRACE(block_split,
+	TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu),
+	TPARGS(q, bio, pdu));
+DEFINE_TRACE(block_remap,
+	TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev,
+		sector_t from, sector_t to),
+	TPARGS(q, bio, dev, from, to));
+
+#endif
diff --git a/mm/bounce.c b/mm/bounce.c
index 06722c403058..bd1caaa582b8 100644
--- a/mm/bounce.c
+++ b/mm/bounce.c
@@ -14,6 +14,7 @@
 #include <linux/hash.h>
 #include <linux/highmem.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 #include <asm/tlbflush.h>
 
 #define POOL_SIZE	64
@@ -222,7 +223,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
 	if (!bio)
 		return;
 
-	blk_add_trace_bio(q, *bio_orig, BLK_TA_BOUNCE);
+	trace_block_bio_bounce(q, *bio_orig);
 
 	/*
 	 * at least one page was bounced, fill in possible non-highmem
]

18/2 2026/08/31 21:21 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24874
							output: 38
							thoughts: 338
						

Thoughts:
**Analyzing the Tracepoint Registration in the Block Layer**

Okay, so I'm looking at this `blk_register_tracepoints` function and immediately my expert brain flags a few things. First, the comment mentions this was added back in 2008, which gives me some historical context. The initial implementation uses this `blk_register_tracepoints` function to register a number of tracepoints, like `block_rq_abort` and `block_rq_insert`. The interesting part is the error handling. I see that if `register_trace_block_rq_abort` fails, it just issues a warning with `WARN_ON` and keeps going. I'm used to seeing a more robust approach, but maybe that's a deliberate design choice here.

Then, there's `register_trace_block_rq_insert`. Wait, a `WARN_ON` is triggered on error, which is odd. I would have expected a return, signaling the caller that something has gone wrong. But the function returns 0 even when there's an error. That doesn't make sense!

Wait a second...I'm getting confused! I need to trace this back. Checking the commit history is vital. It seems the original code did actually return an `int`. But, looking at the current code, it has been changed to `void`! This is key. The current version now lacks any error return! So if `register_trace_block_rq_insert` fails, the calling function is completely unaware! This is a potential bug. I should investigate the implications of this change. It’s certainly worth revisiting the tracing infrastructure. The lack of an error return is definitely a red flag that needs attention.



19/2 2026/08/31 21:21 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1327 LineCount:50]

Results:
map[Contents:1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
]

20/2 2026/08/31 21:21 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26629
							output: 24
							thoughts: 305
						

Thoughts:
**My Analysis of Block Tracepoint Registration**

Okay, so `blk_register_tracepoints` returns `void`. That's a little concerning right off the bat – I always prefer functions that return an error code for this sort of critical operation. The code's structure immediately tells me that if `register_trace_block_rq_insert` fails, it just issues a warning and keeps going. That feels a bit fragile to me.

I need to understand *why* it might fail. Ah, right, fault injection via `allocate_probes`. So, it's potentially failing due to simulated memory allocation problems. Is this warning behavior the correct approach? No, absolutely not. Using `WARN_ON` for a memory allocation failure is a cardinal sin, especially in this context! Fault injection and genuine Out-of-Memory (OOM) conditions are going to trigger those warnings, which can lead to a panic if `panic_on_warn` is set, as syzbot does. That's a huge problem.

Wait a second, `register_trace_block_rq_insert` is returning `-ENOMEM` when it fails. If it fails, `blk_register_tracepoints` just prints a warning and... carries on. But that means the tracepoint is *not* registered. If `blk_register_tracepoints` fails to register *some* of the tracepoints, the system is left in an inconsistent state – a mix of registered and unregistered tracepoints. And then, when `blk_unregister_tracepoints` is called, it's going to try to unregister *all* of them, even the ones that weren't registered successfully. But wait, `unregister_trace_*` is safe, right? It handles the case of an unregistered tracepoint by returning `-ENOENT`. So, the main problem here is definitely the `WARN_ON` which will panic the kernel.

So, the real question is: should `blk_register_tracepoints` return an error if registration fails and *clean up* the already registered tracepoints to avoid this inconsistent state? Yes, it absolutely should. I need to trace where `blk_register_tracepoints` is being called to fully understand the impact of this potentially unsafe behavior.



21/2 2026/08/31 21:21 tool codesearch-find-references
0m Args:
map[Name:blk_register_tracepoints]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:get_probe_ref SourceFile:kernel/trace/blktrace.c SourceLine:492]] TruncatedOutput:false]

22/2 2026/08/31 21:21 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27505
							output: 37
							thoughts: 12
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**My Internal Code Review: get_probe_ref Call Site**

Alright, so I see this call is coming from `get_probe_ref`. That's the entry point, or at least a very important part of the pipeline. I need to immediately understand the context of *why* we are calling this function. What's the *purpose* of getting this probe reference at this point in the execution? Is this part of probe initialization? Is it an access check prior to a crucial operation? A defensive copy? What are the implications if this call fails or returns something unexpected?

My immediate questions are: What's the expected *type* of the probe being referenced here? Does `get_probe_ref` return a raw pointer, a smart pointer, or something else entirely? What are the lifecycle guarantees? Does this function manage the probe's lifetime, or is the caller responsible? What about thread safety? Are there any known race conditions in this section of code involving shared access to the probe? And critically, are there any known side effects from this call? I need to check the documentation or the implementation of `get_probe_ref` *immediately* to answer these questions.

I need to quickly assess the error handling: How are errors from `get_probe_ref` managed here? Is the failure handled gracefully? Is there comprehensive logging? Are appropriate exceptions thrown, or are there return codes? What is the *recovery* strategy? Is the program designed to handle probe unavailability gracefully or does it crash? I'll probably start by looking at the control flow around the `get_probe_ref` call to ensure I understand these scenarios.



23/2 2026/08/31 21:21 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:488 LineCount:15]

Results:
map[Contents: 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
 495:	
 496:	static void put_probe_ref(void)
 497:	{
 498:		mutex_lock(&blk_probe_mutex);
 499:		if (!--blk_probes_ref)
 500:			blk_unregister_tracepoints();
 501:		mutex_unlock(&blk_probe_mutex);
 502:	}
]

24/2 2026/08/31 21:21 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28142
							output: 23
							thoughts: 23
						

Thoughts:
Here's my thought process, as it stands:

**Analyzing the Void Return of `get_probe_ref`**

Okay, so `get_probe_ref` returns `void`. That immediately raises a flag. A `void` return means it's likely performing an action *without* providing a direct result. I need to understand what that action is. My primary concern is going to be where that action could be called, and what the dependencies might be. This strongly suggests that I must now figure out where this `get_probe_ref` function is called within the codebase. Is the function modifying an object directly, perhaps setting a member variable? Is it manipulating some global state? Or maybe it is meant to do nothing at all? The lack of a return value means the context of the call is absolutely crucial to understanding its purpose. I need to trace its usage to figure out its role. My next step is clearly to identify all call sites.



25/2 2026/08/31 21:22 tool codesearch-find-references
0m Args:
map[Name:get_probe_ref]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_setup_finalize SourceFile:kernel/trace/blktrace.c SourceLine:759] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_setup_queue SourceFile:kernel/trace/blktrace.c SourceLine:1920]] TruncatedOutput:false]

26/2 2026/08/31 21:22 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28514
							output: 37
							thoughts: 23
						

Thoughts:
Okay, here's my interpretation of those thoughts, presented as my own mental process, given my expertise:

**Diving into Block Tracing Initialization**

Alright, so the focus is on tracing setup, specifically `blk_trace_setup_finalize` and `blk_trace_setup_queue`. That immediately tells me we're dealing with the initialization and teardown of block device tracing, which is critical for performance analysis and debugging. The `finalize` function likely handles cleanup – freeing resources, disabling tracing on specific queues if necessary, and maybe writing final trace data if there's any buffering. I'll need to look at how it integrates with shutdown paths and error handling.

`blk_trace_setup_queue` is where the action starts. This is where the tracing hooks are probably being established for individual block queues, likely at device registration or queue creation time. The architecture should be interesting: are we using kprobes, ftrace, or something more specialized for the block layer? What events are we hooking? And, very importantly, how efficient is this setup? We need to minimize any overhead, particularly in high-IOPS environments. I'll want to assess the impact on context switches and cache coherency. Also, the parameters to this function are key -- what control knobs are we exposing to the user for things like filtering or sample rates? And how does it interact with things like the trace buffer allocation strategy (per-CPU, global, etc.)? I bet it needs to be thread safe too. The interactions with workqueues and interrupts would also be interesting. Need to keep in mind, potential race conditions and locking strategies as well.



27/2 2026/08/31 21:22 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:750 LineCount:20]

Results:
map[Contents: 750:		if (buts->start_lba)
 751:			bt->start_lba = buts->start_lba;
 752:		if (buts->end_lba)
 753:			bt->end_lba = buts->end_lba;
 754:	
 755:		bt->pid = buts->pid;
 756:		bt->trace_state = Blktrace_setup;
 757:	
 758:		rcu_assign_pointer(q->blk_trace, bt);
 759:		get_probe_ref();
 760:	}
 761:	
 762:	int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 763:			    struct block_device *bdev,
 764:			    char __user *arg)
 765:	{
 766:		struct blk_user_trace_setup2 buts2;
 767:		struct blk_user_trace_setup buts;
 768:		struct blk_trace *bt;
 769:		unsigned int memflags;
]

28/2 2026/08/31 21:22 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29238
							output: 38
							thoughts: 10
						

Thoughts:
Okay, here's my summary, presented as a first-person account, assuming I'm an expert in the field:

**Internalizing the `blk_trace_setup_queue` Process**

Alright, let's break down this `blk_trace_setup_queue` function. Thinking about it from a high level, I'm immediately focusing on the implications for tracing block I/O. This function *has* to be responsible for setting up the necessary infrastructure to capture and record the interactions between the kernel's block layer and the underlying storage devices, or I/O schedulers, or whatever abstraction it sits between.

So, digging deeper, I'm mentally parsing the likely steps. I suspect it'll start with the allocation of some control structures – probably things like trace buffers, filter tables, and maybe even some kind of per-queue context. These structures will hold the vital information about which requests to trace, where to store the resulting trace data, and how to format it. I'm wondering if this setup involves allocating a new trace buffer for a block device or if it uses existing buffers.

Then, there's the question of the actual *enabling* mechanism. It's likely that it needs to hook into the relevant points in the block I/O path. This means attaching tracepoints, kprobes, or ftrace events to the code paths that deal with request submission, completion, and merging. It has to make sure the tracing code runs. It probably needs to ensure that tracing is only enabled at the right time.

Beyond that, I'm also considering the locking implications. This is the kernel, after all. There's almost certainly going to be some form of locking involved to protect the trace structures from concurrent access from different CPUs or interrupt handlers. Probably a spinlock or a mutex. I'm guessing this function is carefully designed to avoid deadlocks.

The error handling is also key. What happens if memory allocation fails? What if the tracepoints can't be registered? Proper error checking and graceful degradation are essential here. I assume it'll return a meaningful error code if any of this setup fails, so that tracing initialization can be handled gracefully by a higher level function or the kernel's modules.

Finally, I'm thinking about the performance impact. This whole thing needs to be as lightweight as possible. It has to avoid introducing excessive overhead during normal I/O operations, which is why the design of this `blk_trace_setup_queue` function is so critical for the overall efficiency of the tracing. Ideally, the function would only set up the tracing framework, which, then, would be used elsewhere in the kernel to trace I/O operation.



29/2 2026/08/31 21:22 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1910 LineCount:20]

Results:
map[Contents:1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
]

30/2 2026/08/31 21:22 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30133
							output: 41
							thoughts: 85
						

Thoughts:
**Analyzing the `get_probe_ref` Function Call**

Okay, so I'm digging into this code and trying to understand this sequence. It looks like `get_probe_ref` is getting called *after* `blk_trace` is properly set up and assigned to `q->blk_trace`. That's the expected order of operations based on what I see here.

But then, something's snagging me. I see that `blk_register_tracepoints` *doesn't* return an error if it fails; it just throws a warning. That seems a bit... unusual, given the importance of setting up tracepoints. The really curious part is that it now returns `void`. My first instinct is to find out *why* that return type was changed. I'm going to delve into the history of `blk_register_tracepoints` to see when and why this shift happened. Understanding the reasoning behind the change in return type will probably illuminate the design considerations here and might uncover some important nuances.



31/2 2026/08/31 21:22 tool git-log
0m Args:
map[CodeRegexp:static void blk_register_tracepoints PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:3c289ba7c320 blktrace: remove blk_probe_mutex
]

32/2 2026/08/31 21:22 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30511
							output: 26
							thoughts: 17
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as requested, in the first person and assuming an expert audience:

**Analyzing the Digital Signature `3c289ba7c320`**

Alright, let's take a look at this signature, `3c289ba7c320`. My immediate focus, as always, is on context. Is this a hash? A cryptographic signature? An identifier? Without knowing the originating system or the data it's tied to, drawing definitive conclusions is impossible, but based on its structure, my initial hypotheses are:

*   **Potential Hash:** It's hex-encoded, which strongly suggests a hash or checksum. The length, if it’s a standard hash like MD5, SHA-1, or SHA-256 is an immediate flag. I need to know the length to start making some educated guesses, or I may even test the validity of the hash, based on common hash algorithms. It could also be a short hash if it came from something more obscure.
*   **Cryptographic Component:** If it's part of a larger encrypted string, a signature, or a key identifier, its significance becomes dramatically different. I'll need to know the associated protocol or algorithm to deconstruct it, and whether its length is compatible with common crypto key sizes.
*   **Identifier:** Could it be a short UID or object identifier within a specific system? If it came from a database or API, I would likely have more information about it.

My immediate next steps would be:

1.  **Context Gathering:** Where did I encounter this string? What other associated data is available? What system or protocol is it related to?
2.  **Length Analysis:** Determine the length in characters and bytes. This is the first step in determining it's likely significance, or even what algorithm it is.
3.  **Algorithm Hypothesis:** Based on the length and context, I'd form hypotheses about the possible algorithms or data formats.
4.  **Lookup:** Check against known databases of hashes and signatures, if applicable.
5.  **Brute-Force (If Necessary):** I'd consider running it through common hash and cryptographic functions to attempt a reverse lookup, or a proof of concept. But I'll need the proper length, and information on whether it's the beginning, middle, or end.
6.  **Deconstruction:** If it's part of a larger structure, I would attempt to identify its position and function within that structure.
7.  **Correlation:** I would attempt to determine if it is related to other known digital footprints, or digital artifacts.

Ultimately, without knowing the origin, `3c289ba7c320` is just a string. However, I can draw many deductions just by looking at the structure. To understand it, I must understand its origin. I need context.



33/2 2026/08/31 21:22 tool git-show
0m Args:
map[Commit:3c289ba7c320]

Results:
map[Output:commit 3c289ba7c320560ee74979a8895141c829046a2d
Author: Li Zefan <lizf@cn.fujitsu.com>
Date:   Fri Mar 20 09:48:26 2009 +0800

    blktrace: remove blk_probe_mutex
    
    blk_register_tracepoints() always returns 0, so make it return void,
    thus we don't need to use blk_probe_mutex to protect blk_probes_ref.
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
    Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jens Axboe <jens.axboe@oracle.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    LKML-Reference: <49C2F5EA.8060606@cn.fujitsu.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 73845b7968bb..223b92e77b3f 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -47,10 +47,9 @@ static struct tracer_flags blk_tracer_flags = {
 };
 
 /* Global reference count of probes */
-static DEFINE_MUTEX(blk_probe_mutex);
 static atomic_t blk_probes_ref = ATOMIC_INIT(0);
 
-static int blk_register_tracepoints(void);
+static void blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 /*
@@ -256,10 +255,8 @@ static void blk_trace_cleanup(struct blk_trace *bt)
 	free_percpu(bt->sequence);
 	free_percpu(bt->msg_data);
 	kfree(bt);
-	mutex_lock(&blk_probe_mutex);
 	if (atomic_dec_and_test(&blk_probes_ref))
 		blk_unregister_tracepoints();
-	mutex_unlock(&blk_probe_mutex);
 }
 
 int blk_trace_remove(struct request_queue *q)
@@ -471,13 +468,8 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
-	mutex_lock(&blk_probe_mutex);
-	if (atomic_add_return(1, &blk_probes_ref) == 1) {
-		ret = blk_register_tracepoints();
-		if (ret)
-			goto probe_err;
-	}
-	mutex_unlock(&blk_probe_mutex);
+	if (atomic_add_return(1, &blk_probes_ref) == 1)
+		blk_register_tracepoints();
 
 	ret = -EBUSY;
 	old_bt = xchg(&q->blk_trace, bt);
@@ -487,9 +479,6 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	}
 
 	return 0;
-probe_err:
-	atomic_dec(&blk_probes_ref);
-	mutex_unlock(&blk_probe_mutex);
 err:
 	if (bt) {
 		if (bt->msg_file)
@@ -863,7 +852,7 @@ void blk_add_driver_data(struct request_queue *q,
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static int blk_register_tracepoints(void)
+static void blk_register_tracepoints(void)
 {
 	int ret;
 
@@ -901,7 +890,6 @@ static int blk_register_tracepoints(void)
 	WARN_ON(ret);
 	ret = register_trace_block_remap(blk_add_trace_remap);
 	WARN_ON(ret);
-	return 0;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1099,11 +1087,8 @@ static void blk_tracer_print_header(struct seq_file *m)
 
 static void blk_tracer_start(struct trace_array *tr)
 {
-	mutex_lock(&blk_probe_mutex);
 	if (atomic_add_return(1, &blk_probes_ref) == 1)
-		if (blk_register_tracepoints())
-			atomic_dec(&blk_probes_ref);
-	mutex_unlock(&blk_probe_mutex);
+		blk_register_tracepoints();
 	trace_flags &= ~TRACE_ITER_CONTEXT_INFO;
 }
 
@@ -1118,10 +1103,8 @@ static int blk_tracer_init(struct trace_array *tr)
 static void blk_tracer_stop(struct trace_array *tr)
 {
 	trace_flags |= TRACE_ITER_CONTEXT_INFO;
-	mutex_lock(&blk_probe_mutex);
 	if (atomic_dec_and_test(&blk_probes_ref))
 		blk_unregister_tracepoints();
-	mutex_unlock(&blk_probe_mutex);
 }
 
 static void blk_tracer_reset(struct trace_array *tr)
]

34/2 2026/08/31 21:22 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32657
							output: 37
							thoughts: 432
						

Thoughts:
**Analyzing the "blk_register_tracepoints() always returns 0" Commit**

Okay, so this commit is suggesting that `blk_register_tracepoints()` *always* returns 0, and therefore should be `void`. But hold on, the individual `register_trace_block_*` functions actually return an `int`, and that `int` *can* be `-ENOMEM`, which triggers `WARN_ON(ret)`. That's the first red flag. Why did someone think it was always 0? Probably because back in 2009, those `register_trace_*` calls likely *didn't* fail, or perhaps failures were simply ignored, with 0 being returned anyway.

Let's dig deeper, say into `register_trace_block_rq_insert`. Right, it's a macro generated by either `DEFINE_TRACE` or `TRACE_EVENT`. Okay, in modern kernels, these macros eventually call `tracepoint_probe_register`, which *does* allocate memory, and thus *can* fail, returning `-ENOMEM`. And, as stated before, a failure triggers that `WARN_ON(ret)`.

But, what happens if it *does* fail? We have a registered block, but an unregistered tracepoint. The tracepoint isn't registered, so we simply won't get trace events for *that* specific point. That's not ideal, but it's not the end of the world. However, `WARN_ON` might cause a kernel panic if `panic_on_warn` is set. So, the simple solution seems to be removing the `WARN_ON(ret)`, right?

However, removing the `WARN_ON(ret)` seems like a hack. Should we handle the error properly? If we wanted to do it right, we'd need to unregister the already registered tracepoints and then return the error code. But, `blk_register_tracepoints` is called from `get_probe_ref`, which is, in turn, called from `blk_trace_setup_queue` and `blk_trace_setup_finalize`. Wait, now, `get_probe_ref` is called *after* `rcu_assign_pointer(q->blk_trace, bt)`. If `get_probe_ref` fails, we've got a problem, we need to undo the setup.

Alright, let's go back and look at `get_probe_ref` again.



35/2 2026/08/31 21:22 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:488 LineCount:15]

Results:
map[Contents: 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
 495:	
 496:	static void put_probe_ref(void)
 497:	{
 498:		mutex_lock(&blk_probe_mutex);
 499:		if (!--blk_probes_ref)
 500:			blk_unregister_tracepoints();
 501:		mutex_unlock(&blk_probe_mutex);
 502:	}
]

36/2 2026/08/31 21:22 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33876
							output: 38
							thoughts: 108
						

Thoughts:
**Considering Error Handling in Block Tracepoint Registration**

Okay, so I'm looking at this `blk_register_tracepoints` function and I'm thinking, what if we made it return an error code? That seems like a reasonable approach to signal failure. But, if we did that, we'd have a ripple effect. `get_probe_ref` would also need to return an error, which, okay, that's manageable. Then, `blk_trace_setup_queue` and `blk_trace_setup_finalize` would have to be modified to gracefully handle that potential error return.

Ah, hang on a second. Remind myself... `blk_trace_setup_finalize` is called within the context of an ioctl operation, right? And `blk_trace_setup_queue` is called from sysfs? Right, so ioctl and sysfs calls need to change. Let's dig into `blk_trace_setup_queue` first. It's the sysfs call, so it probably requires different considerations.



37/2 2026/08/31 21:23 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1915 LineCount:15]

Results:
map[Contents:1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
]

38/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34443
							output: 30
							thoughts: 105
						

Thoughts:
**My Analysis of Block Device Tracepoint Registration**

Okay, so I'm wrestling with a potential failure scenario during block device tracepoint registration. The `get_probe_ref` function, if it fails, throws a wrench in the works. I need to be careful with resource cleanup here. If it fails, I've got to undo the `rcu_assign_pointer(q->blk_trace, bt)` call, essentially unassigning the trace structure, and then free the `bt` structure itself. It’s a standard rollback procedure.

But here's the kicker: `blk_register_tracepoints` registers these tracepoints globally, affecting *all* block devices in the system. So, a failure here isn't just a local issue; it signifies a systemic problem—the global tracepoints aren’t fully set up.

The question then becomes: how aggressive do I need to be about error handling? Should I just ignore the failure and avoid a `WARN`, or is a more proactive response needed? Is a single error really indicative of a major problem?

To get a clearer picture, I'll need to see how other subsystems deal with these tracepoint registration failures. I should check how they handle similar issues, whether they simply log the error, halt the process, or gracefully continue. That comparative analysis will help me make the best decision for this scenario.



39/2 2026/08/31 21:23 tool grepper
0m Args:
map[Expression:register_trace_.*\( PathPrefix:kernel/trace/]

Results:
map[Output:
Full output is too long, showing 500 out of 589 lines.
Use more precise expression if possible.

kernel/trace/blktrace.c=1327=static void blk_register_tracepoints(void)
--
kernel/trace/blktrace.c-1330-
kernel/trace/blktrace.c:1331:	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1332-	WARN_ON(ret);
kernel/trace/blktrace.c:1333:	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c-1334-	WARN_ON(ret);
kernel/trace/blktrace.c:1335:	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c-1336-	WARN_ON(ret);
kernel/trace/blktrace.c:1337:	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c-1338-	WARN_ON(ret);
kernel/trace/blktrace.c:1339:	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c-1340-	WARN_ON(ret);
kernel/trace/blktrace.c:1341:	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c-1342-	WARN_ON(ret);
kernel/trace/blktrace.c:1343:	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c-1344-	WARN_ON(ret);
kernel/trace/blktrace.c:1345:	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c-1346-	WARN_ON(ret);
kernel/trace/blktrace.c:1347:	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c-1348-	WARN_ON(ret);
kernel/trace/blktrace.c:1349:	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c-1350-	WARN_ON(ret);
kernel/trace/blktrace.c:1351:	ret = register_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1352-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c-1353-	WARN_ON(ret);
kernel/trace/blktrace.c:1354:	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
kernel/trace/blktrace.c-1355-						     NULL);
kernel/trace/blktrace.c-1356-	WARN_ON(ret);
kernel/trace/blktrace.c:1357:	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
kernel/trace/blktrace.c-1358-						NULL);
kernel/trace/blktrace.c-1359-	WARN_ON(ret);
kernel/trace/blktrace.c:1360:	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c-1361-	WARN_ON(ret);
kernel/trace/blktrace.c:1362:	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c-1363-	WARN_ON(ret);
kernel/trace/blktrace.c:1364:	ret = register_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c-1365-	WARN_ON(ret);
kernel/trace/blktrace.c:1366:	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c-1367-	WARN_ON(ret);
kernel/trace/blktrace.c:1368:	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c-1369-	WARN_ON(ret);
--
kernel/trace/blktrace.c=1372=static void blk_unregister_tracepoints(void)
kernel/trace/blktrace.c-1373-{
kernel/trace/blktrace.c:1374:	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c:1375:	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c:1376:	unregister_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c:1377:	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c:1378:	unregister_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c:1379:	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
kernel/trace/blktrace.c:1380:	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
kernel/trace/blktrace.c:1381:	unregister_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1382-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c:1383:	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c:1384:	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c:1385:	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c:1386:	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c:1387:	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c:1388:	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c:1389:	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c:1390:	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c:1391:	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c:1392:	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1393-
--
kernel/trace/blktrace.c=1839=static int __init __init_blk_tracer(void)
kernel/trace/blktrace.c-1840-{
kernel/trace/blktrace.c:1841:	if (!register_trace_event(&trace_blk_event)) {
kernel/trace/blktrace.c-1842-		pr_warn("Warning: could not register block events\n");
--
kernel/trace/blktrace.c-1847-		pr_warn("Warning: could not register the block tracer\n");
kernel/trace/blktrace.c:1848:		unregister_trace_event(&trace_blk_event);
kernel/trace/blktrace.c-1849-		return 1;
--
kernel/trace/fgraph.c=1236=static int start_graph_tracing(void)
--
kernel/trace/fgraph.c-1257-	if (!ret) {
kernel/trace/fgraph.c:1258:		ret = register_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1259-		if (ret)
--
kernel/trace/fgraph.c=1426=void unregister_ftrace_graph(struct fgraph_ops *gops)
--
kernel/trace/fgraph.c-1463-		unregister_pm_notifier(&ftrace_suspend_notifier);
kernel/trace/fgraph.c:1464:		unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1465-	}
--
kernel/trace/ftrace.c=8691=void ftrace_pid_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/ftrace.c-8693-	if (enable) {
kernel/trace/ftrace.c:8694:		register_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8695-						  tr);
kernel/trace/ftrace.c:8696:		register_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8697-						  tr);
kernel/trace/ftrace.c-8698-	} else {
kernel/trace/ftrace.c:8699:		unregister_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8700-						    tr);
kernel/trace/ftrace.c:8701:		unregister_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8702-						    tr);
--
kernel/trace/ftrace.c=8706=static void clear_ftrace_pids(struct trace_array *tr, int type)
--
kernel/trace/ftrace.c-8722-	if (!still_need_pid_events(type, pid_list, no_pid_list)) {
kernel/trace/ftrace.c:8723:		unregister_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8724-		for_each_possible_cpu(cpu)
--
kernel/trace/ftrace.c=8932=pid_write(struct file *filp, const char __user *ubuf,
--
kernel/trace/ftrace.c-8983-		/* Register a probe to set whether to ignore the tracing of a task */
kernel/trace/ftrace.c:8984:		register_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8985-	}
--
kernel/trace/trace_branch.c=178=__init static int init_branch_tracer(void)
--
kernel/trace/trace_branch.c-181-
kernel/trace/trace_branch.c:182:	ret = register_trace_event(&trace_branch_event);
kernel/trace/trace_branch.c-183-	if (!ret) {
--
kernel/trace/trace_eprobe.c=77=static int eprobe_dyn_event_show(struct seq_file *m, struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-94-
kernel/trace/trace_eprobe.c:95:static int unregister_trace_eprobe(struct trace_eprobe *ep)
kernel/trace/trace_eprobe.c-96-{
--
kernel/trace/trace_eprobe.c=116=static int eprobe_dyn_event_release(struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-118-	struct trace_eprobe *ep = to_trace_eprobe(ev);
kernel/trace/trace_eprobe.c:119:	int ret = unregister_trace_eprobe(ep);
kernel/trace/trace_eprobe.c-120-
--
kernel/trace/trace_events.c=645=int trace_event_raw_init(struct trace_event_call *call)
--
kernel/trace/trace_events.c-648-
kernel/trace/trace_events.c:649:	id = register_trace_event(&call->event);
kernel/trace/trace_events.c-650-	if (!id)
--
kernel/trace/trace_events.c=1093=void trace_event_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/trace_events.c-1095-	if (enable) {
kernel/trace/trace_events.c:1096:		register_trace_prio_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1097-						       tr, INT_MIN);
kernel/trace/trace_events.c:1098:		register_trace_prio_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1099-						       tr, INT_MAX);
kernel/trace/trace_events.c-1100-	} else {
kernel/trace/trace_events.c:1101:		unregister_trace_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1102-						    tr);
kernel/trace/trace_events.c:1103:		unregister_trace_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1104-						    tr);
--
kernel/trace/trace_events.c=1188=static void unregister_pid_events(struct trace_array *tr)
kernel/trace/trace_events.c-1189-{
kernel/trace/trace_events.c:1190:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_pre, tr);
kernel/trace/trace_events.c:1191:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_post, tr);
kernel/trace/trace_events.c-1192-
kernel/trace/trace_events.c:1193:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1194:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1195-
kernel/trace/trace_events.c:1196:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1197:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1198-
kernel/trace/trace_events.c:1199:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1200:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1201-}
--
kernel/trace/trace_events.c=2562=static void register_pid_events(struct trace_array *tr)
--
kernel/trace/trace_events.c-2569-	 */
kernel/trace/trace_events.c:2570:	register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_pre,
kernel/trace/trace_events.c-2571-					 tr, INT_MAX);
kernel/trace/trace_events.c:2572:	register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_post,
kernel/trace/trace_events.c-2573-					 tr, 0);
kernel/trace/trace_events.c-2574-
kernel/trace/trace_events.c:2575:	register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2576-					 tr, INT_MAX);
kernel/trace/trace_events.c:2577:	register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2578-					 tr, 0);
kernel/trace/trace_events.c-2579-
kernel/trace/trace_events.c:2580:	register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2581-					     tr, INT_MAX);
kernel/trace/trace_events.c:2582:	register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2583-					     tr, 0);
kernel/trace/trace_events.c-2584-
kernel/trace/trace_events.c:2585:	register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2586-					 tr, INT_MAX);
kernel/trace/trace_events.c:2587:	register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2588-					 tr, 0);
--
kernel/trace/trace_events.c=3350=static void event_remove(struct trace_event_call *call)
--
kernel/trace/trace_events.c-3372-	if (call->event.funcs)
kernel/trace/trace_events.c:3373:		__unregister_trace_event(&call->event);
kernel/trace/trace_events.c-3374-	remove_event_from_tracers(call);
--
kernel/trace/trace_events_synth.c=955=static int register_synth_event(struct synth_event *event)
--
kernel/trace/trace_events_synth.c-977-
kernel/trace/trace_events_synth.c:978:	ret = register_trace_event(&call->event);
kernel/trace/trace_events_synth.c-979-	if (!ret) {
--
kernel/trace/trace_events_synth.c-999-	ret = set_synth_event_print_fmt(call);
kernel/trace/trace_events_synth.c:1000:	/* unregister_trace_event() will be called inside */
kernel/trace/trace_events_synth.c-1001-	if (ret < 0)
--
kernel/trace/trace_events_synth.c-1005- err:
kernel/trace/trace_events_synth.c:1006:	unregister_trace_event(&call->event);
kernel/trace/trace_events_synth.c-1007-	goto out;
--
kernel/trace/trace_events_user.c=1966=static int user_event_trace_register(struct user_event *user)
--
kernel/trace/trace_events_user.c-1969-
kernel/trace/trace_events_user.c:1970:	ret = register_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1971-
--
kernel/trace/trace_events_user.c-1977-	if (ret)
kernel/trace/trace_events_user.c:1978:		unregister_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1979-
--
kernel/trace/trace_fprobe.c=797=static int trace_fprobe_verify_target(struct trace_fprobe *tf)
--
kernel/trace/trace_fprobe.c-813-/* Internal register function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:814:static int __register_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-815-{
--
kernel/trace/trace_fprobe.c-841-/* Internal unregister function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:842:static void __unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-843-{
--
kernel/trace/trace_fprobe.c-853-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_fprobe.c:854:static int unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-855-{
--
kernel/trace/trace_fprobe.c-872-unreg:
kernel/trace/trace_fprobe.c:873:	__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-874-	dyn_event_remove(&tf->devent);
--
kernel/trace/trace_fprobe.c=908=static int append_trace_fprobe_event(struct trace_fprobe *tf, struct trace_fprobe *to)
--
kernel/trace/trace_fprobe.c-945-/* Register a trace_probe and probe_event, and check the fprobe is available. */
kernel/trace/trace_fprobe.c:946:static int register_trace_fprobe_event(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-947-{
--
kernel/trace/trace_fprobe.c=1209=static int trace_fprobe_create_internal(int argc, const char *argv[],
--
kernel/trace/trace_fprobe.c-1378-
kernel/trace/trace_fprobe.c:1379:	ret = register_trace_fprobe_event(tf);
kernel/trace/trace_fprobe.c-1380-	if (ret) {
--
kernel/trace/trace_fprobe.c=1419=static int trace_fprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_fprobe.c-1421-	struct trace_fprobe *tf = to_trace_fprobe(ev);
kernel/trace/trace_fprobe.c:1422:	int ret = unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1423-
--
kernel/trace/trace_fprobe.c=1457=static int enable_trace_fprobe(struct trace_event_call *call,
--
kernel/trace/trace_fprobe.c-1479-		list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
kernel/trace/trace_fprobe.c:1480:			ret = __register_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1481-			if (ret < 0)
--
kernel/trace/trace_fprobe.c-1490-	list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list)
kernel/trace/trace_fprobe.c:1491:		__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1492-	if (file)
--
kernel/trace/trace_functions_graph.c=1814=static __init int init_graph_trace(void)
--
kernel/trace/trace_functions_graph.c-1817-
kernel/trace/trace_functions_graph.c:1818:	if (!register_trace_event(&graph_trace_entry_event)) {
kernel/trace/trace_functions_graph.c-1819-		pr_warn("Warning: could not register graph trace events\n");
--
kernel/trace/trace_functions_graph.c-1823-#ifdef CONFIG_FUNCTION_GRAPH_RETADDR
kernel/trace/trace_functions_graph.c:1824:	if (!register_trace_event(&graph_trace_retaddr_entry_event)) {
kernel/trace/trace_functions_graph.c-1825-		pr_warn("Warning: could not register graph trace retaddr events\n");
--
kernel/trace/trace_functions_graph.c-1829-
kernel/trace/trace_functions_graph.c:1830:	if (!register_trace_event(&graph_trace_ret_event)) {
kernel/trace/trace_functions_graph.c-1831-		pr_warn("Warning: could not register graph trace events\n");
--
kernel/trace/trace_kprobe.c=469=static bool within_notrace_func(struct trace_kprobe *tk)
--
kernel/trace/trace_kprobe.c-494-/* Internal register function - just handle k*probes and flags */
kernel/trace/trace_kprobe.c:495:static int __register_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-496-{
--
kernel/trace/trace_kprobe.c-532-/* Internal unregister function - just handle k*probes and flags */
kernel/trace/trace_kprobe.c:533:static void __unregister_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-534-{
--
kernel/trace/trace_kprobe.c-548-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_kprobe.c:549:static int unregister_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-550-{
--
kernel/trace/trace_kprobe.c-567-unreg:
kernel/trace/trace_kprobe.c:568:	__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-569-	dyn_event_remove(&tk->devent);
--
kernel/trace/trace_kprobe.c=604=static int append_trace_kprobe(struct trace_kprobe *tk, struct trace_kprobe *to)
--
kernel/trace/trace_kprobe.c-626-	/* Register k*probe */
kernel/trace/trace_kprobe.c:627:	ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-628-	if (ret == -ENOENT && !trace_kprobe_module_exist(tk)) {
--
kernel/trace/trace_kprobe.c-641-/* Register a trace_probe and probe_event */
kernel/trace/trace_kprobe.c:642:static int register_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-643-{
--
kernel/trace/trace_kprobe.c-671-	/* Register k*probe */
kernel/trace/trace_kprobe.c:672:	ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-673-	if (ret == -ENOENT && !trace_kprobe_module_exist(tk)) {
--
kernel/trace/trace_kprobe.c=689=static int register_module_trace_kprobe(struct module *mod, struct trace_kprobe *tk)
--
kernel/trace/trace_kprobe.c-697-	if (!ret)
kernel/trace/trace_kprobe.c:698:		ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-699-	return ret;
--
kernel/trace/trace_kprobe.c=703=static int trace_kprobe_module_callback(struct notifier_block *nb,
--
kernel/trace/trace_kprobe.c-718-			/* Don't need to check busy - this should have gone. */
kernel/trace/trace_kprobe.c:719:			__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-720-			ret = register_module_trace_kprobe(mod, tk);
--
kernel/trace/trace_kprobe.c=854=static int trace_kprobe_create_internal(int argc, const char *argv[],
--
kernel/trace/trace_kprobe.c-1076-
kernel/trace/trace_kprobe.c:1077:	ret = register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1078-	if (ret) {
--
kernel/trace/trace_kprobe.c=1298=static int trace_kprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_kprobe.c-1300-	struct trace_kprobe *tk = to_trace_kprobe(ev);
kernel/trace/trace_kprobe.c:1301:	int ret = unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1302-
--
kernel/trace/trace_kprobe.c=1933=create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
--
kernel/trace/trace_kprobe.c-1970-
kernel/trace/trace_kprobe.c:1971:	ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1972-	if (ret < 0)
--
kernel/trace/trace_kprobe.c=1978=void destroy_local_trace_kprobe(struct trace_event_call *event_call)
--
kernel/trace/trace_kprobe.c-1990-
kernel/trace/trace_kprobe.c:1991:	__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1992-
--
kernel/trace/trace_osnoise.c=1004=static int hook_irq_events(void)
--
kernel/trace/trace_osnoise.c-1007-
kernel/trace/trace_osnoise.c:1008:	ret = register_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1009-	if (ret)
--
kernel/trace/trace_osnoise.c-1011-
kernel/trace/trace_osnoise.c:1012:	ret = register_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c-1013-	if (ret)
--
kernel/trace/trace_osnoise.c-1022-out_irq_exit:
kernel/trace/trace_osnoise.c:1023:	unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c-1024-out_unregister_entry:
kernel/trace/trace_osnoise.c:1025:	unregister_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1026-out_err:
--
kernel/trace/trace_osnoise.c=1036=static void unhook_irq_events(void)
--
kernel/trace/trace_osnoise.c-1038-	osnoise_arch_unregister();
kernel/trace/trace_osnoise.c:1039:	unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c:1040:	unregister_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1041-}
--
kernel/trace/trace_osnoise.c=1100=static int hook_softirq_events(void)
--
kernel/trace/trace_osnoise.c-1103-
kernel/trace/trace_osnoise.c:1104:	ret = register_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c-1105-	if (ret)
--
kernel/trace/trace_osnoise.c-1107-
kernel/trace/trace_osnoise.c:1108:	ret = register_trace_softirq_exit(trace_softirq_exit_callback, NULL);
kernel/trace/trace_osnoise.c-1109-	if (ret)
--
kernel/trace/trace_osnoise.c-1114-out_unreg_entry:
kernel/trace/trace_osnoise.c:1115:	unregister_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c-1116-out_err:
--
kernel/trace/trace_osnoise.c=1126=static void unhook_softirq_events(void)
kernel/trace/trace_osnoise.c-1127-{
kernel/trace/trace_osnoise.c:1128:	unregister_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c:1129:	unregister_trace_softirq_exit(trace_softirq_exit_callback, NULL);
kernel/trace/trace_osnoise.c-1130-}
--
kernel/trace/trace_osnoise.c=1239=static int register_migration_monitor(void)
--
kernel/trace/trace_osnoise.c-1250-
kernel/trace/trace_osnoise.c:1251:		ret = register_trace_sched_migrate_task(trace_sched_migrate_callback, NULL);
kernel/trace/trace_osnoise.c-1252-		if (!ret)
--
kernel/trace/trace_osnoise.c=1259=static void unregister_migration_monitor(void)
--
kernel/trace/trace_osnoise.c-1263-
kernel/trace/trace_osnoise.c:1264:	unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL);
kernel/trace/trace_osnoise.c-1265-	monitor_enabled = false;
--
kernel/trace/trace_osnoise.c=1302=static int hook_thread_events(void)
--
kernel/trace/trace_osnoise.c-1305-
kernel/trace/trace_osnoise.c:1306:	ret = register_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1307-	if (ret)
--
kernel/trace/trace_osnoise.c-1316-out_unreg:
kernel/trace/trace_osnoise.c:1317:	unregister_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1318-	return -EINVAL;
--
kernel/trace/trace_osnoise.c=1327=static void unhook_thread_events(void)
kernel/trace/trace_osnoise.c-1328-{
kernel/trace/trace_osnoise.c:1329:	unregister_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1330-	unregister_migration_monitor();
--
kernel/trace/trace_output.c=862=void trace_event_read_unlock(void)
--
kernel/trace/trace_output.c-881- */
kernel/trace/trace_output.c:882:int register_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-883-{
--
kernel/trace/trace_output.c=924=EXPORT_SYMBOL_GPL(register_trace_event);
--
kernel/trace/trace_output.c-928- */
kernel/trace/trace_output.c:929:int __unregister_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-930-{
--
kernel/trace/trace_output.c-939- */
kernel/trace/trace_output.c:940:int unregister_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-941-{
kernel/trace/trace_output.c-942-	down_write(&trace_event_sem);
kernel/trace/trace_output.c:943:	__unregister_trace_event(event);
kernel/trace/trace_output.c-944-	up_write(&trace_event_sem);
--
kernel/trace/trace_output.c=1922=__init int init_events(void)
--
kernel/trace/trace_output.c-1928-		event = events[i];
kernel/trace/trace_output.c:1929:		ret = register_trace_event(event);
kernel/trace/trace_output.c-1930-		WARN_ONCE(!ret, "event %d failed to register", event->type);
--
kernel/trace/trace_output.h=43=trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry);
--
kernel/trace/trace_output.h-45-/* used by module unregistering */
kernel/trace/trace_output.h:46:extern int __unregister_trace_event(struct trace_event *event);
kernel/trace/trace_output.h-47-extern struct rw_semaphore trace_event_sem;
--
kernel/trace/trace_probe.c=2691=int trace_probe_register_event_call(struct trace_probe *tp)
--
kernel/trace/trace_probe.c-2701-
kernel/trace/trace_probe.c:2702:	ret = register_trace_event(&call->event);
kernel/trace/trace_probe.c-2703-	if (!ret)
--
kernel/trace/trace_probe.c-2707-	if (ret)
kernel/trace/trace_probe.c:2708:		unregister_trace_event(&call->event);
kernel/trace/trace_probe.c-2709-
--
kernel/trace/trace_sched_switch.c=52=static int tracing_sched_register(void)
--
kernel/trace/trace_sched_switch.c-55-
kernel/trace/trace_sched_switch.c:56:	ret = register_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-57-	if (ret) {
--
kernel/trace/trace_sched_switch.c-62-
kernel/trace/trace_sched_switch.c:63:	ret = register_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-64-	if (ret) {
--
kernel/trace/trace_sched_switch.c-69-
kernel/trace/trace_sched_switch.c:70:	ret = register_trace_sched_switch(probe_sched_switch, NULL);
kernel/trace/trace_sched_switch.c-71-	if (ret) {
--
kernel/trace/trace_sched_switch.c-78-fail_deprobe_wake_new:
kernel/trace/trace_sched_switch.c:79:	unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-80-fail_deprobe:
kernel/trace/trace_sched_switch.c:81:	unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-82-	return ret;
--
kernel/trace/trace_sched_switch.c=85=static void tracing_sched_unregister(void)
kernel/trace/trace_sched_switch.c-86-{
kernel/trace/trace_sched_switch.c:87:	unregister_trace_sched_switch(probe_sched_switch, NULL);
kernel/trace/trace_sched_switch.c:88:	unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c:89:	unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-90-}
--
kernel/trace/trace_sched_wakeup.c=612=static void start_wakeup_tracer(struct trace_array *tr)
--
kernel/trace/trace_sched_wakeup.c-615-
kernel/trace/trace_sched_wakeup.c:616:	ret = register_trace_sched_wakeup(probe_wakeup, NULL);
kernel/trace/trace_sched_wakeup.c-617-	if (ret) {
--
kernel/trace/trace_sched_wakeup.c-622-
kernel/trace/trace_sched_wakeup.c:623:	ret = register_trace_sched_wakeup_new(probe_wakeup, NULL);
kernel/trace/trace_sched_wakeup.c-624-	if (ret) {
--
kernel/trace/trace_sched_wakeup.c-629-
kernel/trace/trace_sched_wakeup.c:630:	ret = register_trace_sched_switch(probe_wakeup_sched_switch, NULL);
kernel/trace/trace_sched_wakeup.c-631-	if (ret) {
--
kernel/trace/trace_sched_wakeup.c-636-
kernel/trace/trace_sched_wakeup.c:637:	ret = register_trace_sched_migrate_task(probe_wakeup_migrate_task, NULL);
kernel/trace/trace_sched_wakeup.c-638-	if (ret) {

]

40/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 46054
							output: 36
							thoughts: 464
						

Thoughts:
**Analyzing Tracepoint Registration and Error Handling**

Okay, so I'm looking at this code, specifically `trace_output.c:1929`, and I see this `WARN_ONCE` about a failed event registration: `WARN_ONCE(!ret, "event %d failed to register", event->type)`. But then over in `blktrace.c`, it's just a `WARN_ON(ret)`. That's a bit odd. I know these `register_trace_*` functions return an integer, typically an error code, like `-ENOMEM` if it fails.

Right, so I checked `trace_sched_switch.c` as an example: it explicitly handles the error with a check:

```c
	ret = register_trace_sched_wakeup(probe_sched_wakeup, NULL);
	if (ret) {
		pr_info("wakeup trace: Couldn't activate tracepoint"
			" probe to kernel_sched_wakeup\n");
		return ret;
	}
```

It handles the error and returns. But `blk_register_tracepoints` just uses `WARN_ON`. Why is that? Ah, it was written back in 2008 and modified in 2009 to return `void`. So it's not designed to handle errors explicitly, which is what's causing the problem.

If I just change `blk_register_tracepoints` to ignore the error or use `pr_warn`, that'll fix the crash, but will that be the right thing to do? Wait, if it *fails* to register some tracepoints, `blktrace` will be only partially broken. Some events won't be traced! Is it better to return an error and fail `blk_trace_setup` altogether? That's a tough call.

If I return an error, I need to unregister the already registered tracepoints. I need to make sure I don't leave things in a broken state. Hmm, there are 19 tracepoints involved here. So, if I return an error, I can just call `blk_unregister_tracepoints()` and return the error. It would be a clean shutdown. But wait, `blk_unregister_tracepoints()` unregisters *all* of them. Is it safe to unregister a tracepoint that wasn't successfully registered? I need to check.

Yes, `unregister_trace_*` calls `tracepoint_probe_unregister`, and that returns `-ENODEV` if the probe wasn't found. Okay, so that's safe. It handles the scenario where a probe wasn't actually registered. I'm going to quickly check `tracepoint_probe_unregister` to be extra sure.



41/2 2026/08/31 21:23 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/tracepoint.c Name:tracepoint_probe_unregister]

Results:
map[SourceCode: 499:	/**
 500:	 * tracepoint_probe_unregister -  Disconnect a probe from a tracepoint
 501:	 * @tp: tracepoint
 502:	 * @probe: probe function pointer
 503:	 * @data: tracepoint data
 504:	 *
 505:	 * Returns 0 if ok, error value on error.
 506:	 */
 507:	int tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data)
 508:	{
 509:		struct tracepoint_func tp_func;
 510:		int ret;
 511:	
 512:		mutex_lock(&tracepoints_mutex);
 513:		tp_func.func = probe;
 514:		tp_func.data = data;
 515:		ret = tracepoint_remove_func(tp, &tp_func);
 516:		mutex_unlock(&tracepoints_mutex);
 517:		return ret;
 518:	}
 SourceFile:kernel/tracepoint.c]

42/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 47456
							output: 38
							thoughts: 285
						

Thoughts:
**My Reasoning on the Tracepoint Registration**

Okay, so the preliminary assessment is that this is safe; we *can* change `blk_register_tracepoints` to return an integer. Here's the original code:

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		goto err;
...
err:
	blk_unregister_tracepoints();
	return ret;
}
```

Now, I need to consider the implications. `blk_register_tracepoints` is called by `get_probe_ref`, which is interesting:

```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

Ah, that's crucial. If `get_probe_ref` starts returning an error code from `blk_register_tracepoints`, I *must* handle that error condition. That means checking `blk_trace_setup_queue` and `blk_trace_setup_finalize` to see how they currently handle (or don't handle) the return value from `get_probe_ref`. Time to investigate those functions.



43/2 2026/08/31 21:23 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1915 LineCount:15]

Results:
map[Contents:1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
]

44/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 48333
							output: 38
							thoughts: 153
						

Thoughts:
**My Immediate Concerns Regarding the `get_probe_ref` Change**

Okay, so we're changing `get_probe_ref` to potentially return an error. Let's think through this new flow: I'm seeing that we now have:

```c
	ret = get_probe_ref();
	if (ret) {
		rcu_assign_pointer(q->blk_trace, NULL);
		goto free_bt;
	}
	return 0;
```

Right away, alarm bells are going off. We're assigning `NULL` to `q->blk_trace` *after* a potential failure. The critical point is the `rcu_assign_pointer`. I know that `rcu_assign_pointer(q->blk_trace, bt)` *makes* that pointer visible to readers. If `get_probe_ref` fails *after* this assignment, and we immediately set it to `NULL`, we have a potential data race here. We need to consider how RCU (Read-Copy-Update) synchronization plays into this. If we immediately assign NULL after making the blk_trace visible, we likely need to ensure any RCU readers have completed their access of `bt` before freeing it.

I'm thinking, `blk_trace_free` which, I *believe*, contains the `kfree(bt)` call. This needs to be carefully scrutinized. The important question is, does `blk_trace_free` use `kfree_rcu` or `synchronize_rcu` to protect the freeing of the blk_trace? If not, we have a significant RCU hazard. We need to be absolutely certain of the memory management strategy within `blk_trace_free` to avoid any dangling pointers or data corruption. This warrants a very deep dive into that function, *right now*.



45/2 2026/08/31 21:23 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/trace/blktrace.c Name:blk_trace_free]

Results:
map[SourceCode: 469:	static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 470:	{
 471:		relay_close(bt->rchan);
 472:	
 473:		/*
 474:		 * If 'bt->dir' is not set, then both 'dropped' and 'msg' are created
 475:		 * under 'q->debugfs_dir', thus lookup and remove them.
 476:		 */
 477:		if (!bt->dir) {
 478:			debugfs_lookup_and_remove("dropped", q->debugfs_dir);
 479:			debugfs_lookup_and_remove("msg", q->debugfs_dir);
 480:		} else {
 481:			debugfs_remove(bt->dir);
 482:		}
 483:		free_percpu(bt->sequence);
 484:		free_percpu(bt->msg_data);
 485:		kfree(bt);
 486:	}
 SourceFile:kernel/trace/blktrace.c]

46/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49236
							output: 38
							thoughts: 513
						

Thoughts:
**Analyzing the `blk_trace` Cleanup and RCU Interactions**

Okay, so I'm looking at this `kfree(bt)` call, and immediately the RCU interactions are flashing red in my mind. If `rcu_assign_pointer(q->blk_trace, bt)` is used, and then we have an error and end up calling `rcu_assign_pointer(q->blk_trace, NULL)`, we *must* wait for an RCU grace period before freeing `bt`. Otherwise, we could have a use-after-free issue.

Currently, I see `blk_trace_free` doesn't do that waiting. Hmmm... But then I remember `blk_trace_remove` *does* perform this properly. It uses `rcu_replace_pointer`, and if the replacement is successful, it calls `blk_trace_cleanup`. Let's refresh our memories on that:

```c
int blk_trace_remove(struct request_queue *q)
{
	struct blk_trace *bt;

	bt = rcu_replace_pointer(q->blk_trace, NULL,
				 lockdep_is_held(&q->debugfs_mutex));
	if (!bt)
		return -EINVAL;

	if (bt->trace_state != Blktrace_running)
		blk_trace_cleanup(bt);

	return 0;
}
```

And `blk_trace_cleanup` does:

```c
static void blk_trace_cleanup(struct blk_trace *bt)
{
	synchronize_rcu();
	blk_trace_free(bt->q, bt);
	put_probe_ref();
}
```

Okay, so `blk_trace_cleanup` calls `synchronize_rcu()`, ensuring the grace period. So, if we fail in `blk_trace_setup_queue` *after* we've done the `rcu_assign_pointer`, we should, in theory, call `blk_trace_cleanup(bt)` instead of a bare `blk_trace_free(q, bt)`. Got it.

But... wait.  `blk_trace_cleanup` also calls `put_probe_ref()`, which decrements `blk_probes_ref`. If `get_probe_ref` failed, we didn't increment it, right? So we don't want to decrement in the cleanup. Ok, this is important. So we *could* do something like this:

```c
	ret = get_probe_ref();
	if (ret) {
		rcu_assign_pointer(q->blk_trace, NULL);
		synchronize_rcu();
		blk_trace_free(q, bt);
		return ret;
	}
```

But, wait... why not simply call `get_probe_ref()` *before* we even assign the pointer with RCU? That seems like the cleanest and safest solution. We can then avoid all this conditional logic and keep things simpler. Let's revisit `blk_trace_setup_queue` and see what the original logic was to check for a ref.



47/2 2026/08/31 21:23 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1900 LineCount:30]

Results:
map[Contents:1900:	static int blk_trace_setup_queue(struct request_queue *q,
1901:					 struct block_device *bdev)
1902:	{
1903:		struct blk_trace *bt = NULL;
1904:		int ret = -ENOMEM;
1905:	
1906:		bt = kzalloc_obj(*bt);
1907:		if (!bt)
1908:			return -ENOMEM;
1909:	
1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
]

48/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 50898
							output: 37
							thoughts: 98
						

Thoughts:
**My Analysis of RCU and Probe References**

Okay, so I'm looking at this snippet of code and thinking about how to handle the reference counting with respect to RCU synchronization. It's pretty straightforward, actually. If `get_probe_ref()` fails *before* we even get to `rcu_assign_pointer()`, then we don't have to concern ourselves with RCU synchronization headaches. The `goto free_bt` takes care of the cleanup in that failure scenario, which is as expected. That simplifies things significantly; it means the failure case doesn't have any RCU-related considerations. No need to worry about races if we haven't successfully obtained the probe reference.

But, I need to zoom out a bit. Now I need to think about `blk_trace_setup_finalize`. This is where the real trickery will be. How does that interact with the newly updated `blk_trace` pointer? What are the synchronization requirements during finalization? Are we making sure the grace period is complete before touching `blk_trace`? I need to analyze its implementation to ensure the memory model is respected. I hope it has been considered carefully. I need to make sure I am not missing any critical edge cases.



49/2 2026/08/31 21:23 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:740 LineCount:25]

Results:
map[Contents: 740:		 * to underscores for this to work as expected
 741:		 */
 742:		strreplace(buts->name, '/', '_');
 743:	
 744:		bt->version = version;
 745:		bt->act_mask = buts->act_mask;
 746:		if (!bt->act_mask)
 747:			bt->act_mask = (u16) -1;
 748:	
 749:		/* overwrite with user settings */
 750:		if (buts->start_lba)
 751:			bt->start_lba = buts->start_lba;
 752:		if (buts->end_lba)
 753:			bt->end_lba = buts->end_lba;
 754:	
 755:		bt->pid = buts->pid;
 756:		bt->trace_state = Blktrace_setup;
 757:	
 758:		rcu_assign_pointer(q->blk_trace, bt);
 759:		get_probe_ref();
 760:	}
 761:	
 762:	int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 763:			    struct block_device *bdev,
 764:			    char __user *arg)
]

50/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51679
							output: 37
							thoughts: 21
						

Thoughts:
Okay, here's my interpretation of that thought process, as if it were my own:

**Analyzing the Block Trace Setup Flow**

Right, so I see `blk_trace_setup_finalize` being called directly from `do_blk_trace_setup`. That's a key point. This means the finalization steps for the block trace setup are *tightly coupled* to the initial setup process. There isn't any kind of intervening function or stage. We're talking about a very direct handoff. I immediately start thinking about potential implications here:

*   **Order of Operations:** The call order is crucial. Finalization *follows* setup directly. Any dependency on setup completion will be guaranteed, which is good. But it also means any error during finalization could be more complex to trace back to the original setup problems.
*   **Resource Management:** What resources are being set up and then finalized? Understanding this relationship is critical. Are we talking about allocating and freeing memory? Initializing and de-initializing data structures? Any potential resource leaks or race conditions will be highly localized within these two functions.
*   **Error Handling:** The direct call suggests a simple error handling strategy. Is there error checking *within* `do_blk_trace_setup` that might directly feed into the finalization process? Or, is error handling more distributed, and this call is assumed to be safe? The latter would be unusual but potentially valid, depending on the system's architecture.
*   **Context:** What context is being passed between these functions? Are they sharing data, or is finalization solely operating on what the setup established? This will determine how modifications in one function affect the other.
*   **Potential Bottlenecks:** This relationship looks efficient, but that is dependent on the workload. Is it possible for these functions to become a bottleneck? Could parallelization or asynchronous operations be used for greater efficiency?

I'll need to dig deeper into the actual code within those functions to understand the specifics, but this direct call is definitely a focal point for understanding the system's behavior. It likely has major implications for tracing's performance and stability.



51/2 2026/08/31 21:23 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:690 LineCount:50]

Results:
map[Contents: 690:		 * directory that will be removed once the trace ends.
 691:		 */
 692:		if (bdev && !bdev_is_partition(bdev))
 693:			dir = q->debugfs_dir;
 694:		else
 695:			bt->dir = dir = debugfs_create_dir(name, blk_debugfs_root);
 696:	
 697:		/*
 698:		 * As blktrace relies on debugfs for its interface the debugfs directory
 699:		 * is required, contrary to the usual mantra of not checking for debugfs
 700:		 * files or directories.
 701:		 */
 702:		if (IS_ERR_OR_NULL(dir)) {
 703:			pr_warn("debugfs_dir not present for %s so skipping\n", name);
 704:			ret = -ENOENT;
 705:			goto err;
 706:		}
 707:	
 708:		bt->dev = dev;
 709:		INIT_LIST_HEAD(&bt->running_list);
 710:	
 711:		ret = -EIO;
 712:		debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 713:		debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 714:	
 715:		bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
 716:				       &blk_relay_callbacks, bt);
 717:		if (!bt->rchan)
 718:			goto err;
 719:	
 720:		blk_trace_setup_lba(bt, bdev);
 721:	
 722:		return bt;
 723:	
 724:	err:
 725:		blk_trace_free(q, bt);
 726:	
 727:		return ERR_PTR(ret);
 728:	}
 729:	
 730:	static void blk_trace_setup_finalize(struct request_queue *q,
 731:					     char *name, int version,
 732:					     struct blk_trace *bt,
 733:					     struct blk_user_trace_setup2 *buts)
 734:	
 735:	{
 736:		strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 737:	
 738:		/*
 739:		 * some device names have larger paths - convert the slashes
]

52/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52934
							output: 37
							thoughts: 19
						

Thoughts:
Here's a summary of my understanding, framed as my own thoughts:

**Dissecting the `blk_trace` Setup Sequence**

Okay, so I'm looking at how the tracing system for block devices, specifically `blk_trace`, is initialized.  It seems the primary setup function is `blk_trace_setup`. That's where it all begins. And from what I'm reading, within that setup routine, there's a call to `blk_trace_setup_finalize`. So, `blk_trace_setup` sets the stage and `blk_trace_setup_finalize` is used to complete the setup process. It's a two-stage approach. Presumably, `blk_trace_setup` handles the initial allocation and configuration, while `blk_trace_setup_finalize` likely takes care of any necessary finalization steps or linking up of resources, once the basic structure is ready. Let me dig deeper into those two calls, to discover what specific initialization procedures are handled by each of those functions.



53/2 2026/08/31 21:23 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:762 LineCount:40]

Results:
map[Contents: 762:	int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 763:			    struct block_device *bdev,
 764:			    char __user *arg)
 765:	{
 766:		struct blk_user_trace_setup2 buts2;
 767:		struct blk_user_trace_setup buts;
 768:		struct blk_trace *bt;
 769:		unsigned int memflags;
 770:		int ret;
 771:	
 772:		ret = copy_from_user(&buts, arg, sizeof(buts));
 773:		if (ret)
 774:			return -EFAULT;
 775:	
 776:		if (!buts.buf_size || !buts.buf_nr)
 777:			return -EINVAL;
 778:	
 779:		buts2 = (struct blk_user_trace_setup2) {
 780:			.act_mask = buts.act_mask,
 781:			.buf_size = buts.buf_size,
 782:			.buf_nr = buts.buf_nr,
 783:			.start_lba = buts.start_lba,
 784:			.end_lba = buts.end_lba,
 785:			.pid = buts.pid,
 786:		};
 787:	
 788:		memflags = blk_debugfs_lock(q);
 789:		bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 790:					     bdev);
 791:		if (IS_ERR(bt)) {
 792:			blk_debugfs_unlock(q, memflags);
 793:			return PTR_ERR(bt);
 794:		}
 795:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 796:		strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 797:		blk_debugfs_unlock(q, memflags);
 798:	
 799:		if (copy_to_user(arg, &buts, sizeof(buts))) {
 800:			blk_trace_remove(q);
 801:			return -EFAULT;
]

54/2 2026/08/31 21:23 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53879
							output: 37
							thoughts: 550
						

Thoughts:
**Refining the Error Handling in Block Trace Setup**

Okay, so I'm looking at this `blk_trace_setup_finalize` function and thinking about how we handle errors, particularly if `get_probe_ref` fails. Currently, if that function call fails, we just continue on, which seems... less than ideal. My initial thought was, "Hey, why don't we just make `blk_trace_setup_finalize` return an error code? Then `blk_trace_setup` would catch that, call `blk_trace_free(q, bt)`, and return the error. Simple enough, right?"

But then I re-read the code and saw the `rcu_assign_pointer(q->blk_trace, bt)` call. Ah, that's the bit that's causing the problem.  We have to assign the `blk_trace` pointer to the request queue *before* the error check, if we want to follow the code as it is.

The solution is to move `get_probe_ref()` call *before* `rcu_assign_pointer(q->blk_trace, bt)`. It's a clean and elegant fix that addresses the core issue. By changing the order, if `get_probe_ref` returns an error, we simply return that error. `blk_trace_setup` can then take care of freeing the trace data. That way, we aren't introducing a race condition.

And since `blk_trace_setup2` also uses this function, this change will simplify error handling in that context as well. Done.



55/2 2026/08/31 21:24 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:802 LineCount:40]

Results:
map[Contents: 802:		}
 803:		return 0;
 804:	}
 805:	EXPORT_SYMBOL_GPL(blk_trace_setup);
 806:	
 807:	static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 808:				    struct block_device *bdev, char __user *arg)
 809:	{
 810:		struct blk_user_trace_setup2 buts2;
 811:		struct blk_trace *bt;
 812:		unsigned int memflags;
 813:	
 814:		if (copy_from_user(&buts2, arg, sizeof(buts2)))
 815:			return -EFAULT;
 816:	
 817:		if (!buts2.buf_size || !buts2.buf_nr)
 818:			return -EINVAL;
 819:	
 820:		if (buts2.flags != 0)
 821:			return -EINVAL;
 822:	
 823:		memflags = blk_debugfs_lock(q);
 824:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 825:					     bdev);
 826:		if (IS_ERR(bt)) {
 827:			blk_debugfs_unlock(q, memflags);
 828:			return PTR_ERR(bt);
 829:		}
 830:		blk_trace_setup_finalize(q, name, 2, bt, &buts2);
 831:		blk_debugfs_unlock(q, memflags);
 832:	
 833:		if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 834:			blk_trace_remove(q);
 835:			return -EFAULT;
 836:		}
 837:		return 0;
 838:	}
 839:	
 840:	#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 841:	static int compat_blk_trace_setup(struct request_queue *q, char *name,
]

56/2 2026/08/31 21:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55447
							output: 37
							thoughts: 50
						

Thoughts:
Okay, here's my interpretation of those thoughts, presented as my own mental process:

**Handling Errors in Trace Setup**

Alright, so I've been reviewing the changes, and I'm realizing something. I had initially thought only `blk_trace_setup2` needed to deal with the potential errors. But, then I took another look and thought, "Oh, right, the `compat_blk_trace_setup` function also needs to incorporate the necessary error handling." 

Wait a minute, `compat_blk_trace_setup` calls `blk_trace_setup_finalize`, doesn't it? Okay, I'll need to double check the error handling there too.



57/2 2026/08/31 21:24 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:842 LineCount:40]

Results:
map[Contents: 842:					  dev_t dev, struct block_device *bdev,
 843:					  char __user *arg)
 844:	{
 845:		struct blk_user_trace_setup2 buts2;
 846:		struct compat_blk_user_trace_setup cbuts;
 847:		struct blk_trace *bt;
 848:		unsigned int memflags;
 849:	
 850:		if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 851:			return -EFAULT;
 852:	
 853:		if (!cbuts.buf_size || !cbuts.buf_nr)
 854:			return -EINVAL;
 855:	
 856:		buts2 = (struct blk_user_trace_setup2) {
 857:			.act_mask = cbuts.act_mask,
 858:			.buf_size = cbuts.buf_size,
 859:			.buf_nr = cbuts.buf_nr,
 860:			.start_lba = cbuts.start_lba,
 861:			.end_lba = cbuts.end_lba,
 862:			.pid = cbuts.pid,
 863:		};
 864:	
 865:		memflags = blk_debugfs_lock(q);
 866:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 867:					     bdev);
 868:		if (IS_ERR(bt)) {
 869:			blk_debugfs_unlock(q, memflags);
 870:			return PTR_ERR(bt);
 871:		}
 872:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 873:		blk_debugfs_unlock(q, memflags);
 874:	
 875:		if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 876:			blk_trace_remove(q);
 877:			return -EFAULT;
 878:		}
 879:	
 880:		return 0;
 881:	}
]

58/2 2026/08/31 21:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 56339
							output: 38
							thoughts: 186
						

Thoughts:
**Refining Error Handling in Block Tracing Setup**

Okay, so looking at this code, it's clear that the current error handling strategy in these block tracing setup functions isn't ideal. I need to make some changes to ensure errors are propagated correctly. It seems that `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup` all need to properly handle any errors that might originate from `blk_trace_setup_finalize`. Similarly, `blk_trace_setup_queue` has a potential failure point in `get_probe_ref` that requires explicit error handling.

Alright, let's break down the necessary modifications:

1.  First, `blk_register_tracepoints` absolutely needs to return an integer to signal success or failure.
2.  Also, `get_probe_ref` should also return an integer, so that failures are detectable.
3.  Next, `blk_trace_setup_finalize` needs to return an integer so that failures can be communicated, which is critical.
4.  Then, within `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`, I'll implement error handling for the return value of `blk_trace_setup_finalize`.
5.  And finally, in `blk_trace_setup_queue`, I'll need to handle any error returns from `get_probe_ref`.

Just to be absolutely sure, I'll take another look at the `blk_register_tracepoints` function to make sure that will work.



59/2 2026/08/31 21:24 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1327 LineCount:50]

Results:
map[Contents:1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
]

60/2 2026/08/31 21:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 57922
							output: 36
							thoughts: 1391
						

Thoughts:
**Tracepoint Registration: A Deliberation**

Okay, so I'm looking at how to handle tracepoint registration failures in `blk_register_tracepoints`. The current implementation uses `WARN_ON`, but I'm thinking about making the function return an `int` to propagate the error. This would let me handle potential `ENOMEM` issues during registration.

Initially, I considered a straightforward approach: chaining a bunch of `if (ret) goto err;` statements, given there are 19 tracepoints. It's a bit verbose, but it's a standard pattern. Alternatively, I could just use `pr_warn` instead of `WARN_ON` and return 0. But hold on, if I do that, I don't need to change `get_probe_ref` and `blk_trace_setup_finalize`. This would be simpler...

But is it really acceptable to just ignore the error? If a tracepoint fails to register, it means that `blktrace` will miss events for that specific point, while the rest of the tracepoints might still work. Is it better to allow partial functionality or fail the whole `blktrace` setup? A full failure with `-ENOMEM` makes it clear to the user that something is broken. If I just print a warning, the user might not notice and wonder why they're missing events. Returning an error seems like the proper way to go.

To validate my approach, let's peek at how similar functions handle error conditions in other parts of the kernel. Looking at `trace_sched_switch.c` and `trace_osnoise.c` I see that they explicitly return errors, printing info messages. This reinforces the idea that returning an error is the standard method.

So, let's implement the change, I'll write out the function with the `if (ret) goto err;` pattern to maintain consistency and clarity:

```c
static int blk_register_tracepoints(void)
{
    int ret;

    ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
    if (ret)
        goto err;
    ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
    if (ret)
        goto err;
    // ... rest of the 19 tracepoints ...
    return 0;
err:
    blk_unregister_tracepoints();
    return ret;
}
```

Okay, now for the unregistration. The `blk_unregister_tracepoints()` function unregisters all of them. Is it safe to call it if a tracepoint wasn't registered in the first place? Yes, looking at `tracepoint_probe_unregister`, it returns `-ENODEV` if the probe isn't found, and it won't crash or leak memory. That's good to know. It also calls `tracepoint_remove_func` internally. I think I'm now certain this is the correct approach.



61/2 2026/08/31 21:24 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/tracepoint.c Name:tracepoint_remove_func]

Results:
map[SourceCode: 355:	/*
 356:	 * Remove a probe function from a tracepoint.
 357:	 * Note: only waiting an RCU period after setting elem->call to the empty
 358:	 * function insures that the original callback is not used anymore. This insured
 359:	 * by preempt_disable around the call site.
 360:	 */
 361:	static int tracepoint_remove_func(struct tracepoint *tp,
 362:			struct tracepoint_func *func)
 363:	{
 364:		struct tracepoint_func *old, *tp_funcs;
 365:	
 366:		tp_funcs = rcu_dereference_protected(tp->funcs,
 367:				lockdep_is_held(&tracepoints_mutex));
 368:		old = func_remove(&tp_funcs, func);
 369:		if (WARN_ON_ONCE(IS_ERR(old)))
 370:			return PTR_ERR(old);
 371:	
 372:		if (tp_funcs == old)
 373:			/* Failed allocating new tp_funcs, replaced func with stub */
 374:			return 0;
 375:	
 376:		switch (nr_func_state(tp_funcs)) {
 377:		case TP_FUNC_0:		/* 1->0 */
 378:			/* Removed last function */
 379:			if (tp->ext && tp->ext->unregfunc && static_key_enabled(&tp->key))
 380:				tp->ext->unregfunc();
 381:			static_branch_disable(&tp->key);
 382:			/* Set iterator static call */
 383:			tracepoint_update_call(tp, tp_funcs);
 384:			/* Both iterator and static call handle NULL tp->funcs */
 385:			rcu_assign_pointer(tp->funcs, NULL);
 386:			/*
 387:			 * Make sure new static func never uses old data after a
 388:			 * 1->0->1 transition sequence.
 389:			 */
 390:			tp_rcu_get_state(TP_TRANSITION_SYNC_1_0_1);
 391:			break;
 392:		case TP_FUNC_1:		/* 2->1 */
 393:			rcu_assign_pointer(tp->funcs, tp_funcs);
 394:			/*
 395:			 * Make sure static func never uses incorrect data after a
 396:			 * N->...->2->1 (N>2) transition sequence. If the first
 397:			 * element's data has changed, then force the synchronization
 398:			 * to prevent current readers that have loaded the old data
 399:			 * from calling the new function.
 400:			 */
 401:			if (tp_funcs[0].data != old[0].data)
 402:				tp_rcu_get_state(TP_TRANSITION_SYNC_N_2_1);
 403:			tp_rcu_cond_sync(TP_TRANSITION_SYNC_N_2_1);
 404:			/* Set static call to first function */
 405:			tracepoint_update_call(tp, tp_funcs);
 406:			break;
 407:		case TP_FUNC_2:		/* N->N-1 (N>2) */
 408:			fallthrough;
 409:		case TP_FUNC_N:
 410:			rcu_assign_pointer(tp->funcs, tp_funcs);
 411:			/*
 412:			 * Make sure static func never uses incorrect data after a
 413:			 * N->...->2->1 (N>2) transition sequence.
 414:			 */
 415:			if (tp_funcs[0].data != old[0].data)
 416:				tp_rcu_get_state(TP_TRANSITION_SYNC_N_2_1);
 417:			break;
 418:		default:
 419:			WARN_ON_ONCE(1);
 420:			break;
 421:		}
 422:		release_probes(tp, old);
 423:		return 0;
 424:	}
 SourceFile:kernel/tracepoint.c]

62/2 2026/08/31 21:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 61187
							output: 33
							thoughts: 23
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing the Error Handling in `func_remove`**

Okay, so I'm just reviewing the code, and a detail jumped out at me. The documentation clearly states that `func_remove` returns `ERR_PTR(-ENOENT)` if the specified function isn't found in the symbol table. This is important to understand because it's the expected error condition. I need to make sure the calling code correctly interprets this return value and doesn't treat it as some other, potentially more serious, error. That negative pointer value needs to be checked against `IS_ERR()` and `PTR_ERR()` to extract the proper error code (`-ENOENT`) if the search fails. I should confirm that this behavior is consistent across all calls to the function and any potential wrappers. Perhaps I should search for all usages of `func_remove` within this code base to ensure that this fundamental error condition is being handled correctly at every point it's called. This seems like a potential source of subtle, but hard-to-debug, issues if it's not handled consistently.



63/2 2026/08/31 21:24 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/tracepoint.c Name:func_remove]

Results:
map[SourceCode: 195:	static void *func_remove(struct tracepoint_func **funcs,
 196:			struct tracepoint_func *tp_func)
 197:	{
 198:		int nr_probes = 0, nr_del = 0, i;
 199:		struct tracepoint_func *old, *new;
 200:	
 201:		old = *funcs;
 202:	
 203:		if (!old)
 204:			return ERR_PTR(-ENOENT);
 205:	
 206:		debug_print_probes(*funcs);
 207:		/* (N -> M), (N > 1, M >= 0) probes */
 208:		if (tp_func->func) {
 209:			for (nr_probes = 0; old[nr_probes].func; nr_probes++) {
 210:				if ((old[nr_probes].func == tp_func->func &&
 211:				     old[nr_probes].data == tp_func->data) ||
 212:				    old[nr_probes].func == tp_stub_func)
 213:					nr_del++;
 214:			}
 215:		}
 216:	
 217:		/*
 218:		 * If probe is NULL, then nr_probes = nr_del = 0, and then the
 219:		 * entire entry will be removed.
 220:		 */
 221:		if (nr_probes - nr_del == 0) {
 222:			/* N -> 0, (N > 1) */
 223:			*funcs = NULL;
 224:			debug_print_probes(*funcs);
 225:			return old;
 226:		} else {
 227:			int j = 0;
 228:			/* N -> M, (N > 1, M > 0) */
 229:			/* + 1 for NULL */
 230:			new = allocate_probes(nr_probes - nr_del + 1);
 231:			if (new) {
 232:				for (i = 0; old[i].func; i++) {
 233:					if ((old[i].func != tp_func->func ||
 234:					     old[i].data != tp_func->data) &&
 235:					    old[i].func != tp_stub_func)
 236:						new[j++] = old[i];
 237:				}
 238:				new[nr_probes - nr_del].func = NULL;
 239:				*funcs = new;
 240:			} else {
 241:				/*
 242:				 * Failed to allocate, replace the old function
 243:				 * with calls to tp_stub_func.
 244:				 */
 245:				for (i = 0; old[i].func; i++) {
 246:					if (old[i].func == tp_func->func &&
 247:					    old[i].data == tp_func->data)
 248:						WRITE_ONCE(old[i].func, tp_stub_func);
 249:				}
 250:				*funcs = old;
 251:			}
 252:		}
 253:		debug_print_probes(*funcs);
 254:		return old;
 255:	}
 SourceFile:kernel/tracepoint.c]

64/2 2026/08/31 21:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 62456
							output: 36
							thoughts: 669
						

Thoughts:
**Analyzing Tracepoint Unregistration Behavior**

Okay, so I'm digging into how tracepoints are unregistered, and I've hit a potential issue. It looks like `func_remove` within the tracepoint framework can return `-ENOENT` if the function isn't found. This happens specifically when we try to unregister something that wasn't actually registered in the first place, or if the list of functions is NULL.

I see that `tracepoint_remove_func` uses `WARN_ON_ONCE(IS_ERR(old))`, which is problematic because it will generate a warning if `func_remove` returns an error. This is triggered by a call to `unregister_trace_*` functions, for example in `tracepoint_probe_unregister`. I'm concerned that this will be triggered by `blk_unregister_tracepoints()` if certain tracepoints failed to register, leading to these spurious warnings.

Let's break it down further. If registration fails (e.g., `register_trace_block_rq_insert`), we currently log a `WARN_ON`. However, we still *eventually* call `blk_unregister_tracepoints()`. If that registration failed, when `unregister_trace_block_rq_insert` is called, `func_remove` will return `-ENOENT`! If the function list isn't NULL, then it doesn't return an error.

I need to confirm if my understanding of `func_remove` is correct, and I'm seeing it has two conditions where it returns `-ENOENT`. Either the `*funcs` is NULL, or the probe isn't found in the list. It returns NULL when it is not found. If the probe is not found, `nr_del` will be 0, and if the list is not NULL, then the code will copy the data, realloc and return a value that's not an error.

But if `*funcs` is NULL, it *definitely* returns `-ENOENT`, and that will trigger the warning.

Looking more closely at how `tracepoint_probe_unregister` is called by the `unregister_trace_*` functions, it doesn't seem to have any checks for whether a probe was *actually* registered before calling `tracepoint_probe_unregister`. So, if we call an unregister function on a tracepoint without probes, we're guaranteed to hit that warning. This needs to be checked.



65/2 2026/08/31 21:24 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/tracepoint.c Name:tracepoint_probe_unregister]

Results:
map[SourceCode: 499:	/**
 500:	 * tracepoint_probe_unregister -  Disconnect a probe from a tracepoint
 501:	 * @tp: tracepoint
 502:	 * @probe: probe function pointer
 503:	 * @data: tracepoint data
 504:	 *
 505:	 * Returns 0 if ok, error value on error.
 506:	 */
 507:	int tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data)
 508:	{
 509:		struct tracepoint_func tp_func;
 510:		int ret;
 511:	
 512:		mutex_lock(&tracepoints_mutex);
 513:		tp_func.func = probe;
 514:		tp_func.data = data;
 515:		ret = tracepoint_remove_func(tp, &tp_func);
 516:		mutex_unlock(&tracepoints_mutex);
 517:		return ret;
 518:	}
 SourceFile:kernel/tracepoint.c]

66/2 2026/08/31 21:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63990
							output: 36
							thoughts: 60
						

Thoughts:
Here's my summary, as if I were thinking these things myself:

**Tracing a Tracing Bug**

Hold on a second, something just clicked. If `tracepoint_remove_func` is set up to issue a `WARN_ON_ONCE` specifically when it encounters an error – and specifically when that error is indicated by `IS_ERR(old)` – then calling `unregister_trace_*` on something that *wasn't* even registered in the first place has got to be a bug! That's precisely the situation that should trigger the warning. That would be an obvious sign of an improper use of the tracing API!

Alright, time to go back and meticulously re-examine the implementation of `tracepoint_remove_func`. I need to understand this better.



67/2 2026/08/31 21:25 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/tracepoint.c Name:tracepoint_remove_func]

Results:
map[SourceCode: 355:	/*
 356:	 * Remove a probe function from a tracepoint.
 357:	 * Note: only waiting an RCU period after setting elem->call to the empty
 358:	 * function insures that the original callback is not used anymore. This insured
 359:	 * by preempt_disable around the call site.
 360:	 */
 361:	static int tracepoint_remove_func(struct tracepoint *tp,
 362:			struct tracepoint_func *func)
 363:	{
 364:		struct tracepoint_func *old, *tp_funcs;
 365:	
 366:		tp_funcs = rcu_dereference_protected(tp->funcs,
 367:				lockdep_is_held(&tracepoints_mutex));
 368:		old = func_remove(&tp_funcs, func);
 369:		if (WARN_ON_ONCE(IS_ERR(old)))
 370:			return PTR_ERR(old);
 371:	
 372:		if (tp_funcs == old)
 373:			/* Failed allocating new tp_funcs, replaced func with stub */
 374:			return 0;
 375:	
 376:		switch (nr_func_state(tp_funcs)) {
 377:		case TP_FUNC_0:		/* 1->0 */
 378:			/* Removed last function */
 379:			if (tp->ext && tp->ext->unregfunc && static_key_enabled(&tp->key))
 380:				tp->ext->unregfunc();
 381:			static_branch_disable(&tp->key);
 382:			/* Set iterator static call */
 383:			tracepoint_update_call(tp, tp_funcs);
 384:			/* Both iterator and static call handle NULL tp->funcs */
 385:			rcu_assign_pointer(tp->funcs, NULL);
 386:			/*
 387:			 * Make sure new static func never uses old data after a
 388:			 * 1->0->1 transition sequence.
 389:			 */
 390:			tp_rcu_get_state(TP_TRANSITION_SYNC_1_0_1);
 391:			break;
 392:		case TP_FUNC_1:		/* 2->1 */
 393:			rcu_assign_pointer(tp->funcs, tp_funcs);
 394:			/*
 395:			 * Make sure static func never uses incorrect data after a
 396:			 * N->...->2->1 (N>2) transition sequence. If the first
 397:			 * element's data has changed, then force the synchronization
 398:			 * to prevent current readers that have loaded the old data
 399:			 * from calling the new function.
 400:			 */
 401:			if (tp_funcs[0].data != old[0].data)
 402:				tp_rcu_get_state(TP_TRANSITION_SYNC_N_2_1);
 403:			tp_rcu_cond_sync(TP_TRANSITION_SYNC_N_2_1);
 404:			/* Set static call to first function */
 405:			tracepoint_update_call(tp, tp_funcs);
 406:			break;
 407:		case TP_FUNC_2:		/* N->N-1 (N>2) */
 408:			fallthrough;
 409:		case TP_FUNC_N:
 410:			rcu_assign_pointer(tp->funcs, tp_funcs);
 411:			/*
 412:			 * Make sure static func never uses incorrect data after a
 413:			 * N->...->2->1 (N>2) transition sequence.
 414:			 */
 415:			if (tp_funcs[0].data != old[0].data)
 416:				tp_rcu_get_state(TP_TRANSITION_SYNC_N_2_1);
 417:			break;
 418:		default:
 419:			WARN_ON_ONCE(1);
 420:			break;
 421:		}
 422:		release_probes(tp, old);
 423:		return 0;
 424:	}
 SourceFile:kernel/tracepoint.c]

68/2 2026/08/31 21:25 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 65431
							output: 44
							thoughts: 1612
						

Thoughts:
**Analyzing Tracepoint Registration and Unregistration**

Okay, so I'm looking at this `WARN_ON_ONCE` that pops up when unregistering tracepoints, specifically when `blk_unregister_tracepoints` is called. It seems like the issue stems from a failure during the registration process. If `blk_unregister_tracepoints` is called, and some tracepoints were *never* registered (due to a failure), then it triggers the `WARN_ON_ONCE`.

Currently, `blk_register_tracepoints` registers and *immediately* `WARN_ON` the return value of `register_trace_*`, but *continues* regardless. That's a problem because if the registration fails, the tracepoint's function pointers (`tp->funcs`) might be NULL. Then, during unregistration via `unregister_trace_*`, it will try to call `tracepoint_remove_func`. `tracepoint_remove_func` calls `func_remove`, and that will return `-ENOENT` and trigger the `WARN_ON_ONCE`. The current code issues a `WARN_ON` on failure to register, but it will *later* issue a `WARN_ON_ONCE` on unregister.

If the goal is proper fix, I could either keep track of which tracepoints *succeeded* or simply use `pr_warn` and ignore the error. But that doesn't solve the fact that `WARN_ON_ONCE` will still fire during unregistration! It's clear that we must *not* call `unregister_trace_*` if `register_trace_*` failed!

The problem is, `blk_unregister_tracepoints` unconditionally unregisters *everything*. If I were to change `blk_register_tracepoints` to return an error, then I'd need to know which ones registered successfully, and that gets tedious really fast.

I'm thinking about how I could make this efficient. Could I check if a tracepoint is registered *before* unregistering? Unfortunately, `unregister_trace_*` doesn't provide a way to check. Putting the tracepoints in an array seems difficult because they're different types, though `register_trace_*` is a macro that calls `tracepoint_probe_register`.

Let's look at `kernel/trace/trace_osnoise.c` for inspiration. Ah, they use labels to handle multiple tracepoints, and they do it with labels. But nineteen labels is… a lot.

Perhaps I could just use `pr_warn` and not unregister if it fails? But if I don't unregister, I'll need to remember which ones failed. Since `blk_register_tracepoints` is called globally (protected by `blk_probes_ref`), a global boolean array or bitmask is an option.

But… registration failures are often due to `-ENOMEM`. Returning the error and failing the setup, then using labels, seems like a reasonable approach. I'll need to explore similar registration patterns in the kernel. Let's see if there are other places with lots of tracepoints.

In `kernel/trace/trace_events.c`, `register_pid_events` doesn't *check* the return value. And `unregister_pid_events` unregisters them *unconditionally*. If a `register_trace_prio_sched_switch` call fails, the corresponding `unregister_trace_sched_switch` will trigger the dreaded `WARN_ON_ONCE`!

Let's double-check the `tracepoint_probe_unregister` code. If the probe isn't found, it returns `-ENOENT`. Then, `tracepoint_remove_func` triggers `WARN_ON_ONCE(IS_ERR(old))` if `func_remove` returns an error, specifically `-ENOENT`. So, yes, it *will* trigger `WARN_ON_ONCE` if `tp_funcs` is NULL.

So, why doesn't `unregister_pid_events` trigger it in practice? Because `register_trace_*` rarely fails, usually only on `-ENOMEM`. But with fault injection, it *does* fail. And that's exactly what syzbot found with `blk_register_tracepoints`! Wait. syzbot found the `WARN_ON(ret)` in `blk_register_tracepoints`, not the `WARN_ON_ONCE` in `tracepoint_remove_func`. Right, because there's an explicit `WARN_ON(ret)`.

Now, if I remove the `WARN_ON(ret)` in `blk_register_tracepoints`, syzbot might just hit the `WARN_ON_ONCE` in `tracepoint_remove_func` *later* when `


69/2 2026/08/31 21:25 tool git-log
0m Args:
map[CodeRegexp:WARN_ON_ONCE\(IS_ERR\(old\)\) PathPrefix:kernel/tracepoint.c]

Results:
map[Output:befe6d946551 tracepoint: Do not fail unregistering a probe due to memory failure
]

70/2 2026/08/31 21:25 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 68151
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as requested, in the first person and assuming the user is an expert:

**Analyzing That String: bef56d946551**

Alright, let's break this down. Seeing `befe6d946551` immediately triggers a mental checklist. Is this a hash? A UUID? An API key? What context have I seen this string in previously? The structure itself looks like a hexadecimal string, the length is somewhat suggestive. The 'be' at the start seems to be potentially significant. I'm mentally parsing it as I would any potential cryptographic hash or identifier.

Is it a truncated SHA-1? Possibly MD5? I need more context to be sure. I'm already comparing the form to known patterns for common security hashes. Length would be key; the 12 character string suggests a base-16 encoding. Need a key to test hash possibilities - if I get the hash family, then the input for this hash should be easily recoverable. My expertise tells me, even from just looking at it, I might quickly determine the algorithm or context. Time to pull up some of the usual tools and see if a quick check reveals anything. Is it a component of a larger system?

If it's not a hash, is it a key? An ID? Where was this string encountered, and what else was present? Is this string being used to look up a record in a database? Perhaps I will run it in a database query tool to see if the record can be located. Need to consider the possibilities.



71/2 2026/08/31 21:25 tool git-show
0m Args:
map[Commit:befe6d946551]

Results:
map[Output:commit befe6d946551d65cddbd32b9cb0170b0249fd5ed
Author: Steven Rostedt (VMware) <rostedt@goodmis.org>
Date:   Wed Nov 18 09:34:05 2020 -0500

    tracepoint: Do not fail unregistering a probe due to memory failure
    
    The list of tracepoint callbacks is managed by an array that is protected
    by RCU. To update this array, a new array is allocated, the updates are
    copied over to the new array, and then the list of functions for the
    tracepoint is switched over to the new array. After a completion of an RCU
    grace period, the old array is freed.
    
    This process happens for both adding a callback as well as removing one.
    But on removing a callback, if the new array fails to be allocated, the
    callback is not removed, and may be used after it is freed by the clients
    of the tracepoint.
    
    There's really no reason to fail if the allocation for a new array fails
    when removing a function. Instead, the function can simply be replaced by a
    stub function that could be cleaned up on the next modification of the
    array. That is, instead of calling the function registered to the
    tracepoint, it would call a stub function in its place.
    
    Link: https://lore.kernel.org/r/20201115055256.65625-1-mmullins@mmlx.us
    Link: https://lore.kernel.org/r/20201116175107.02db396d@gandalf.local.home
    Link: https://lore.kernel.org/r/20201117211836.54acaef2@oasis.local.home
    Link: https://lkml.kernel.org/r/20201118093405.7a6d2290@gandalf.local.home
    
    [ Note, this version does use undefined compiler behavior (assuming that
      a stub function with no parameters or return, can be called by a location
      that thinks it has parameters but still no return value. Static calls
      do the same thing, so this trick is not without precedent.
    
      There's another solution that uses RCU tricks and is more complex, but
      can be an alternative if this solution becomes an issue.
    
      Link: https://lore.kernel.org/lkml/20210127170721.58bce7cc@gandalf.local.home/
    ]
    
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: Martin KaFai Lau <kafai@fb.com>
    Cc: Song Liu <songliubraving@fb.com>
    Cc: Yonghong Song <yhs@fb.com>
    Cc: Andrii Nakryiko <andriin@fb.com>
    Cc: John Fastabend <john.fastabend@gmail.com>
    Cc: KP Singh <kpsingh@chromium.org>
    Cc: netdev <netdev@vger.kernel.org>
    Cc: bpf <bpf@vger.kernel.org>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Florian Weimer <fw@deneb.enyo.de>
    Fixes: 97e1c18e8d17b ("tracing: Kernel Tracepoints")
    Reported-by: syzbot+83aa762ef23b6f0d1991@syzkaller.appspotmail.com
    Reported-by: syzbot+d29e58bb557324e55e5e@syzkaller.appspotmail.com
    Reported-by: Matt Mullins <mmullins@mmlx.us>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Tested-by: Matt Mullins <mmullins@mmlx.us>

diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 7261fa0f5e3c..e8f20ae29c18 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -53,6 +53,12 @@ struct tp_probes {
 	struct tracepoint_func probes[];
 };
 
+/* Called in removal of a func but failed to allocate a new tp_funcs */
+static void tp_stub_func(void)
+{
+	return;
+}
+
 static inline void *allocate_probes(int count)
 {
 	struct tp_probes *p  = kmalloc(struct_size(p, probes, count),
@@ -131,6 +137,7 @@ func_add(struct tracepoint_func **funcs, struct tracepoint_func *tp_func,
 {
 	struct tracepoint_func *old, *new;
 	int nr_probes = 0;
+	int stub_funcs = 0;
 	int pos = -1;
 
 	if (WARN_ON(!tp_func->func))
@@ -147,14 +154,34 @@ func_add(struct tracepoint_func **funcs, struct tracepoint_func *tp_func,
 			if (old[nr_probes].func == tp_func->func &&
 			    old[nr_probes].data == tp_func->data)
 				return ERR_PTR(-EEXIST);
+			if (old[nr_probes].func == tp_stub_func)
+				stub_funcs++;
 		}
 	}
-	/* + 2 : one for new probe, one for NULL func */
-	new = allocate_probes(nr_probes + 2);
+	/* + 2 : one for new probe, one for NULL func - stub functions */
+	new = allocate_probes(nr_probes + 2 - stub_funcs);
 	if (new == NULL)
 		return ERR_PTR(-ENOMEM);
 	if (old) {
-		if (pos < 0) {
+		if (stub_funcs) {
+			/* Need to copy one at a time to remove stubs */
+			int probes = 0;
+
+			pos = -1;
+			for (nr_probes = 0; old[nr_probes].func; nr_probes++) {
+				if (old[nr_probes].func == tp_stub_func)
+					continue;
+				if (pos < 0 && old[nr_probes].prio < prio)
+					pos = probes++;
+				new[probes++] = old[nr_probes];
+			}
+			nr_probes = probes;
+			if (pos < 0)
+				pos = probes;
+			else
+				nr_probes--; /* Account for insertion */
+
+		} else if (pos < 0) {
 			pos = nr_probes;
 			memcpy(new, old, nr_probes * sizeof(struct tracepoint_func));
 		} else {
@@ -188,8 +215,9 @@ static void *func_remove(struct tracepoint_func **funcs,
 	/* (N -> M), (N > 1, M >= 0) probes */
 	if (tp_func->func) {
 		for (nr_probes = 0; old[nr_probes].func; nr_probes++) {
-			if (old[nr_probes].func == tp_func->func &&
-			     old[nr_probes].data == tp_func->data)
+			if ((old[nr_probes].func == tp_func->func &&
+			     old[nr_probes].data == tp_func->data) ||
+			    old[nr_probes].func == tp_stub_func)
 				nr_del++;
 		}
 	}
@@ -208,14 +236,32 @@ static void *func_remove(struct tracepoint_func **funcs,
 		/* N -> M, (N > 1, M > 0) */
 		/* + 1 for NULL */
 		new = allocate_probes(nr_probes - nr_del + 1);
-		if (new == NULL)
-			return ERR_PTR(-ENOMEM);
-		for (i = 0; old[i].func; i++)
-			if (old[i].func != tp_func->func
-					|| old[i].data != tp_func->data)
-				new[j++] = old[i];
-		new[nr_probes - nr_del].func = NULL;
-		*funcs = new;
+		if (new) {
+			for (i = 0; old[i].func; i++)
+				if ((old[i].func != tp_func->func
+				     || old[i].data != tp_func->data)
+				    && old[i].func != tp_stub_func)
+					new[j++] = old[i];
+			new[nr_probes - nr_del].func = NULL;
+			*funcs = new;
+		} else {
+			/*
+			 * Failed to allocate, replace the old function
+			 * with calls to tp_stub_func.
+			 */
+			for (i = 0; old[i].func; i++)
+				if (old[i].func == tp_func->func &&
+				    old[i].data == tp_func->data) {
+					old[i].func = tp_stub_func;
+					/* Set the prio to the next event. */
+					if (old[i + 1].func)
+						old[i].prio =
+							old[i + 1].prio;
+					else
+						old[i].prio = -1;
+				}
+			*funcs = old;
+		}
 	}
 	debug_print_probes(*funcs);
 	return old;
@@ -295,10 +341,12 @@ static int tracepoint_remove_func(struct tracepoint *tp,
 	tp_funcs = rcu_dereference_protected(tp->funcs,
 			lockdep_is_held(&tracepoints_mutex));
 	old = func_remove(&tp_funcs, func);
-	if (IS_ERR(old)) {
-		WARN_ON_ONCE(PTR_ERR(old) != -ENOMEM);
+	if (WARN_ON_ONCE(IS_ERR(old)))
 		return PTR_ERR(old);
-	}
+
+	if (tp_funcs == old)
+		/* Failed allocating new tp_funcs, replaced func with stub */
+		return 0;
 
 	if (!tp_funcs) {
 		/* Removed last function */
]

72/2 2026/08/31 21:25 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 71360
							output: 40
							thoughts: 3529
						

Thoughts:
**Analyzing Tracepoint Registration and Unregistration in the Block Layer**

Okay, so the initial issue boils down to how we handle errors when registering and unregistering tracepoints. Specifically, `func_remove` returns an error if `old` is NULL, which leads to a `WARN_ON_ONCE` in `tracepoint_remove_func` when attempting to unregister a tracepoint that wasn't registered in the first place. That's a textbook race condition, and it's something we need to fix.

The root cause is that if `register_trace_*` fails, `tp->funcs` could be NULL, and the subsequent `unregister_trace_*` calls trigger this `WARN_ON_ONCE`. Thus, we cannot unconditionally unregister the tracepoints if registration failed. It's a fundamental flaw in `blk_unregister_tracepoints` as it exists now.

The correct approach is either to have the `blk_register_tracepoints` function *return an error* on failure and, crucially, *only unregister the tracepoints that were successfully registered* or to check if each tracepoint is registered before unregistering. There is no API available to test the registration state.

I thought about other approaches, such as providing an error return from `unregister_trace_*` but that seems less useful in general.

Looking at other subsystems, such as `kernel/trace/trace_osnoise.c`, they use labels for this type of error handling. That is, if a registration fails, then the unregistration is skipped. Given that we have 19 tracepoints, we can just use 19 labels to handle this.

So I wrote out the labels for `blk_register_tracepoints` and the `goto` logic to unregister only registered ones. That's a little bit of boilerplate, but necessary for correct error handling.

The next step is to ensure `get_probe_ref` can return an `int`. This will allow the use of `blk_register_tracepoints` which also returns an integer.

The `blk_trace_setup_queue` function then calls `get_probe_ref`, which now has a return code, and thus we can handle the return code more gracefully.

The same refactoring needs to be added to `blk_trace_setup_finalize`, `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. `blk_trace_setup_prepare` calls `debugfs_create_dir` and `relay_open`.

Finally, after the changes, the error handling is now correct, and resources are released properly, regardless of whether tracepoint registration succeeds. That is, if `blk_trace_setup_finalize` fails, then `blk_trace_free(q, bt)` is called, which calls `relay_close` and `debugfs_remove` and frees `bt`, the correct actions that are performed by `blk_trace_setup_prepare` on its error path.



73/2 2026/08/31 21:25 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/trace/blktrace.c Name:blk_trace_setup_prepare]

Results:
map[SourceCode: 649:	/*
 650:	 * Setup everything required to start tracing
 651:	 */
 652:	static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 653:							 char *name, dev_t dev,
 654:							 u32 buf_size, u32 buf_nr,
 655:							 struct block_device *bdev)
 656:	{
 657:		struct blk_trace *bt = NULL;
 658:		struct dentry *dir = NULL;
 659:		int ret;
 660:	
 661:		lockdep_assert_held(&q->debugfs_mutex);
 662:	
 663:		/*
 664:		 * bdev can be NULL, as with scsi-generic, this is a helpful as
 665:		 * we can be.
 666:		 */
 667:		if (rcu_dereference_protected(q->blk_trace,
 668:					      lockdep_is_held(&q->debugfs_mutex))) {
 669:			pr_warn("Concurrent blktraces are not allowed on %s\n", name);
 670:			return ERR_PTR(-EBUSY);
 671:		}
 672:	
 673:		bt = kzalloc_obj(*bt);
 674:		if (!bt)
 675:			return ERR_PTR(-ENOMEM);
 676:	
 677:		ret = -ENOMEM;
 678:		bt->sequence = alloc_percpu(unsigned long);
 679:		if (!bt->sequence)
 680:			goto err;
 681:	
 682:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
 683:		if (!bt->msg_data)
 684:			goto err;
 685:	
 686:		/*
 687:		 * When tracing the whole disk reuse the existing debugfs directory
 688:		 * created by the block layer on init. For partitions block devices,
 689:		 * and scsi-generic block devices we create a temporary new debugfs
 690:		 * directory that will be removed once the trace ends.
 691:		 */
 692:		if (bdev && !bdev_is_partition(bdev))
 693:			dir = q->debugfs_dir;
 694:		else
 695:			bt->dir = dir = debugfs_create_dir(name, blk_debugfs_root);
 696:	
 697:		/*
 698:		 * As blktrace relies on debugfs for its interface the debugfs directory
 699:		 * is required, contrary to the usual mantra of not checking for debugfs
 700:		 * files or directories.
 701:		 */
 702:		if (IS_ERR_OR_NULL(dir)) {
 703:			pr_warn("debugfs_dir not present for %s so skipping\n", name);
 704:			ret = -ENOENT;
 705:			goto err;
 706:		}
 707:	
 708:		bt->dev = dev;
 709:		INIT_LIST_HEAD(&bt->running_list);
 710:	
 711:		ret = -EIO;
 712:		debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 713:		debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 714:	
 715:		bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
 716:				       &blk_relay_callbacks, bt);
 717:		if (!bt->rchan)
 718:			goto err;
 719:	
 720:		blk_trace_setup_lba(bt, bdev);
 721:	
 722:		return bt;
 723:	
 724:	err:
 725:		blk_trace_free(q, bt);
 726:	
 727:		return ERR_PTR(ret);
 728:	}
 SourceFile:kernel/trace/blktrace.c]

74/2 2026/08/31 21:25 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 76773
							output: 38
							thoughts: 1550
						

Thoughts:
**Analyzing and Fixing blktrace Error Handling**

Okay, so `blk_trace_free(q, bt)` is definitely the correct function to use for cleanup, that much is clear. Now, let's look at the error handling in `blk_register_tracepoints`.

There are 18 tracepoints, not 19, and `blk_register_tracepoints` seems like a key function here. I'm wondering if `register_trace_*` functions could fail with something *other* than `-ENOMEM`. Based on `tracepoint_probe_register`, it returns either `-ENOMEM` or `-EEXIST`. The `-EEXIST` is interesting; it means the probe is already registered. However, since `blk_register_tracepoints` is protected by `blk_probes_ref`, it should only be called once, so a duplicate registration seems unlikely. If it *does* occur, it would suggest a fundamental flaw in how these probes are being set up, but since `blk_add_trace_rq_insert`, et al., are all static functions within `blktrace.c`, there's no way someone else could've added them. It should only fail with `-ENOMEM`.

Right, let's review the root cause and proposed fix. The current implementation uses `WARN_ON(ret)` to check the return values of the `register_trace_block_*` functions. This is problematic because these functions *can* fail, especially due to memory allocation issues that fault injection can trigger. When they do fail, `WARN_ON` is triggered and that could lead to a kernel panic, especially if `panic_on_warn` is set. Even worse, if there's a failure during tracepoint registration, the function continues and leaves the system in a partially registered state, and then `blk_unregister_tracepoints` is later called to remove tracepoints. This unconditional unregistration of tracepoints that may not be registered triggers `WARN_ON_ONCE` inside `tracepoint_remove_func` because `func_remove` would return `-ENOENT`. The current error handling, therefore, has two flaws: it uses `WARN_ON` for a failure that could be transient and it lacks proper cleanup.

Here's the fix:
1.  Change `blk_register_tracepoints` to return an `int`. This provides the caller with the information about success or failure.
2.  In `blk_register_tracepoints`, we need to check the return value of *each* `register_trace_*` call. If any of them fail, we'll use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error. This ensures a clean rollback.
3.  Change `get_probe_ref` to return an `int` and propagate the error from `blk_register_tracepoints`. This way the error is handled at a higher level, and can be tracked as it goes up the call stack.
4.  Change `blk_trace_setup_finalize` to return an `int` and propagate the error from `get_probe_ref`.
5.  Update the callers of `blk_trace_setup_finalize` (`blk_trace_setup`, `blk_trace_setup2`, `compat_blk_trace_setup`) to handle the error by calling `blk_trace_free` and returning the error. We need to be able to safely cleanup and signal failure up the chain.
6.  Update `blk_trace_setup_queue` to handle the error from `get_probe_ref` by calling `blk_trace_free` and returning the error.

I've already confirmed that the `blk_trace_setup_queue` error path is handled correctly, with a check for `ret`, and calling `blk_trace_free` before returning.

Similarly, I've checked and confirmed that the error path in `blk_trace_setup_finalize` is handled correctly as well.

The error paths in `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup` are all consistent and handled appropriately.

Now, let's double-check the call hierarchy: `blk_register_tracepoints` is only called from `get_probe_ref`. Also, `get_probe_ref` is only called from `blk_trace_setup_queue` and `blk_trace_setup_finalize`. Then, `blk_trace_setup_finalize` is only called by `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. I have the call graph correct in my head now.

Finally, I got the count wrong the first time, there are 1


75/2 2026/08/31 21:26 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1327 LineCount:50]

Results:
map[Contents:1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
]

76/2 2026/08/31 21:26 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 80401
							output: 1216
							thoughts: 462
						

Thoughts:
**My Analysis of the Tracepoint Registration Issue**

Okay, so there are 18 tracepoints involved here. The fix seems pretty straightforward, which is always good news. Let's break down the root cause and then walk through the proposed solution.

The problem lies within `blk_register_tracepoints()`. It's using `WARN_ON(ret)` to check the return values of those `register_trace_block_*()` functions. Those functions are allocating memory for the tracepoint probe arrays. And, as we know, memory allocation can fail, especially under memory pressure or if we're dealing with fault injection, resulting in an `-ENOMEM` error.

The current implementation has two significant flaws. First, that `WARN_ON()` call can lead to a kernel panic if `panic_on_warn` is set, which is obviously undesirable. Second, even if it *doesn't* panic, `blk_register_tracepoints()` just ignores the error and merrily continues on, leaving the tracepoints only *partially* registered. Then, later, when we go to stop tracing, `blk_unregister_tracepoints()` gets called, and it tries to unregister *all* tracepoints, regardless of whether they were successfully registered or not. This is where `tracepoint_remove_func()` comes in. And here we get into the crux of the problem: unregistering a tracepoint that was never correctly registered will cause `tracepoint_remove_func()` to return `-ENOENT`. That, in turn, triggers a `WARN_ON_ONCE` call within `tracepoint_remove_func()`, which is obviously a bad state.

So, the proposed solution is a clean, top-to-bottom approach that seems correct.

First, we'll change `blk_register_tracepoints()` itself to return an `int`. This allows us to actually propagate the error. Then, for each call to the `register_trace_*()` functions, we need to check the return value. If we get a failure, we'll use `goto` labels to clean up, which means unregistering the successfully registered tracepoints in reverse order, and returning the error from `blk_register_tracepoints()`. This ensures that we don't leave things in an inconsistent state.

Next, we need to propagate the error up the chain. So we're going to update `get_probe_ref()` to return an `int` and pass the error that it gets from `blk_register_tracepoints()` onwards. Then, `blk_trace_setup_finalize()` will also be updated to return an `int` so that it can properly propagate the error from `get_probe_ref()`.

Finally, we'll ensure that all the callers of `blk_trace_setup_finalize()`, namely `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, handle the error by calling `blk_trace_free()` and returning the error to the caller. We do the same for `blk_trace_setup_queue()` in the same manner. This covers all the bases.

This is a well-thought-out fix. It addresses the root cause directly, and ensures that the errors are properly handled and propagated, which is exactly what's needed.



77/1 2026/08/31 21:26 agent history-explorer
3m Model:
deep-reasoning

Instruction:
You are an experienced Linux kernel developer researching prior art for fixing a kernel bug.
You are given a bug explanation. This explanation details the root cause of the bug resulting
from debugging, but does not provide the final fix strategy. Your goal is to explore how
similar bugs were fixed in the past in the same subsystem or files.

CRITICAL: Do NOT attempt to debug the issue further or write a patch for it yourself.
Your ONLY objective is to research and provide the necessary historical context.

Use the git-log tool with the Since parameter set to "3 years" to focus on recent history.
Search for commits that address issues with similar root causes (e.g. similar missing locks,
incorrect refcounting, or similar error path bugs) in the affected files.

Your final reply must summarize your findings: what idioms, locking rules, or common patterns
should be followed when writing a fix for this bug based on how previous similar bugs were addressed.
If you find no relevant past fixes, clearly state that.

Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash is:

R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>


The explanation of the root cause of the bug is:

The root cause of the crash is that `blk_register_tracepoints()` uses `WARN_ON(ret)` to check the return values of `register_trace_block_*()` functions. These tracepoint registration functions allocate memory for the probe array and can fail with `-ENOMEM` (e.g., under memory pressure or fault injection, as seen in the syzbot report). When they fail, `WARN_ON()` triggers a kernel panic if `panic_on_warn` is set.

Furthermore, `blk_register_tracepoints()` currently ignores the error and continues, leaving the tracepoints in a partially registered state. Later, when tracing is stopped, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. Unregistering a tracepoint that was not successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers another `WARN_ON_ONCE` inside `tracepoint_remove_func()`.

To fix this, we need to properly handle the registration failures by returning the error, unregistering the successfully registered tracepoints, and propagating the error up the call stack to fail the blktrace setup.

### Fix Details

1. **Change `blk_register_tracepoints()` to return an `int` and handle errors:**
   Instead of `WARN_ON(ret)`, check the return value of each `register_trace_*()` call. If it fails, use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error.

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		return ret;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto err_issue;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto err_merge;
        // ... (do this for all 18 tracepoints) ...
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto err_rq_remap;
	return 0;

err_rq_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
// ... (unregister labels in reverse order) ...
err_merge:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
err_issue:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	return ret;
}
```

2. **Propagate the error through `get_probe_ref()`:**
```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

3. **Propagate the error through `blk_trace_setup_finalize()`:**
```c
static int blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)
{
	int ret;
        // ... existing code ...
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
}
```

4. **Handle the error in the callers of `blk_trace_setup_finalize()`:**
   In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, check the return value of `blk_trace_setup_finalize()`. If it fails, clean up the allocated `bt` and return the error:
```c
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
```

5. **Handle the error in `blk_trace_setup_queue()`:**
```c
static int blk_trace_setup_queue(struct request_queue *q,
				 struct block_device *bdev)
{
        // ... existing code ...
	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt:
	blk_trace_free(q, bt);
	return ret;
}
```

Reply:
Based on the research into how similar bugs were addressed in the kernel (particularly within the tracing subsystem), the proposed fix strategy aligns perfectly with established kernel idioms and past fixes. 

Here is a summary of the findings, common patterns, and locking rules that should be followed when writing the fix:

### 1. Removing `WARN_ON` for Expected Errors
Tracepoint registration functions (e.g., `register_trace_*()`) can legitimately fail, most commonly with `-ENOMEM` when allocating memory for the probe array. Using `WARN_ON()` to handle these expected failures is an anti-pattern because it will crash the kernel if `panic_on_warn` is enabled (which is common in testing environments like syzbot). 
* **Prior Art:** Commit `1dd349ab74d2` ("tracing: Do not start benchmark on boot up") explicitly removed a `WARN_ON` on tracepoint setup failure, noting that registration can handle failure cases and should simply return `-ENOMEM`.

### 2. Symmetric Rollback via `goto` Labels
When a function registers multiple tracepoints sequentially, it must implement a symmetric rollback if any registration fails partway through. The standard kernel idiom is to use `goto` labels to unregister the successfully registered tracepoints in the **reverse order** of their registration.
* **Prior Art:** 
  * Commit `aca0cd1bf165` ("tracing/fprobe: Roll back on enable_trace_fprobe() failure") fixed a similar issue where failing partway through left events half-enabled. It introduced a rollback path to unregister all previously registered probes.
  * Commit `bce29ac9ce0b` ("trace: Add osnoise tracer") demonstrates the exact `goto` label pattern for registering/unregistering multiple tracepoints in `osnoise_arch_register()`.

### 3. Preventing Secondary `WARN_ON_ONCE` in Unregistration
If a rollback is not performed, the subsystem is left in a partially initialized state. Later, when the tracer is stopped, it will unconditionally attempt to unregister all tracepoints. Unregistering a tracepoint that was never successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers a secondary `WARN_ON_ONCE`.
* **Prior Art:** Commit `0878355b51f5` ("tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails") fixed an identical bug where failing to clean up hooks on an error path led to a `WARN_ON_ONCE()` in `tracepoint_remove_func()` during tracer disablement.

### 4. Error Propagation and Locking Rules
The error must be propagated up the call stack to ensure the setup fails gracefully. 
* In `get_probe_ref()`, the `blk_probe_mutex` is held. If `blk_register_tracepoints()` fails, you must decrement the `blk_probes_ref` counter before unlocking the mutex, which your proposed fix correctly does.
* In the callers (`blk_trace_setup_finalize()` and `blk_trace_setup_queue()`), propagating the error and cleaning up allocated resources (like `blk_trace_free(q, bt)`) is the correct and expected behavior to prevent memory leaks.

**Conclusion:**
Your proposed fix strategy is completely correct. You should proceed with changing `blk_register_tracepoints()` to return an `int`, replacing the `WARN_ON()` checks with standard `if (ret) goto err_*` blocks for reverse-order unregistration, and propagating the error up through `get_probe_ref()` and the blktrace setup functions.

78/2 2026/08/31 21:26 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7016
							output: 32
							thoughts: 280
						

Thoughts:
**Analyzing the Bug in `kernel/trace/blktrace.c`**

Okay, so I've got this bug to tackle in `kernel/trace/blktrace.c`. It looks like the core issue is the way `blk_register_tracepoints()` handles errors from the `register_trace_block_*()` functions. Specifically, using `WARN_ON(ret)` for `-ENOMEM` is a problem. We need a more robust approach.

My initial thought is to see how similar issues have been handled in this subsystem or related parts of the kernel. Let's use `git-log` to search for relevant commits. I'll focus on `kernel/trace/blktrace.c` and potentially other files within `kernel/trace/`. I want to look for fixes that address error handling, specifically unregistering in reverse order, or removing `WARN_ON` statements on tracepoint registration.

Ah, right, the prompt says to hone the search a bit. Let's set the `Since` parameter to "3 years" to focus on more recent history. That should give us a more relevant set of results. I'll run `git-log` on `kernel/trace/blktrace.c` with that `Since` parameter. I'll also be looking for commits that involve problems similar to this one: maybe missing locks, incorrect refcounting, or errors in error paths. That should give me the best chance of finding a good example.



79/2 2026/08/31 21:26 tool git-log
0m Args:
map[PathPrefix:kernel/trace/blktrace.c Since:3 years]

Results:
map[Output:da46b5dfef48 blktrace: fix __this_cpu_read/write in preemptible context
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
dfe48ea17973 blk-mq: use NOIO context to prevent deadlock during debugfs creation
0c2580a80946 blktrace: Make init_blk_tracer() asynchronous
ee4784a83fb2 block: don't use strcpy to copy blockdev name
bbec8e28cac5 tracing: Allow tracer to add more than 32 options
bc49af56eea8 blktrace: add support for REQ_OP_WRITE_ZEROES tracing
e48886b9d668 blktrace: for ftrace use correct trace format ver
4a0940bdcac2 blktrace: use debug print to report dropped events
]

80/2 2026/08/31 21:26 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7907
							output: 38
							thoughts: 179
						

Thoughts:
**My Investigation into Potential Tracepoint Registration Issues**

Okay, so I need to dig into potential problems related to tracepoint registration, specifically starting with the `kernel/trace/blktrace.c` file. My initial thought was to simply check the commits in that file directly, but I didn't see anything obvious that addressed registration errors. I thought about expanding the search to the entire `kernel/trace/` directory, or perhaps other subsystems where `register_trace_*` functions are used.

Then I re-read the prompt. It's asking about *similar root causes*, things like missing locks, incorrect refcounting, or errors in the same code path, not just issues *in* the given file. Okay, that's a key distinction.

This means I need to broaden my perspective a bit. I could go back and look at the commit history for `kernel/trace/blktrace.c`, perhaps going further back in time, or even at the history of the `kernel/trace/` directory as a whole to see what kinds of problems that area has faced. But, let's back up a step. I need to be more strategic. I'm going to search for the terms "register_trace" or "WARN_ON" within either `kernel/trace/` or `block/` directories to see if these keywords trigger anything related to errors or unusual behavior. This seems like a good approach to cast a wide enough net to catch the relevant commits, based on the keywords.



81/2 2026/08/31 21:26 tool git-log
0m Args:
map[CodeRegexp:register_trace_ PathPrefix:kernel/trace/ Since:3 years]

Results:
map[Output:aca0cd1bf165 tracing/fprobe: Roll back on enable_trace_fprobe() failure
2e82e256df19 perf: tracing: Have perf system calls read user space
bd1b80fba71a perf: tracing: Simplify perf_sysenter_enable/disable() with guards
3f6722816a73 blktrace: trace zone write plugging operations
1c164fcc1b08 blktrace: expose ZONE APPEND completions to blktrace
2db832ec9090 tracing: fprobe-events: Register fprobe-events only when it is enabled
eeadd68e2a5f block: remove bounce buffering support
e3ff4245928f tracing/osnoise: Fix resetting of tracepoints
21e92806d39c function_graph: Support recording and printing the function return address
9d8616034f16 tracing/kprobes: Add symbol counting check when module loads
]

82/2 2026/08/31 21:26 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8691
							output: 23
							thoughts: 63
						

Thoughts:
**Analyzing Error Handling in `blktrace.c`**

Okay, so I'm thinking, before I dive too deep into this specific issue, it's always smart to see if there's existing precedent, particularly in the same area. Let's start by quickly checking the commit history for `kernel/trace/blktrace.c` – see if any previous commits there tackled similar error paths or error recovery scenarios. I want to build on any lessons already learned.

Wait a second, before I get lost in that, I recall a potentially relevant commit, `aca0cd1bf165`, that handles a *tracing* failure. That sounds potentially related to the broader topic and failure scenarios for tracing, but in fprobe. I'll take a quick look at that one first, since it specifically mentions rollback. It might give me some clues as to the logic used for error handling and mitigation when tracing functions fail during their "enable" phase. That could provide helpful insight before tackling my target file.



83/2 2026/08/31 21:26 tool git-show
0m Args:
map[Commit:aca0cd1bf165]

Results:
map[Output:commit aca0cd1bf16574327ef64f3178e5f5e37a61ef0b
Author: Raushan Patel <raushan.jhon@gmail.com>
Date:   Fri Jul 24 12:12:08 2026 +0530

    tracing/fprobe: Roll back on enable_trace_fprobe() failure
    
    enable_trace_fprobe() sets the file link or the TP_FLAG_PROFILE flag and
    then registers each trace_fprobe in the probe list. If
    __register_trace_fprobe() fails partway through, the function returns
    immediately without unregistering the trace_fprobes it already registered
    or undoing the file link / flag it set, leaving the event half-enabled and
    leaking the registered fprobe(s).
    
    enable_trace_kprobe() already handles this with a rollback path. Do the
    same for fprobe: on failure, unregister all probes and clear the file link
    or profile flag.
    
    Link: https://lore.kernel.org/all/20260724064208.480030-1-raushan.jhon@gmail.com/
    
    Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
    Cc: stable@vger.kernel.org
    Signed-off-by: Raushan Patel <raushan.jhon@gmail.com>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c
index 9f5f08c0e7c2..3120403a5b60 100644
--- a/kernel/trace/trace_fprobe.c
+++ b/kernel/trace/trace_fprobe.c
@@ -1481,11 +1481,21 @@ static int enable_trace_fprobe(struct trace_event_call *call,
 		list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
 			ret = __register_trace_fprobe(tf);
 			if (ret < 0)
-				return ret;
+				goto err;
 		}
 	}
 
 	return 0;
+
+err:
+	/* Failed to enable one of them. Roll back all */
+	list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list)
+		__unregister_trace_fprobe(tf);
+	if (file)
+		trace_probe_remove_file(tp, file);
+	else
+		trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
+	return ret;
 }
 
 /*
]

84/2 2026/08/31 21:26 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9726
							output: 36
							thoughts: 121
						

Thoughts:
**Analyzing a Recent Kernel Commit**

Okay, so commit `aca0cd1bf165` is specifically addressing a critical failure scenario in tracepoint registration. The core issue is that when `__register_trace_fprobe()` fails mid-process, it currently *doesn't* roll back the registrations it *has* already completed. This means we're left with a potentially inconsistent state, with some probes registered and others not, leading to potential instability or unexpected behavior in the tracing system. The commit notes that `enable_trace_kprobe()` already has a rollback path to handle this problem. Excellent, so the fix is to implement the *same* robust unregistration/cleanup behavior for `fprobe`: If registration goes south, we *must* unregister everything that was previously registered and clear any associated file links or profiling flags. A very sensible solution.

Now, I'm thinking, let's see if this pattern—the need for explicit rollback on registration failure—appears elsewhere in the kernel, specifically within the `kernel/trace/` or `block/` directories. Maybe there are related commits addressing similar issues in these areas that could inform us or indicate potential related issues that we should look out for. Let's see if we can find any other similar solutions that could be relevant to this area of the code.



85/2 2026/08/31 21:26 tool git-log
0m Args:
map[CodeRegexp:goto err PathPrefix:kernel/trace/ Since:3 years]

Results:
map[Output:aca0cd1bf165 tracing/fprobe: Roll back on enable_trace_fprobe() failure
d471d4f86e86 tracing/remotes: Fix struct_len in trace_remote_alloc_buffer()
15d9968b68e8 tracing/synthetic: Free pending field on error path
d5dc200c3a3f bpf: Add missing access_ok call to copy_user_syms
ba042ed6446f bpf: Add support for tracing_multi link session
46b42af27d40 bpf: Add support for tracing_multi link cookies
c1d32dea5d46 bpf: Add support for tracing multi link
ea908a2b79c8 tracing: Add a trace remote module for testing
330b0cceb306 tracing: Add non-consuming read to trace remotes
9af4ab0e11e3 tracing: Add reset to trace remotes
]

86/2 2026/08/31 21:26 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10409
							output: 41
							thoughts: 30
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating `enable_trace_kprobe()` in `trace_kprobe.c`**

Alright, time to dive into this. I'm thinking the best starting point is probably `kernel/trace/trace_kprobe.c`. Specifically, I need to understand what's happening within the `enable_trace_kprobe()` function. I'm betting that's where the core logic resides for enabling and initializing the kprobes, and that's where I need to focus my attention. It's the lynchpin function, if I recall correctly. I'll need to see how it manages the registration, what it does with the probe's address, and how it links everything together. It's a critical path to understanding the control flow and the state transitions related to kprobe enablement, which is essential to my broader investigation. Let's dig in and see what treasures this function holds.



87/2 2026/08/31 21:27 tool git-log
0m Args:
map[CodeRegexp:enable_trace_kprobe PathPrefix:kernel/trace/ Since:10 years]

Results:
map[Output:60d53e2c3b75 tracing/probe: Split trace_event related data from trace_probe
b5f935ee1339 tracing/probe: Add trace_event_file access APIs for trace_probe
87107a25a2f8 tracing/kprobes: Simplify the logic of enable_trace_kprobe()
]

88/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10792
							output: 27
							thoughts: 38
						

Thoughts:
Here's a summary of my thoughts, as though I'm working through this commit:

**Analyzing `87107a25a2f8` "tracing/kprobes: Simplify the logic of enable_trace_kprobe()"**

Alright, let's dive into commit `87107a25a2f8` related to `tracing/kprobes`. The title itself suggests simplification, which is always a welcome sign. I need to understand what complexities existed before, and how they've been addressed. My gut tells me this will likely involve refactoring conditional logic, maybe consolidating duplicated code, and perhaps improving the overall readability and maintainability of the `enable_trace_kprobe()` function. I'll need to pay close attention to the potential impact on performance, error handling, and any subtle changes in behavior that might arise from this simplification. I'll be looking for comments that help clarify the previous design's rationale and why the changes are beneficial. Now, let's see what the diff says. I need to make sure this doesn't introduce any regressions to the kprobe infrastructure.



89/2 2026/08/31 21:27 tool git-show
0m Args:
map[Commit:87107a25a2f8]

Results:
map[Output:commit 87107a25a2f857693156f075da6e2a1438f4b4a0
Author: Steven Rostedt (VMware) <rostedt@goodmis.org>
Date:   Thu Jul 26 12:07:32 2018 -0400

    tracing/kprobes: Simplify the logic of enable_trace_kprobe()
    
    The function enable_trace_kprobe() performs slightly differently if the file
    parameter is passed in as NULL on non-NULL. Instead of checking file twice,
    move the code between the two tests into a static inline helper function to
    make the code easier to follow.
    
    Link: http://lkml.kernel.org/r/20180725224728.7b1d5db2@vmware.local.home
    Link: http://lkml.kernel.org/r/20180726121152.4dd54330@gandalf.local.home
    
    Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 6b71860f3998..0534eb8b7640 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -393,6 +393,20 @@ static struct trace_kprobe *find_trace_kprobe(const char *event,
 	return NULL;
 }
 
+static inline int __enable_trace_kprobe(struct trace_kprobe *tk)
+{
+	int ret = 0;
+
+	if (trace_probe_is_registered(&tk->tp) && !trace_kprobe_has_gone(tk)) {
+		if (trace_kprobe_is_return(tk))
+			ret = enable_kretprobe(&tk->rp);
+		else
+			ret = enable_kprobe(&tk->rp.kp);
+	}
+
+	return ret;
+}
+
 /*
  * Enable trace_probe
  * if the file is NULL, enable "perf" handler, or enable "trace" handler.
@@ -400,7 +414,7 @@ static struct trace_kprobe *find_trace_kprobe(const char *event,
 static int
 enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file)
 {
-	struct event_file_link *link = NULL;
+	struct event_file_link *link;
 	int ret = 0;
 
 	if (file) {
@@ -414,26 +428,18 @@ enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file)
 		list_add_tail_rcu(&link->list, &tk->tp.files);
 
 		tk->tp.flags |= TP_FLAG_TRACE;
-	} else
-		tk->tp.flags |= TP_FLAG_PROFILE;
-
-	if (trace_probe_is_registered(&tk->tp) && !trace_kprobe_has_gone(tk)) {
-		if (trace_kprobe_is_return(tk))
-			ret = enable_kretprobe(&tk->rp);
-		else
-			ret = enable_kprobe(&tk->rp.kp);
-	}
-
-	if (ret) {
-		if (file) {
-			/* Notice the if is true on not WARN() */
-			if (!WARN_ON_ONCE(!link))
-				list_del_rcu(&link->list);
+		ret = __enable_trace_kprobe(tk);
+		if (ret) {
+			list_del_rcu(&link->list);
 			kfree(link);
 			tk->tp.flags &= ~TP_FLAG_TRACE;
-		} else {
-			tk->tp.flags &= ~TP_FLAG_PROFILE;
 		}
+
+	} else {
+		tk->tp.flags |= TP_FLAG_PROFILE;
+		ret = __enable_trace_kprobe(tk);
+		if (ret)
+			tk->tp.flags &= ~TP_FLAG_PROFILE;
 	}
  out:
 	return ret;
]

90/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12259
							output: 35
							thoughts: 130
						

Thoughts:
**Analyzing Error Handling in Tracepoint Registration**

Okay, so I'm looking at how we handle potential failures during tracepoint registration, specifically focusing on kernel probes (`kprobe`) and potentially `uprobe`. From the `enable_trace_kprobe` function (circa 2018), it's clear that if `__enable_trace_kprobe()` fails, we make sure to clean up by resetting flags and freeing the link – good, basic error handling.

Now, I want to expand this view. The `ret` in `enable_trace_kprobe` is a good place to start, but to get a broader understanding, I need to look at other parts of the tracing infrastructure. The `kernel/trace/trace_uprobe.c` file feels like a good spot to start, or other uses of `register_trace_*`. But wait, that rings a bell. These `register_trace_*` functions... they're generated by the `TRACE_EVENT` macros, right? That's right. So, I need to broaden the search. I should search for `register_trace_` across the kernel, specifically in the `kernel/trace/` directory, `block/` and other subsystems to understand how different subsystems deal with registration errors. This should provide a more complete picture of the best practices and potential pitfalls in these tracepoint registration contexts.



91/2 2026/08/31 21:27 tool grepper
0m Args:
map[Expression:register_trace_[a-zA-Z0-9_]+\( PathPrefix:]

Results:
map[Output:
Full output is too long, showing 500 out of 882 lines.
Use more precise expression if possible.

Documentation/trace/tracepoints.rst=94=probe (function to call) for the specific tracepoint through
Documentation/trace/tracepoints.rst:95:register_trace_subsys_eventname().  Removing a probe is done through
Documentation/trace/tracepoints.rst:96:unregister_trace_subsys_eventname(); it will remove the probe.
Documentation/trace/tracepoints.rst-97-
--
arch/powerpc/platforms/pseries/hvCall_inst.c=112=static int __init hcall_inst_init(void)
--
arch/powerpc/platforms/pseries/hvCall_inst.c-120-
arch/powerpc/platforms/pseries/hvCall_inst.c:121:	if (register_trace_hcall_entry(probe_hcall_entry, NULL))
arch/powerpc/platforms/pseries/hvCall_inst.c-122-		return -EINVAL;
arch/powerpc/platforms/pseries/hvCall_inst.c-123-
arch/powerpc/platforms/pseries/hvCall_inst.c:124:	if (register_trace_hcall_exit(probe_hcall_exit, NULL)) {
arch/powerpc/platforms/pseries/hvCall_inst.c:125:		unregister_trace_hcall_entry(probe_hcall_entry, NULL);
arch/powerpc/platforms/pseries/hvCall_inst.c-126-		return -EINVAL;
--
arch/x86/kernel/trace.c=26=int osnoise_arch_register(void)
--
arch/x86/kernel/trace.c-29-
arch/x86/kernel/trace.c:30:	ret = register_trace_local_timer_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-31-	if (ret)
--
arch/x86/kernel/trace.c-33-
arch/x86/kernel/trace.c:34:	ret = register_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
arch/x86/kernel/trace.c-35-	if (ret)
--
arch/x86/kernel/trace.c-38-#ifdef CONFIG_X86_THERMAL_VECTOR
arch/x86/kernel/trace.c:39:	ret = register_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-40-	if (ret)
--
arch/x86/kernel/trace.c-42-
arch/x86/kernel/trace.c:43:	ret = register_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
arch/x86/kernel/trace.c-44-	if (ret)
--
arch/x86/kernel/trace.c-48-#ifdef CONFIG_X86_MCE_AMD
arch/x86/kernel/trace.c:49:	ret = register_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-50-	if (ret)
--
arch/x86/kernel/trace.c-52-
arch/x86/kernel/trace.c:53:	ret = register_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
arch/x86/kernel/trace.c-54-	if (ret)
--
arch/x86/kernel/trace.c-58-#ifdef CONFIG_X86_MCE_THRESHOLD
arch/x86/kernel/trace.c:59:	ret = register_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-60-	if (ret)
--
arch/x86/kernel/trace.c-62-
arch/x86/kernel/trace.c:63:	ret = register_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
arch/x86/kernel/trace.c-64-	if (ret)
--
arch/x86/kernel/trace.c-68-#ifdef CONFIG_SMP
arch/x86/kernel/trace.c:69:	ret = register_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-70-	if (ret)
--
arch/x86/kernel/trace.c-72-
arch/x86/kernel/trace.c:73:	ret = register_trace_call_function_single_exit(trace_intel_irq_exit,
arch/x86/kernel/trace.c-74-						       "call_function_single");
--
arch/x86/kernel/trace.c-77-
arch/x86/kernel/trace.c:78:	ret = register_trace_call_function_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-79-	if (ret)
--
arch/x86/kernel/trace.c-81-
arch/x86/kernel/trace.c:82:	ret = register_trace_call_function_exit(trace_intel_irq_exit, "call_function");
arch/x86/kernel/trace.c-83-	if (ret)
--
arch/x86/kernel/trace.c-85-
arch/x86/kernel/trace.c:86:	ret = register_trace_reschedule_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-87-	if (ret)
--
arch/x86/kernel/trace.c-89-
arch/x86/kernel/trace.c:90:	ret = register_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");
arch/x86/kernel/trace.c-91-	if (ret)
--
arch/x86/kernel/trace.c-95-#ifdef CONFIG_IRQ_WORK
arch/x86/kernel/trace.c:96:	ret = register_trace_irq_work_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-97-	if (ret)
--
arch/x86/kernel/trace.c-99-
arch/x86/kernel/trace.c:100:	ret = register_trace_irq_work_exit(trace_intel_irq_exit, "irq_work");
arch/x86/kernel/trace.c-101-	if (ret)
--
arch/x86/kernel/trace.c-104-
arch/x86/kernel/trace.c:105:	ret = register_trace_x86_platform_ipi_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-106-	if (ret)
--
arch/x86/kernel/trace.c-108-
arch/x86/kernel/trace.c:109:	ret = register_trace_x86_platform_ipi_exit(trace_intel_irq_exit, "x86_platform_ipi");
arch/x86/kernel/trace.c-110-	if (ret)
--
arch/x86/kernel/trace.c-112-
arch/x86/kernel/trace.c:113:	ret = register_trace_error_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-114-	if (ret)
--
arch/x86/kernel/trace.c-116-
arch/x86/kernel/trace.c:117:	ret = register_trace_error_apic_exit(trace_intel_irq_exit, "error_apic");
arch/x86/kernel/trace.c-118-	if (ret)
--
arch/x86/kernel/trace.c-120-
arch/x86/kernel/trace.c:121:	ret = register_trace_spurious_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-122-	if (ret)
--
arch/x86/kernel/trace.c-124-
arch/x86/kernel/trace.c:125:	ret = register_trace_spurious_apic_exit(trace_intel_irq_exit, "spurious_apic");
arch/x86/kernel/trace.c-126-	if (ret)
--
arch/x86/kernel/trace.c-131-out_spurious_apic_entry:
arch/x86/kernel/trace.c:132:	unregister_trace_spurious_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-133-out_error_apic_exit:
arch/x86/kernel/trace.c:134:	unregister_trace_error_apic_exit(trace_intel_irq_exit, "error_apic");
arch/x86/kernel/trace.c-135-out_error_apic_entry:
arch/x86/kernel/trace.c:136:	unregister_trace_error_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-137-out_x86_ipi_exit:
arch/x86/kernel/trace.c:138:	unregister_trace_x86_platform_ipi_exit(trace_intel_irq_exit, "x86_platform_ipi");
arch/x86/kernel/trace.c-139-out_x86_ipi_entry:
arch/x86/kernel/trace.c:140:	unregister_trace_x86_platform_ipi_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-141-out_irq_work_exit:
--
arch/x86/kernel/trace.c-143-#ifdef CONFIG_IRQ_WORK
arch/x86/kernel/trace.c:144:	unregister_trace_irq_work_exit(trace_intel_irq_exit, "irq_work");
arch/x86/kernel/trace.c-145-out_irq_work_entry:
arch/x86/kernel/trace.c:146:	unregister_trace_irq_work_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-147-out_reschedule_exit:
--
arch/x86/kernel/trace.c-150-#ifdef CONFIG_SMP
arch/x86/kernel/trace.c:151:	unregister_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");
arch/x86/kernel/trace.c-152-out_reschedule_entry:
arch/x86/kernel/trace.c:153:	unregister_trace_reschedule_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-154-out_call_function_exit:
arch/x86/kernel/trace.c:155:	unregister_trace_call_function_exit(trace_intel_irq_exit, "call_function");
arch/x86/kernel/trace.c-156-out_call_function_entry:
arch/x86/kernel/trace.c:157:	unregister_trace_call_function_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-158-out_call_function_single_exit:
arch/x86/kernel/trace.c:159:	unregister_trace_call_function_single_exit(trace_intel_irq_exit, "call_function_single");
arch/x86/kernel/trace.c-160-out_call_function_single_entry:
arch/x86/kernel/trace.c:161:	unregister_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-162-out_threshold_exit:
--
arch/x86/kernel/trace.c-165-#ifdef CONFIG_X86_MCE_THRESHOLD
arch/x86/kernel/trace.c:166:	unregister_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
arch/x86/kernel/trace.c-167-out_threshold_entry:
arch/x86/kernel/trace.c:168:	unregister_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-169-out_deferred_exit:
--
arch/x86/kernel/trace.c-172-#ifdef CONFIG_X86_MCE_AMD
arch/x86/kernel/trace.c:173:	unregister_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
arch/x86/kernel/trace.c-174-out_deferred_entry:
arch/x86/kernel/trace.c:175:	unregister_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-176-out_thermal_exit:
--
arch/x86/kernel/trace.c-179-#ifdef CONFIG_X86_THERMAL_VECTOR
arch/x86/kernel/trace.c:180:	unregister_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
arch/x86/kernel/trace.c-181-out_thermal_entry:
arch/x86/kernel/trace.c:182:	unregister_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-183-out_timer_exit:
--
arch/x86/kernel/trace.c-185-
arch/x86/kernel/trace.c:186:	unregister_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
arch/x86/kernel/trace.c-187-out_timer_entry:
arch/x86/kernel/trace.c:188:	unregister_trace_local_timer_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-189-out_err:
--
arch/x86/kernel/trace.c=193=void osnoise_arch_unregister(void)
arch/x86/kernel/trace.c-194-{
arch/x86/kernel/trace.c:195:	unregister_trace_spurious_apic_exit(trace_intel_irq_exit, "spurious_apic");
arch/x86/kernel/trace.c:196:	unregister_trace_spurious_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c:197:	unregister_trace_error_apic_exit(trace_intel_irq_exit, "error_apic");
arch/x86/kernel/trace.c:198:	unregister_trace_error_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c:199:	unregister_trace_x86_platform_ipi_exit(trace_intel_irq_exit, "x86_platform_ipi");
arch/x86/kernel/trace.c:200:	unregister_trace_x86_platform_ipi_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-201-
arch/x86/kernel/trace.c-202-#ifdef CONFIG_IRQ_WORK
arch/x86/kernel/trace.c:203:	unregister_trace_irq_work_exit(trace_intel_irq_exit, "irq_work");
arch/x86/kernel/trace.c:204:	unregister_trace_irq_work_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-205-#endif
--
arch/x86/kernel/trace.c-207-#ifdef CONFIG_SMP
arch/x86/kernel/trace.c:208:	unregister_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");
arch/x86/kernel/trace.c:209:	unregister_trace_reschedule_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c:210:	unregister_trace_call_function_exit(trace_intel_irq_exit, "call_function");
arch/x86/kernel/trace.c:211:	unregister_trace_call_function_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c:212:	unregister_trace_call_function_single_exit(trace_intel_irq_exit, "call_function_single");
arch/x86/kernel/trace.c:213:	unregister_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-214-#endif
--
arch/x86/kernel/trace.c-216-#ifdef CONFIG_X86_MCE_THRESHOLD
arch/x86/kernel/trace.c:217:	unregister_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
arch/x86/kernel/trace.c:218:	unregister_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-219-#endif
--
arch/x86/kernel/trace.c-221-#ifdef CONFIG_X86_MCE_AMD
arch/x86/kernel/trace.c:222:	unregister_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
arch/x86/kernel/trace.c:223:	unregister_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-224-#endif
--
arch/x86/kernel/trace.c-226-#ifdef CONFIG_X86_THERMAL_VECTOR
arch/x86/kernel/trace.c:227:	unregister_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
arch/x86/kernel/trace.c:228:	unregister_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-229-#endif /* CONFIG_X86_THERMAL_VECTOR */
arch/x86/kernel/trace.c-230-
arch/x86/kernel/trace.c:231:	unregister_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
arch/x86/kernel/trace.c:232:	unregister_trace_local_timer_entry(trace_intel_irq_entry, NULL);
arch/x86/kernel/trace.c-233-}
--
include/linux/trace_events.h=158=struct trace_event {
--
include/linux/trace_events.h-163-
include/linux/trace_events.h:164:extern int register_trace_event(struct trace_event *event);
include/linux/trace_events.h:165:extern int unregister_trace_event(struct trace_event *event);
include/linux/trace_events.h-166-
--
init/main.c=1312=static void __init initcall_debug_enable(void)
--
init/main.c-1315-
init/main.c:1316:	ret = register_trace_initcall_start(trace_initcall_start_cb,
init/main.c-1317-					    &initcall_calltime);
init/main.c:1318:	ret |= register_trace_initcall_finish(trace_initcall_finish_cb,
init/main.c-1319-					      &initcall_calltime);
init/main.c:1320:	ret |= register_trace_initcall_level(trace_initcall_level_cb, NULL);
init/main.c-1321-	WARN(ret, "Failed to register initcall tracepoints\n");
--
kernel/kcsan/kcsan_test.c=1589=static void register_tracepoints(void)
kernel/kcsan/kcsan_test.c-1590-{
kernel/kcsan/kcsan_test.c:1591:	register_trace_console(probe_console, NULL);
kernel/kcsan/kcsan_test.c-1592-}
--
kernel/kcsan/kcsan_test.c=1595=static void unregister_tracepoints(void)
kernel/kcsan/kcsan_test.c-1596-{
kernel/kcsan/kcsan_test.c:1597:	unregister_trace_console(probe_console, NULL);
kernel/kcsan/kcsan_test.c-1598-}
--
kernel/trace/blktrace.c=1327=static void blk_register_tracepoints(void)
--
kernel/trace/blktrace.c-1330-
kernel/trace/blktrace.c:1331:	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1332-	WARN_ON(ret);
kernel/trace/blktrace.c:1333:	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c-1334-	WARN_ON(ret);
kernel/trace/blktrace.c:1335:	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c-1336-	WARN_ON(ret);
kernel/trace/blktrace.c:1337:	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c-1338-	WARN_ON(ret);
kernel/trace/blktrace.c:1339:	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c-1340-	WARN_ON(ret);
kernel/trace/blktrace.c:1341:	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c-1342-	WARN_ON(ret);
kernel/trace/blktrace.c:1343:	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c-1344-	WARN_ON(ret);
kernel/trace/blktrace.c:1345:	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c-1346-	WARN_ON(ret);
kernel/trace/blktrace.c:1347:	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c-1348-	WARN_ON(ret);
kernel/trace/blktrace.c:1349:	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c-1350-	WARN_ON(ret);
kernel/trace/blktrace.c:1351:	ret = register_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1352-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c-1353-	WARN_ON(ret);
kernel/trace/blktrace.c:1354:	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
kernel/trace/blktrace.c-1355-						     NULL);
kernel/trace/blktrace.c-1356-	WARN_ON(ret);
kernel/trace/blktrace.c:1357:	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
kernel/trace/blktrace.c-1358-						NULL);
kernel/trace/blktrace.c-1359-	WARN_ON(ret);
kernel/trace/blktrace.c:1360:	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c-1361-	WARN_ON(ret);
kernel/trace/blktrace.c:1362:	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c-1363-	WARN_ON(ret);
kernel/trace/blktrace.c:1364:	ret = register_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c-1365-	WARN_ON(ret);
kernel/trace/blktrace.c:1366:	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c-1367-	WARN_ON(ret);
kernel/trace/blktrace.c:1368:	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c-1369-	WARN_ON(ret);
--
kernel/trace/blktrace.c=1372=static void blk_unregister_tracepoints(void)
kernel/trace/blktrace.c-1373-{
kernel/trace/blktrace.c:1374:	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c:1375:	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c:1376:	unregister_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c:1377:	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c:1378:	unregister_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c:1379:	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
kernel/trace/blktrace.c:1380:	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
kernel/trace/blktrace.c:1381:	unregister_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1382-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c:1383:	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c:1384:	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c:1385:	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c:1386:	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c:1387:	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c:1388:	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c:1389:	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c:1390:	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c:1391:	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c:1392:	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1393-
--
kernel/trace/blktrace.c=1839=static int __init __init_blk_tracer(void)
kernel/trace/blktrace.c-1840-{
kernel/trace/blktrace.c:1841:	if (!register_trace_event(&trace_blk_event)) {
kernel/trace/blktrace.c-1842-		pr_warn("Warning: could not register block events\n");
--
kernel/trace/blktrace.c-1847-		pr_warn("Warning: could not register the block tracer\n");
kernel/trace/blktrace.c:1848:		unregister_trace_event(&trace_blk_event);
kernel/trace/blktrace.c-1849-		return 1;
--
kernel/trace/fgraph.c=1236=static int start_graph_tracing(void)
--
kernel/trace/fgraph.c-1257-	if (!ret) {
kernel/trace/fgraph.c:1258:		ret = register_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1259-		if (ret)
--
kernel/trace/fgraph.c=1426=void unregister_ftrace_graph(struct fgraph_ops *gops)
--
kernel/trace/fgraph.c-1463-		unregister_pm_notifier(&ftrace_suspend_notifier);
kernel/trace/fgraph.c:1464:		unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1465-	}
--
kernel/trace/ftrace.c=8691=void ftrace_pid_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/ftrace.c-8693-	if (enable) {
kernel/trace/ftrace.c:8694:		register_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8695-						  tr);
kernel/trace/ftrace.c:8696:		register_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8697-						  tr);
kernel/trace/ftrace.c-8698-	} else {
kernel/trace/ftrace.c:8699:		unregister_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8700-						    tr);
kernel/trace/ftrace.c:8701:		unregister_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8702-						    tr);
--
kernel/trace/ftrace.c=8706=static void clear_ftrace_pids(struct trace_array *tr, int type)
--
kernel/trace/ftrace.c-8722-	if (!still_need_pid_events(type, pid_list, no_pid_list)) {
kernel/trace/ftrace.c:8723:		unregister_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8724-		for_each_possible_cpu(cpu)
--
kernel/trace/ftrace.c=8932=pid_write(struct file *filp, const char __user *ubuf,
--
kernel/trace/ftrace.c-8983-		/* Register a probe to set whether to ignore the tracing of a task */
kernel/trace/ftrace.c:8984:		register_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8985-	}
--
kernel/trace/trace_branch.c=178=__init static int init_branch_tracer(void)
--
kernel/trace/trace_branch.c-181-
kernel/trace/trace_branch.c:182:	ret = register_trace_event(&trace_branch_event);
kernel/trace/trace_branch.c-183-	if (!ret) {
--
kernel/trace/trace_eprobe.c=77=static int eprobe_dyn_event_show(struct seq_file *m, struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-94-
kernel/trace/trace_eprobe.c:95:static int unregister_trace_eprobe(struct trace_eprobe *ep)
kernel/trace/trace_eprobe.c-96-{
--
kernel/trace/trace_eprobe.c=116=static int eprobe_dyn_event_release(struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-118-	struct trace_eprobe *ep = to_trace_eprobe(ev);
kernel/trace/trace_eprobe.c:119:	int ret = unregister_trace_eprobe(ep);
kernel/trace/trace_eprobe.c-120-
--
kernel/trace/trace_events.c=645=int trace_event_raw_init(struct trace_event_call *call)
--
kernel/trace/trace_events.c-648-
kernel/trace/trace_events.c:649:	id = register_trace_event(&call->event);
kernel/trace/trace_events.c-650-	if (!id)
--
kernel/trace/trace_events.c=1093=void trace_event_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/trace_events.c-1095-	if (enable) {
kernel/trace/trace_events.c:1096:		register_trace_prio_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1097-						       tr, INT_MIN);
kernel/trace/trace_events.c:1098:		register_trace_prio_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1099-						       tr, INT_MAX);
kernel/trace/trace_events.c-1100-	} else {
kernel/trace/trace_events.c:1101:		unregister_trace_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1102-						    tr);
kernel/trace/trace_events.c:1103:		unregister_trace_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1104-						    tr);
--
kernel/trace/trace_events.c=1188=static void unregister_pid_events(struct trace_array *tr)
kernel/trace/trace_events.c-1189-{
kernel/trace/trace_events.c:1190:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_pre, tr);
kernel/trace/trace_events.c:1191:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_post, tr);
kernel/trace/trace_events.c-1192-
kernel/trace/trace_events.c:1193:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1194:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1195-
kernel/trace/trace_events.c:1196:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1197:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1198-
kernel/trace/trace_events.c:1199:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1200:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1201-}
--
kernel/trace/trace_events.c=2562=static void register_pid_events(struct trace_array *tr)
--
kernel/trace/trace_events.c-2569-	 */
kernel/trace/trace_events.c:2570:	register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_pre,
kernel/trace/trace_events.c-2571-					 tr, INT_MAX);
kernel/trace/trace_events.c:2572:	register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_post,
kernel/trace/trace_events.c-2573-					 tr, 0);
kernel/trace/trace_events.c-2574-
kernel/trace/trace_events.c:2575:	register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2576-					 tr, INT_MAX);
kernel/trace/trace_events.c:2577:	register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2578-					 tr, 0);
kernel/trace/trace_events.c-2579-
kernel/trace/trace_events.c:2580:	register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2581-					     tr, INT_MAX);
kernel/trace/trace_events.c:2582:	register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2583-					     tr, 0);
kernel/trace/trace_events.c-2584-
kernel/trace/trace_events.c:2585:	register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2586-					 tr, INT_MAX);
kernel/trace/trace_events.c:2587:	register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2588-					 tr, 0);
--
kernel/trace/trace_events.c=3350=static void event_remove(struct trace_event_call *call)
--
kernel/trace/trace_events.c-3372-	if (call->event.funcs)
kernel/trace/trace_events.c:3373:		__unregister_trace_event(&call->event);
kernel/trace/trace_events.c-3374-	remove_event_from_tracers(call);
--
kernel/trace/trace_events_synth.c=955=static int register_synth_event(struct synth_event *event)
--
kernel/trace/trace_events_synth.c-977-
kernel/trace/trace_events_synth.c:978:	ret = register_trace_event(&call->event);
kernel/trace/trace_events_synth.c-979-	if (!ret) {
--
kernel/trace/trace_events_synth.c-999-	ret = set_synth_event_print_fmt(call);
kernel/trace/trace_events_synth.c:1000:	/* unregister_trace_event() will be called inside */
kernel/trace/trace_events_synth.c-1001-	if (ret < 0)
--
kernel/trace/trace_events_synth.c-1005- err:
kernel/trace/trace_events_synth.c:1006:	unregister_trace_event(&call->event);
kernel/trace/trace_events_synth.c-1007-	goto out;
--
kernel/trace/trace_events_user.c=1966=static int user_event_trace_register(struct user_event *user)
--
kernel/trace/trace_events_user.c-1969-
kernel/trace/trace_events_user.c:1970:	ret = register_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1971-
--
kernel/trace/trace_events_user.c-1977-	if (ret)
kernel/trace/trace_events_user.c:1978:		unregister_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1979-
--
kernel/trace/trace_fprobe.c=797=static int trace_fprobe_verify_target(struct trace_fprobe *tf)
--
kernel/trace/trace_fprobe.c-813-/* Internal register function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:814:static int __register_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-815-{
--
kernel/trace/trace_fprobe.c-841-/* Internal unregister function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:842:static void __unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-843-{
--
kernel/trace/trace_fprobe.c-853-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_fprobe.c:854:static int unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-855-{
--
kernel/trace/trace_fprobe.c-872-unreg:
kernel/trace/trace_fprobe.c:873:	__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-874-	dyn_event_remove(&tf->devent);
--
kernel/trace/trace_fprobe.c=908=static int append_trace_fprobe_event(struct trace_fprobe *tf, struct trace_fprobe *to)
--
kernel/trace/trace_fprobe.c-945-/* Register a trace_probe and probe_event, and check the fprobe is available. */
kernel/trace/trace_fprobe.c:946:static int register_trace_fprobe_event(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-947-{
--
kernel/trace/trace_fprobe.c=1209=static int trace_fprobe_create_internal(int argc, const char *argv[],
--
kernel/trace/trace_fprobe.c-1378-
kernel/trace/trace_fprobe.c:1379:	ret = register_trace_fprobe_event(tf);
kernel/trace/trace_fprobe.c-1380-	if (ret) {
--
kernel/trace/trace_fprobe.c=1419=static int trace_fprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_fprobe.c-1421-	struct trace_fprobe *tf = to_trace_fprobe(ev);
kernel/trace/trace_fprobe.c:1422:	int ret = unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1423-
--
kernel/trace/trace_fprobe.c=1457=static int enable_trace_fprobe(struct trace_event_call *call,
--
kernel/trace/trace_fprobe.c-1479-		list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
kernel/trace/trace_fprobe.c:1480:			ret = __register_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1481-			if (ret < 0)
--
kernel/trace/trace_fprobe.c-1490-	list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list)
kernel/trace/trace_fprobe.c:1491:		__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1492-	if (file)
--
kernel/trace/trace_functions_graph.c=1814=static __init int init_graph_trace(void)
--
kernel/trace/trace_functions_graph.c-1817-
kernel/trace/trace_functions_graph.c:1818:	if (!register_trace_event(&graph_trace_entry_event)) {
kernel/trace/trace_functions_graph.c-1819-		pr_warn("Warning: could not register graph trace events\n");
--
kernel/trace/trace_functions_graph.c-1823-#ifdef CONFIG_FUNCTION_GRAPH_RETADDR

]

92/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24965
							output: 34
							thoughts: 478
						

Thoughts:
**Analyzing Tracepoint Registration and Error Handling**

Okay, so I've pinpointed the relevant code: `kernel/trace/blktrace.c:1327`. Specifically, `blk_register_tracepoints()`. This is where the tracepoints are registered, using functions like `register_trace_block_rq_insert()` and `register_trace_block_rq_issue()`. That's the starting point for addressing the bug. This is the code that needs fixing, or at least understanding, in relation to previous patterns.

My focus now is on best practices for handling potential registration failures. The prompt demands a summary of idioms, locking rules, or common patterns observed in similar fixes.

The `arch/x86/kernel/trace.c` file from the grep output is incredibly helpful. It demonstrates a very clear pattern. The `osnoise_arch_register` function registers several tracepoints, checks the return value (`ret`) of each registration, and *crucially*, if a registration fails, it jumps to a labeled section to unregister the previously registered tracepoints in reverse order. The specific labels involved in the example are `out_spurious_apic_entry` and `out_error_apic_exit`. This is *exactly* the idiom I'm looking for!

So, the pattern is:

1.  **Register multiple tracepoints.**
2.  **Check the return value (error code) of *each* registration.**
3.  **If an error occurs, jump to a label that handles unregistering any *previously* registered tracepoints, in reverse order of registration.**

I now need to find a past commit to confirm if this pattern is considered best practice. I'll search for commits around this file or with similar keywords. If there are no past fixes, I will have to state so.



93/2 2026/08/31 21:27 tool git-log
0m Args:
map[PathPrefix:arch/x86/kernel/trace.c Since:3 years]

Results:
map[Output:]

94/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25883
							output: 27
							thoughts: 32
						

Thoughts:
Here's my thinking:

**Debugging the Trace.c Search**

Okay, so I just ran a search and used the `Since="3 years"` filter on `arch/x86/kernel/trace.c`, but it came back with *nothing*. That's not right. I'm getting suspicious. I need to figure out why. Clearly, the filter isn't behaving as I expect it to in this case. My first thought is that there might be an issue with how the filtering is being interpreted in conjunction with that specific file path. Let's start by isolating the problem and removing the `Since` parameter altogether. Maybe the issue is just with that filtering component. If the standard search with just the file path produces results, then the `Since` filter is clearly where the problem lies. That will give me a clear path to go down to further investigate the issue.



95/2 2026/08/31 21:27 tool git-log
0m Args:
map[PathPrefix:arch/x86/kernel/trace.c]

Results:
map[Output:9bd985766a43 trace/osnoise: Fix an ifdef comment
f7d9f6370e00 trace/osnoise: Fix 'no previous prototype' warnings
bce29ac9ce0b trace: Add osnoise tracer
]

96/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26204
							output: 24
							thoughts: 23
						

Thoughts:
Here's a summary of my immediate thought process, focusing on an expert perspective:

**Initial Assessment of a Commit Hash**

Okay, `bce29ac9ce0b`... Let's see. My first thought is to immediately grab the context. It's a commit hash, so likely from a version control system like Git. I need to quickly recall the associated project, repository, and branch. Based on the commit message, "trace: Add osnoise tracer," I'm already mentally classifying this as related to system-level tracing, possibly performance analysis or debugging tools within an operating system context. My experience suggests "osnoise" is likely referring to noise within the OS, which could impact latency or introduce jitter. I'm primed to look for changes in tracing instrumentation, perhaps a new kernel module, user-space tools, or improvements to existing tracing infrastructure. My immediate objective is to rapidly assess the scope and potential impact of this change.



97/2 2026/08/31 21:27 tool git-show
0m Args:
map[Commit:bce29ac9ce0b]

Results:
map[Output:
Full output is too long, showing 1000 out of 2416 lines.

[commit bce29ac9ce0bb0b0b146b687ab978378c21e9078
 Author: Daniel Bristot de Oliveira <bristot@redhat.com>
 Date:   Tue Jun 22 16:42:27 2021 +0200
 
     trace: Add osnoise tracer
     
     In the context of high-performance computing (HPC), the Operating System
     Noise (*osnoise*) refers to the interference experienced by an application
     due to activities inside the operating system. In the context of Linux,
     NMIs, IRQs, SoftIRQs, and any other system thread can cause noise to the
     system. Moreover, hardware-related jobs can also cause noise, for example,
     via SMIs.
     
     The osnoise tracer leverages the hwlat_detector by running a similar
     loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
     the sources of *osnoise* during its execution. Using the same approach
     of hwlat, osnoise takes note of the entry and exit point of any
     source of interferences, increasing a per-cpu interference counter. The
     osnoise tracer also saves an interference counter for each source of
     interference. The interference counter for NMI, IRQs, SoftIRQs, and
     threads is increased anytime the tool observes these interferences' entry
     events. When a noise happens without any interference from the operating
     system level, the hardware noise counter increases, pointing to a
     hardware-related noise. In this way, osnoise can account for any
     source of interference. At the end of the period, the osnoise tracer
     prints the sum of all noise, the max single noise, the percentage of CPU
     available for the thread, and the counters for the noise sources.
     
     Usage
     
     Write the ASCII text "osnoise" into the current_tracer file of the
     tracing system (generally mounted at /sys/kernel/tracing).
     
     For example::
     
             [root@f32 ~]# cd /sys/kernel/tracing/
             [root@f32 tracing]# echo osnoise > current_tracer
     
     It is possible to follow the trace by reading the trace trace file::
     
             [root@f32 tracing]# cat trace
             # tracer: osnoise
             #
             #                                _-----=> irqs-off
             #                               / _----=> need-resched
             #                              | / _---=> hardirq/softirq
             #                              || / _--=> preempt-depth                            MAX
             #                              || /                                             SINGLE     Interference counters:
             #                              ||||               RUNTIME      NOISE   % OF CPU  NOISE    +-----------------------------+
             #           TASK-PID      CPU# ||||   TIMESTAMP    IN US       IN US  AVAILABLE  IN US     HW    NMI    IRQ   SIRQ THREAD
             #              | |         |   ||||      |           |             |    |            |      |      |      |      |      |
                        <...>-859     [000] ....    81.637220: 1000000        190  99.98100       9     18      0   1007     18      1
                        <...>-860     [001] ....    81.638154: 1000000        656  99.93440      74     23      0   1006     16      3
                        <...>-861     [002] ....    81.638193: 1000000       5675  99.43250     202      6      0   1013     25     21
                        <...>-862     [003] ....    81.638242: 1000000        125  99.98750      45      1      0   1011     23      0
                        <...>-863     [004] ....    81.638260: 1000000       1721  99.82790     168      7      0   1002     49     41
                        <...>-864     [005] ....    81.638286: 1000000        263  99.97370      57      6      0   1006     26      2
                        <...>-865     [006] ....    81.638302: 1000000        109  99.98910      21      3      0   1006     18      1
                        <...>-866     [007] ....    81.638326: 1000000       7816  99.21840     107      8      0   1016     39     19
     
     In addition to the regular trace fields (from TASK-PID to TIMESTAMP), the
     tracer prints a message at the end of each period for each CPU that is
     running an osnoise/CPU thread. The osnoise specific fields report:
     
      - The RUNTIME IN USE reports the amount of time in microseconds that
        the osnoise thread kept looping reading the time.
      - The NOISE IN US reports the sum of noise in microseconds observed
        by the osnoise tracer during the associated runtime.
      - The % OF CPU AVAILABLE reports the percentage of CPU available for
        the osnoise thread during the runtime window.
      - The MAX SINGLE NOISE IN US reports the maximum single noise observed
        during the runtime window.
      - The Interference counters display how many each of the respective
        interference happened during the runtime window.
     
     Note that the example above shows a high number of HW noise samples.
     The reason being is that this sample was taken on a virtual machine,
     and the host interference is detected as a hardware interference.
     
     Tracer options
     
     The tracer has a set of options inside the osnoise directory, they are:
     
      - osnoise/cpus: CPUs at which a osnoise thread will execute.
      - osnoise/period_us: the period of the osnoise thread.
      - osnoise/runtime_us: how long an osnoise thread will look for noise.
      - osnoise/stop_tracing_us: stop the system tracing if a single noise
        higher than the configured value happens. Writing 0 disables this
        option.
      - osnoise/stop_tracing_total_us: stop the system tracing if total noise
        higher than the configured value happens. Writing 0 disables this
        option.
      - tracing_threshold: the minimum delta between two time() reads to be
        considered as noise, in us. When set to 0, the default value will
        be used, which is currently 5 us.
     
     Additional Tracing
     
     In addition to the tracer, a set of tracepoints were added to
     facilitate the identification of the osnoise source.
     
      - osnoise:sample_threshold: printed anytime a noise is higher than
        the configurable tolerance_ns.
      - osnoise:nmi_noise: noise from NMI, including the duration.
      - osnoise:irq_noise: noise from an IRQ, including the duration.
      - osnoise:softirq_noise: noise from a SoftIRQ, including the
        duration.
      - osnoise:thread_noise: noise from a thread, including the duration.
     
     Note that all the values are *net values*. For example, if while osnoise
     is running, another thread preempts the osnoise thread, it will start a
     thread_noise duration at the start. Then, an IRQ takes place, preempting
     the thread_noise, starting a irq_noise. When the IRQ ends its execution,
     it will compute its duration, and this duration will be subtracted from
     the thread_noise, in such a way as to avoid the double accounting of the
     IRQ execution. This logic is valid for all sources of noise.
     
     Here is one example of the usage of these tracepoints::
     
            osnoise/8-961     [008] d.h.  5789.857532: irq_noise: local_timer:236 start 5789.857529929 duration 1845 ns
            osnoise/8-961     [008] dNh.  5789.858408: irq_noise: local_timer:236 start 5789.858404871 duration 2848 ns
          migration/8-54      [008] d...  5789.858413: thread_noise: migration/8:54 start 5789.858409300 duration 3068 ns
            osnoise/8-961     [008] ....  5789.858413: sample_threshold: start 5789.858404555 duration 8723 ns interferences 2
     
     In this example, a noise sample of 8 microseconds was reported in the last
     line, pointing to two interferences. Looking backward in the trace, the
     two previous entries were about the migration thread running after a
     timer IRQ execution. The first event is not part of the noise because
     it took place one millisecond before.
     
     It is worth noticing that the sum of the duration reported in the
     tracepoints is smaller than eight us reported in the sample_threshold.
     The reason roots in the overhead of the entry and exit code that happens
     before and after any interference execution. This justifies the dual
     approach: measuring thread and tracing.
     
     Link: https://lkml.kernel.org/r/e649467042d60e7b62714c9c6751a56299d15119.1624372313.git.bristot@redhat.com
     
     Cc: Phil Auld <pauld@redhat.com>
     Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
     Cc: Kate Carcia <kcarcia@redhat.com>
     Cc: Jonathan Corbet <corbet@lwn.net>
     Cc: Ingo Molnar <mingo@redhat.com>
     Cc: Peter Zijlstra <peterz@infradead.org>
     Cc: Thomas Gleixner <tglx@linutronix.de>
     Cc: Alexandre Chartre <alexandre.chartre@oracle.com>
     Cc: Clark Willaims <williams@redhat.com>
     Cc: John Kacur <jkacur@redhat.com>
     Cc: Juri Lelli <juri.lelli@redhat.com>
     Cc: Borislav Petkov <bp@alien8.de>
     Cc: "H. Peter Anvin" <hpa@zytor.com>
     Cc: x86@kernel.org
     Cc: linux-doc@vger.kernel.org
     Cc: linux-kernel@vger.kernel.org
     Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
     [
       Made the following functions static:
        trace_irqentry_callback()
        trace_irqexit_callback()
        trace_intel_irqentry_callback()
        trace_intel_irqexit_callback()
     
       Added to include/trace.h:
        osnoise_arch_register()
        osnoise_arch_unregister()
     
       Fixed define logic for LATENCY_FS_NOTIFY
     
       Reported-by: kernel test robot <lkp@intel.com>
     ]
     Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
 
 diff --git a/Documentation/trace/index.rst b/Documentation/trace/index.rst
 index f634b36fd3aa..608107b27cc0 100644
 --- a/Documentation/trace/index.rst
 +++ b/Documentation/trace/index.rst
 @@ -23,6 +23,7 @@ Linux Tracing Technologies
     histogram-design
     boottime-trace
     hwlat_detector
 +   osnoise-tracer
     intel_th
     ring-buffer-design
     stm
 diff --git a/Documentation/trace/osnoise-tracer.rst b/Documentation/trace/osnoise-tracer.rst
 new file mode 100644
 index 000000000000..37a3c10fb216
 --- /dev/null
 +++ b/Documentation/trace/osnoise-tracer.rst
 @@ -0,0 +1,152 @@
 +==============
 +OSNOISE Tracer
 +==============
 +
 +In the context of high-performance computing (HPC), the Operating System
 +Noise (*osnoise*) refers to the interference experienced by an application
 +due to activities inside the operating system. In the context of Linux,
 +NMIs, IRQs, SoftIRQs, and any other system thread can cause noise to the
 +system. Moreover, hardware-related jobs can also cause noise, for example,
 +via SMIs.
 +
 +hwlat_detector is one of the tools used to identify the most complex
 +source of noise: *hardware noise*.
 +
 +In a nutshell, the hwlat_detector creates a thread that runs
 +periodically for a given period. At the beginning of a period, the thread
 +disables interrupt and starts sampling. While running, the hwlatd
 +thread reads the time in a loop. As interrupts are disabled, threads,
 +IRQs, and SoftIRQs cannot interfere with the hwlatd thread. Hence, the
 +cause of any gap between two different reads of the time roots either on
 +NMI or in the hardware itself. At the end of the period, hwlatd enables
 +interrupts and reports the max observed gap between the reads. It also
 +prints a NMI occurrence counter. If the output does not report NMI
 +executions, the user can conclude that the hardware is the culprit for
 +the latency. The hwlat detects the NMI execution by observing
 +the entry and exit of a NMI.
 +
 +The osnoise tracer leverages the hwlat_detector by running a
 +similar loop with preemption, SoftIRQs and IRQs enabled, thus allowing
 +all the sources of *osnoise* during its execution. Using the same approach
 +of hwlat, osnoise takes note of the entry and exit point of any
 +source of interferences, increasing a per-cpu interference counter. The
 +osnoise tracer also saves an interference counter for each source of
 +interference. The interference counter for NMI, IRQs, SoftIRQs, and
 +threads is increased anytime the tool observes these interferences' entry
 +events. When a noise happens without any interference from the operating
 +system level, the hardware noise counter increases, pointing to a
 +hardware-related noise. In this way, osnoise can account for any
 +source of interference. At the end of the period, the osnoise tracer
 +prints the sum of all noise, the max single noise, the percentage of CPU
 +available for the thread, and the counters for the noise sources.
 +
 +Usage
 +-----
 +
 +Write the ASCII text "osnoise" into the current_tracer file of the
 +tracing system (generally mounted at /sys/kernel/tracing).
 +
 +For example::
 +
 +        [root@f32 ~]# cd /sys/kernel/tracing/
 +        [root@f32 tracing]# echo osnoise > current_tracer
 +
 +It is possible to follow the trace by reading the trace trace file::
 +
 +        [root@f32 tracing]# cat trace
 +        # tracer: osnoise
 +        #
 +        #                                _-----=> irqs-off
 +        #                               / _----=> need-resched
 +        #                              | / _---=> hardirq/softirq
 +        #                              || / _--=> preempt-depth                            MAX
 +        #                              || /                                             SINGLE     Interference counters:
 +        #                              ||||               RUNTIME      NOISE   % OF CPU  NOISE    +-----------------------------+
 +        #           TASK-PID      CPU# ||||   TIMESTAMP    IN US       IN US  AVAILABLE  IN US     HW    NMI    IRQ   SIRQ THREAD
 +        #              | |         |   ||||      |           |             |    |            |      |      |      |      |      |
 +                   <...>-859     [000] ....    81.637220: 1000000        190  99.98100       9     18      0   1007     18      1
 +                   <...>-860     [001] ....    81.638154: 1000000        656  99.93440      74     23      0   1006     16      3
 +                   <...>-861     [002] ....    81.638193: 1000000       5675  99.43250     202      6      0   1013     25     21
 +                   <...>-862     [003] ....    81.638242: 1000000        125  99.98750      45      1      0   1011     23      0
 +                   <...>-863     [004] ....    81.638260: 1000000       1721  99.82790     168      7      0   1002     49     41
 +                   <...>-864     [005] ....    81.638286: 1000000        263  99.97370      57      6      0   1006     26      2
 +                   <...>-865     [006] ....    81.638302: 1000000        109  99.98910      21      3      0   1006     18      1
 +                   <...>-866     [007] ....    81.638326: 1000000       7816  99.21840     107      8      0   1016     39     19
 +
 +In addition to the regular trace fields (from TASK-PID to TIMESTAMP), the
 +tracer prints a message at the end of each period for each CPU that is
 +running an osnoise/ thread. The osnoise specific fields report:
 +
 + - The RUNTIME IN USE reports the amount of time in microseconds that
 +   the osnoise thread kept looping reading the time.
 + - The NOISE IN US reports the sum of noise in microseconds observed
 +   by the osnoise tracer during the associated runtime.
 + - The % OF CPU AVAILABLE reports the percentage of CPU available for
 +   the osnoise thread during the runtime window.
 + - The MAX SINGLE NOISE IN US reports the maximum single noise observed
 +   during the runtime window.
 + - The Interference counters display how many each of the respective
 +   interference happened during the runtime window.
 +
 +Note that the example above shows a high number of HW noise samples.
 +The reason being is that this sample was taken on a virtual machine,
 +and the host interference is detected as a hardware interference.
 +
 +Tracer options
 +---------------------
 +
 +The tracer has a set of options inside the osnoise directory, they are:
 +
 + - osnoise/cpus: CPUs at which a osnoise thread will execute.
 + - osnoise/period_us: the period of the osnoise thread.
 + - osnoise/runtime_us: how long an osnoise thread will look for noise.
 + - osnoise/stop_tracing_us: stop the system tracing if a single noise
 +   higher than the configured value happens. Writing 0 disables this
 +   option.
 + - osnoise/stop_tracing_total_us: stop the system tracing if total noise
 +   higher than the configured value happens. Writing 0 disables this
 +   option.
 + - tracing_threshold: the minimum delta between two time() reads to be
 +   considered as noise, in us. When set to 0, the default value will
 +   will be used, which is currently 5 us.
 +
 +Additional Tracing
 +------------------
 +
 +In addition to the tracer, a set of tracepoints were added to
 +facilitate the identification of the osnoise source.
 +
 + - osnoise:sample_threshold: printed anytime a noise is higher than
 +   the configurable tolerance_ns.
 + - osnoise:nmi_noise: noise from NMI, including the duration.
 + - osnoise:irq_noise: noise from an IRQ, including the duration.
 + - osnoise:softirq_noise: noise from a SoftIRQ, including the
 +   duration.
 + - osnoise:thread_noise: noise from a thread, including the duration.
 +
 +Note that all the values are *net values*. For example, if while osnoise
 +is running, another thread preempts the osnoise thread, it will start a
 +thread_noise duration at the start. Then, an IRQ takes place, preempting
 +the thread_noise, starting a irq_noise. When the IRQ ends its execution,
 +it will compute its duration, and this duration will be subtracted from
 +the thread_noise, in such a way as to avoid the double accounting of the
 +IRQ execution. This logic is valid for all sources of noise.
 +
 +Here is one example of the usage of these tracepoints::
 +
 +       osnoise/8-961     [008] d.h.  5789.857532: irq_noise: local_timer:236 start 5789.857529929 duration 1845 ns
 +       osnoise/8-961     [008] dNh.  5789.858408: irq_noise: local_timer:236 start 5789.858404871 duration 2848 ns
 +     migration/8-54      [008] d...  5789.858413: thread_noise: migration/8:54 start 5789.858409300 duration 3068 ns
 +       osnoise/8-961     [008] ....  5789.858413: sample_threshold: start 5789.858404555 duration 8812 ns interferences 2
 +
 +In this example, a noise sample of 8 microseconds was reported in the last
 +line, pointing to two interferences. Looking backward in the trace, the
 +two previous entries were about the migration thread running after a
 +timer IRQ execution. The first event is not part of the noise because
 +it took place one millisecond before.
 +
 +It is worth noticing that the sum of the duration reported in the
 +tracepoints is smaller than eight us reported in the sample_threshold.
 +The reason roots in the overhead of the entry and exit code that happens
 +before and after any interference execution. This justifies the dual
 +approach: measuring thread and tracing.
 diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
 index 0f66682ac02a..3e625c61f008 100644
 --- a/arch/x86/kernel/Makefile
 +++ b/arch/x86/kernel/Makefile
 @@ -102,6 +102,7 @@ obj-$(CONFIG_FUNCTION_TRACER)	+= ftrace_$(BITS).o
  obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
  obj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
  obj-$(CONFIG_X86_TSC)		+= trace_clock.o
 +obj-$(CONFIG_TRACING)		+= trace.o
  obj-$(CONFIG_CRASH_CORE)	+= crash_core_$(BITS).o
  obj-$(CONFIG_KEXEC_CORE)	+= machine_kexec_$(BITS).o
  obj-$(CONFIG_KEXEC_CORE)	+= relocate_kernel_$(BITS).o crash.o
 diff --git a/arch/x86/kernel/trace.c b/arch/x86/kernel/trace.c
 new file mode 100644
 index 000000000000..6912672c33a7
 --- /dev/null
 +++ b/arch/x86/kernel/trace.c
 @@ -0,0 +1,237 @@
 +#include <asm/trace/irq_vectors.h>
 +#include <linux/trace.h>
 +
 +#if defined(CONFIG_OSNOISE_TRACER) && defined(CONFIG_X86_LOCAL_APIC)
 +extern void osnoise_trace_irq_entry(int id);
 +extern void osnoise_trace_irq_exit(int id, const char *desc);
 +
 +/*
 + * trace_intel_irq_entry - record intel specific IRQ entry
 + */
 +static void trace_intel_irq_entry(void *data, int vector)
 +{
 +	osnoise_trace_irq_entry(vector);
 +}
 +
 +/*
 + * trace_intel_irq_exit - record intel specific IRQ exit
 + */
 +static void trace_intel_irq_exit(void *data, int vector)
 +{
 +	char *vector_desc = (char *) data;
 +
 +	osnoise_trace_irq_exit(vector, vector_desc);
 +}
 +
 +/*
 + * register_intel_irq_tp - Register intel specific IRQ entry tracepoints
 + */
 +int osnoise_arch_register(void)
 +{
 +	int ret;
 +
 +	ret = register_trace_local_timer_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_err;
 +
 +	ret = register_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
 +	if (ret)
 +		goto out_timer_entry;
 +
 +#ifdef CONFIG_X86_THERMAL_VECTOR
 +	ret = register_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_timer_exit;
 +
 +	ret = register_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
 +	if (ret)
 +		goto out_thermal_entry;
 +#endif /* CONFIG_X86_THERMAL_VECTOR */
 +
 +#ifdef CONFIG_X86_MCE_AMD
 +	ret = register_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_thermal_exit;
 +
 +	ret = register_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
 +	if (ret)
 +		goto out_deferred_entry;
 +#endif
 +
 +#ifdef CONFIG_X86_MCE_THRESHOLD
 +	ret = register_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_deferred_exit;
 +
 +	ret = register_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
 +	if (ret)
 +		goto out_threshold_entry;
 +#endif /* CONFIG_X86_MCE_THRESHOLD */
 +
 +#ifdef CONFIG_SMP
 +	ret = register_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_threshold_exit;
 +
 +	ret = register_trace_call_function_single_exit(trace_intel_irq_exit,
 +						       "call_function_single");
 +	if (ret)
 +		goto out_call_function_single_entry;
 +
 +	ret = register_trace_call_function_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_call_function_single_exit;
 +
 +	ret = register_trace_call_function_exit(trace_intel_irq_exit, "call_function");
 +	if (ret)
 +		goto out_call_function_entry;
 +
 +	ret = register_trace_reschedule_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_call_function_exit;
 +
 +	ret = register_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");
 +	if (ret)
 +		goto out_reschedule_entry;
 +#endif /* CONFIG_SMP */
 +
 +#ifdef CONFIG_IRQ_WORK
 +	ret = register_trace_irq_work_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_reschedule_exit;
 +
 +	ret = register_trace_irq_work_exit(trace_intel_irq_exit, "irq_work");
 +	if (ret)
 +		goto out_irq_work_entry;
 +#endif
 +
 +	ret = register_trace_x86_platform_ipi_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_irq_work_exit;
 +
 +	ret = register_trace_x86_platform_ipi_exit(trace_intel_irq_exit, "x86_platform_ipi");
 +	if (ret)
 +		goto out_x86_ipi_entry;
 +
 +	ret = register_trace_error_apic_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_x86_ipi_exit;
 +
 +	ret = register_trace_error_apic_exit(trace_intel_irq_exit, "error_apic");
 +	if (ret)
 +		goto out_error_apic_entry;
 +
 +	ret = register_trace_spurious_apic_entry(trace_intel_irq_entry, NULL);
 +	if (ret)
 +		goto out_error_apic_exit;
 +
 +	ret = register_trace_spurious_apic_exit(trace_intel_irq_exit, "spurious_apic");
 +	if (ret)
 +		goto out_spurious_apic_entry;
 +
 +	return 0;
 +
 +out_spurious_apic_entry:
 +	unregister_trace_spurious_apic_entry(trace_intel_irq_entry, NULL);
 +out_error_apic_exit:
 +	unregister_trace_error_apic_exit(trace_intel_irq_exit, "error_apic");
 +out_error_apic_entry:
 +	unregister_trace_error_apic_entry(trace_intel_irq_entry, NULL);
 +out_x86_ipi_exit:
 +	unregister_trace_x86_platform_ipi_exit(trace_intel_irq_exit, "x86_platform_ipi");
 +out_x86_ipi_entry:
 +	unregister_trace_x86_platform_ipi_entry(trace_intel_irq_entry, NULL);
 +out_irq_work_exit:
 +
 +#ifdef CONFIG_IRQ_WORK
 +	unregister_trace_irq_work_exit(trace_intel_irq_exit, "irq_work");
 +out_irq_work_entry:
 +	unregister_trace_irq_work_entry(trace_intel_irq_entry, NULL);
 +out_reschedule_exit:
 +#endif
 +
 +#ifdef CONFIG_SMP
 +	unregister_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");
 +out_reschedule_entry:
 +	unregister_trace_reschedule_entry(trace_intel_irq_entry, NULL);
 +out_call_function_exit:
 +	unregister_trace_call_function_exit(trace_intel_irq_exit, "call_function");
 +out_call_function_entry:
 +	unregister_trace_call_function_entry(trace_intel_irq_entry, NULL);
 +out_call_function_single_exit:
 +	unregister_trace_call_function_single_exit(trace_intel_irq_exit, "call_function_single");
 +out_call_function_single_entry:
 +	unregister_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
 +out_threshold_exit:
 +#endif
 +
 +#ifdef CONFIG_X86_MCE_THRESHOLD
 +	unregister_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
 +out_threshold_entry:
 +	unregister_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
 +out_deferred_exit:
 +#endif
 +
 +#ifdef CONFIG_X86_MCE_AMD
 +	unregister_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
 +out_deferred_entry:
 +	unregister_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
 +out_thermal_exit:
 +#endif /* CONFIG_X86_MCE_AMD */
 +
 +#ifdef CONFIG_X86_THERMAL_VECTOR
 +	unregister_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
 +out_thermal_entry:
 +	unregister_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
 +out_timer_exit:
 +#endif /* CONFIG_X86_THERMAL_VECTOR */
 +
 +	unregister_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
 +out_timer_entry:
 +	unregister_trace_local_timer_entry(trace_intel_irq_entry, NULL);
 +out_err:
 +	return -EINVAL;
 +}
 +
 +void osnoise_arch_unregister(void)
 +{
 +	unregister_trace_spurious_apic_exit(trace_intel_irq_exit, "spurious_apic");
 +	unregister_trace_spurious_apic_entry(trace_intel_irq_entry, NULL);
 +	unregister_trace_error_apic_exit(trace_intel_irq_exit, "error_apic");
 +	unregister_trace_error_apic_entry(trace_intel_irq_entry, NULL);
 +	unregister_trace_x86_platform_ipi_exit(trace_intel_irq_exit, "x86_platform_ipi");
 +	unregister_trace_x86_platform_ipi_entry(trace_intel_irq_entry, NULL);
 +
 +#ifdef CONFIG_IRQ_WORK
 +	unregister_trace_irq_work_exit(trace_intel_irq_exit, "irq_work");
 +	unregister_trace_irq_work_entry(trace_intel_irq_entry, NULL);
 +#endif
 +
 +#ifdef CONFIG_SMP
 +	unregister_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");
 +	unregister_trace_reschedule_entry(trace_intel_irq_entry, NULL);
 +	unregister_trace_call_function_exit(trace_intel_irq_exit, "call_function");
 +	unregister_trace_call_function_entry(trace_intel_irq_entry, NULL);
 +	unregister_trace_call_function_single_exit(trace_intel_irq_exit, "call_function_single");
 +	unregister_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
 +#endif
 +
 +#ifdef CONFIG_X86_MCE_THRESHOLD
 +	unregister_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
 +	unregister_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
 +#endif
 +
 +#ifdef CONFIG_X86_MCE_AMD
 +	unregister_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
 +	unregister_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
 +#endif
 +
 +#ifdef CONFIG_X86_THERMAL_VECTOR
 +	unregister_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
 +	unregister_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
 +#endif /* CONFIG_X86_THERMAL_VECTOR */
 +
 +	unregister_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
 +	unregister_trace_local_timer_entry(trace_intel_irq_entry, NULL);
 +}
 +#endif /* CONFIG_OSNOISE_TRAECR && CONFIG_X86_LOCAL_APIC */
 diff --git a/include/linux/ftrace_irq.h b/include/linux/ftrace_irq.h
 index 0abd9a1d2852..f6faa31289ba 100644
 --- a/include/linux/ftrace_irq.h
 +++ b/include/linux/ftrace_irq.h
 @@ -7,12 +7,21 @@ extern bool trace_hwlat_callback_enabled;
  extern void trace_hwlat_callback(bool enter);
  #endif
  
 +#ifdef CONFIG_OSNOISE_TRACER
 +extern bool trace_osnoise_callback_enabled;
 +extern void trace_osnoise_callback(bool enter);
 +#endif
 +
  static inline void ftrace_nmi_enter(void)
  {
  #ifdef CONFIG_HWLAT_TRACER
  	if (trace_hwlat_callback_enabled)
  		trace_hwlat_callback(true);
  #endif
 +#ifdef CONFIG_OSNOISE_TRACER
 +	if (trace_osnoise_callback_enabled)
 +		trace_osnoise_callback(true);
 +#endif
  }
  
  static inline void ftrace_nmi_exit(void)
 @@ -21,6 +30,10 @@ static inline void ftrace_nmi_exit(void)
  	if (trace_hwlat_callback_enabled)
  		trace_hwlat_callback(false);
  #endif
 +#ifdef CONFIG_OSNOISE_TRACER
 +	if (trace_osnoise_callback_enabled)
 +		trace_osnoise_callback(false);
 +#endif
  }
  
  #endif /* _LINUX_FTRACE_IRQ_H */
 diff --git a/include/linux/trace.h b/include/linux/trace.h
 index be1e130ed87c..4e3858640c47 100644
 --- a/include/linux/trace.h
 +++ b/include/linux/trace.h
 @@ -41,6 +41,11 @@ int trace_array_init_printk(struct trace_array *tr);
  void trace_array_put(struct trace_array *tr);
  struct trace_array *trace_array_get_by_name(const char *name);
  int trace_array_destroy(struct trace_array *tr);
 +
 +/* For osnoise tracer */
 +int osnoise_arch_register(void);
 +void osnoise_arch_unregister(void);
 +
  #endif	/* CONFIG_TRACING */
  
  #endif	/* _LINUX_TRACE_H */
 diff --git a/include/trace/events/osnoise.h b/include/trace/events/osnoise.h
 new file mode 100644
 index 000000000000..28762c69f6c9
 --- /dev/null
 +++ b/include/trace/events/osnoise.h
 @@ -0,0 +1,142 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +#undef TRACE_SYSTEM
 +#define TRACE_SYSTEM osnoise
 +
 +#if !defined(_OSNOISE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
 +#define _OSNOISE_TRACE_H
 +
 +#include <linux/tracepoint.h>
 +TRACE_EVENT(thread_noise,
 +
 +	TP_PROTO(struct task_struct *t, u64 start, u64 duration),
 +
 +	TP_ARGS(t, start, duration),
 +
 +	TP_STRUCT__entry(
 +		__array(	char,		comm,	TASK_COMM_LEN)
 +		__field(	u64,		start	)
 +		__field(	u64,		duration)
 +		__field(	pid_t,		pid	)
 +	),
 +
 +	TP_fast_assign(
 +		memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
 +		__entry->pid = t->pid;
 +		__entry->start = start;
 +		__entry->duration = duration;
 +	),
 +
 +	TP_printk("%8s:%d start %llu.%09u duration %llu ns",
 +		__entry->comm,
 +		__entry->pid,
 +		__print_ns_to_secs(__entry->start),
 +		__print_ns_without_secs(__entry->start),
 +		__entry->duration)
 +);
 +
 +TRACE_EVENT(softirq_noise,
 +
 +	TP_PROTO(int vector, u64 start, u64 duration),
 +
 +	TP_ARGS(vector, start, duration),
 +
 +	TP_STRUCT__entry(
 +		__field(	u64,		start	)
 +		__field(	u64,		duration)
 +		__field(	int,		vector	)
 +	),
 +
 +	TP_fast_assign(
 +		__entry->vector = vector;
 +		__entry->start = start;
 +		__entry->duration = duration;
 +	),
 +
 +	TP_printk("%8s:%d start %llu.%09u duration %llu ns",
 +		show_softirq_name(__entry->vector),
 +		__entry->vector,
 +		__print_ns_to_secs(__entry->start),
 +		__print_ns_without_secs(__entry->start),
 +		__entry->duration)
 +);
 +
 +TRACE_EVENT(irq_noise,
 +
 +	TP_PROTO(int vector, const char *desc, u64 start, u64 duration),
 +
 +	TP_ARGS(vector, desc, start, duration),
 +
 +	TP_STRUCT__entry(
 +		__field(	u64,		start	)
 +		__field(	u64,		duration)
 +		__string(	desc,		desc    )
 +		__field(	int,		vector	)
 +
 +	),
 +
 +	TP_fast_assign(
 +		__assign_str(desc, desc);
 +		__entry->vector = vector;
 +		__entry->start = start;
 +		__entry->duration = duration;
 +	),
 +
 +	TP_printk("%s:%d start %llu.%09u duration %llu ns",
 +		__get_str(desc),
 +		__entry->vector,
 +		__print_ns_to_secs(__entry->start),
 +		__print_ns_without_secs(__entry->start),
 +		__entry->duration)
 +);
 +
 +TRACE_EVENT(nmi_noise,
 +
 +	TP_PROTO(u64 start, u64 duration),
 +
 +	TP_ARGS(start, duration),
 +
 +	TP_STRUCT__entry(
 +		__field(	u64,		start	)
 +		__field(	u64,		duration)
 +	),
 +
 +	TP_fast_assign(
 +		__entry->start = start;
 +		__entry->duration = duration;
 +	),
 +
 +	TP_printk("start %llu.%09u duration %llu ns",
 +		__print_ns_to_secs(__entry->start),
 +		__print_ns_without_secs(__entry->start),
 +		__entry->duration)
 +);
 +
 +TRACE_EVENT(sample_threshold,
 +
 +	TP_PROTO(u64 start, u64 duration, u64 interference),
 +
 +	TP_ARGS(start, duration, interference),
 +
 +	TP_STRUCT__entry(
 +		__field(	u64,		start	)
 +		__field(	u64,		duration)
 +		__field(	u64,		interference)
 +	),
 +
 +	TP_fast_assign(
 +		__entry->start = start;
 +		__entry->duration = duration;
 +		__entry->interference = interference;
 +	),
 +
 +	TP_printk("start %llu.%09u duration %llu ns interferences %llu",
 +		__print_ns_to_secs(__entry->start),
 +		__print_ns_without_secs(__entry->start),
 +		__entry->duration,
 +		__entry->interference)
 +);
 +
 +#endif /* _TRACE_OSNOISE_H */
 +
 +/* This part must be outside protection */
 +#include <trace/define_trace.h>
 diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
 index 7fa82778c3e6..41582ae4682b 100644
 --- a/kernel/trace/Kconfig
 +++ b/kernel/trace/Kconfig
 @@ -356,6 +356,40 @@ config HWLAT_TRACER
  	 file. Every time a latency is greater than tracing_thresh, it will
  	 be recorded into the ring buffer.
  
 +config OSNOISE_TRACER
 +	bool "OS Noise tracer"
 +	select GENERIC_TRACER
 +	help
 +	  In the context of high-performance computing (HPC), the Operating
 +	  System Noise (osnoise) refers to the interference experienced by an
 +	  application due to activities inside the operating system. In the
 +	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
 +	  can cause noise to the system. Moreover, hardware-related jobs can
 +	  also cause noise, for example, via SMIs.
 +
 +	  The osnoise tracer leverages the hwlat_detector by running a similar
 +	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
 +	  the sources of osnoise during its execution. The osnoise tracer takes
 +	  note of the entry and exit point of any source of interferences,
 +	  increasing a per-cpu interference counter. It saves an interference
 +	  counter for each source of interference. The interference counter for
 +	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
 +	  observes these interferences' entry events. When a noise happens
 +	  without any interference from the operating system level, the
 +	  hardware noise counter increases, pointing to a hardware-related
 +	  noise. In this way, osnoise can account for any source of
 +	  interference. At the end of the period, the osnoise tracer prints
 +	  the sum of all noise, the max single noise, the percentage of CPU
 +	  available for the thread, and the counters for the noise sources.
 +
 +	  In addition to the tracer, a set of tracepoints were added to
 +	  facilitate the identification of the osnoise source.
 +
 +	  The output will appear in the trace and trace_pipe files.
 +
 +	  To enable this tracer, echo in "osnoise" into the current_tracer
 +          file.
 +
  config MMIOTRACE
  	bool "Memory mapped IO tracing"
  	depends on HAVE_MMIOTRACE_SUPPORT && PCI
 diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
 index b28d3e5013cd..b1c47ccf4f73 100644
 --- a/kernel/trace/Makefile
 +++ b/kernel/trace/Makefile
 @@ -58,6 +58,7 @@ obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
  obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
  obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
  obj-$(CONFIG_HWLAT_TRACER) += trace_hwlat.o
 +obj-$(CONFIG_OSNOISE_TRACER) += trace_osnoise.o
  obj-$(CONFIG_NOP_TRACER) += trace_nop.o
  obj-$(CONFIG_STACK_TRACER) += trace_stack.o
  obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
 diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
 index 87588d1e24ca..b959c9ec9711 100644
 --- a/kernel/trace/trace.h
 +++ b/kernel/trace/trace.h
 @@ -44,6 +44,7 @@ enum trace_type {
  	TRACE_BLK,
  	TRACE_BPUTS,
  	TRACE_HWLAT,
 +	TRACE_OSNOISE,
  	TRACE_RAW_DATA,
  	TRACE_FUNC_REPEATS,
  
 @@ -297,7 +298,8 @@ struct trace_array {
  	struct array_buffer	max_buffer;
  	bool			allocated_snapshot;
  #endif
 -#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
 +#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \
 +	|| defined(CONFIG_OSNOISE_TRACER)
  	unsigned long		max_latency;
  #ifdef CONFIG_FSNOTIFY
  	struct dentry		*d_max_latency;
 @@ -445,6 +447,7 @@ extern void __ftrace_bad_type(void);
  		IF_ASSIGN(var, ent, struct bprint_entry, TRACE_BPRINT);	\
  		IF_ASSIGN(var, ent, struct bputs_entry, TRACE_BPUTS);	\
  		IF_ASSIGN(var, ent, struct hwlat_entry, TRACE_HWLAT);	\
 +		IF_ASSIGN(var, ent, struct osnoise_entry, TRACE_OSNOISE);\
  		IF_ASSIGN(var, ent, struct raw_data_entry, TRACE_RAW_DATA);\
  		IF_ASSIGN(var, ent, struct trace_mmiotrace_rw,		\
  			  TRACE_MMIO_RW);				\
 @@ -675,8 +678,8 @@ void update_max_tr_single(struct trace_array *tr,
  			  struct task_struct *tsk, int cpu);
  #endif /* CONFIG_TRACER_MAX_TRACE */
  
 -#if (defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)) && \
 -	defined(CONFIG_FSNOTIFY)
 +#if (defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \
 +	|| defined(CONFIG_OSNOISE_TRACER)) && defined(CONFIG_FSNOTIFY)
  #define LATENCY_FS_NOTIFY
  #endif
  
 diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h
 index 251c819cf0c5..158c0984b59b 100644
 --- a/kernel/trace/trace_entries.h
 +++ b/kernel/trace/trace_entries.h
 @@ -360,3 +360,28 @@ FTRACE_ENTRY(func_repeats, func_repeats_entry,
  		 __entry->count,
  		 FUNC_REPEATS_GET_DELTA_TS(__entry))
  );
 +
 +FTRACE_ENTRY(osnoise, osnoise_entry,
 +
 +	TRACE_OSNOISE,
 +
 +	F_STRUCT(
 +		__field(	u64,			noise		)
 +		__field(	u64,			runtime		)
 +		__field(	u64,			max_sample	)
 +		__field(	unsigned int,		hw_count	)
 +		__field(	unsigned int,		nmi_count	)
 +		__field(	unsigned int,		irq_count	)
 +		__field(	unsigned int,		softirq_count	)
 +		__field(	unsigned int,		thread_count	)
 +	),
 +
 +	F_printk("noise:%llu\tmax_sample:%llu\thw:%u\tnmi:%u\tirq:%u\tsoftirq:%u\tthread:%u\n",
 +		 __entry->noise,
 +		 __entry->max_sample,
 +		 __entry->hw_count,
 +		 __entry->nmi_count,
 +		 __entry->irq_count,
 +		 __entry->softirq_count,
 +		 __entry->thread_count)
 +);
 diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
 new file mode 100644
 index 000000000000..4e2c47dc4f19
 --- /dev/null
 +++ b/kernel/trace/trace_osnoise.c
 @@ -0,0 +1,1384 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * OS Noise Tracer: computes the OS Noise suffered by a running thread.
 + *
 + * Based on "hwlat_detector" tracer by:
 + *   Copyright (C) 2008-2009 Jon Masters, Red Hat, Inc. <jcm@redhat.com>
 + *   Copyright (C) 2013-2016 Steven Rostedt, Red Hat, Inc. <srostedt@redhat.com>
 + *   With feedback from Clark Williams <williams@redhat.com>
 + *
 + * And also based on the rtsl tracer presented on:
 + *  DE OLIVEIRA, Daniel Bristot, et al. Demystifying the real-time linux
 + *  scheduling latency. In: 32nd Euromicro Conference on Real-Time Systems
 + *  (ECRTS 2020). Schloss Dagstuhl-Leibniz-Zentrum fur Informatik, 2020.
 + *
 + * Copyright (C) 2021 Daniel Bristot de Oliveira, Red Hat, Inc. <bristot@redhat.com>
 + */
 +
 +#include <linux/kthread.h>
 +#include <linux/tracefs.h>
 +#include <linux/uaccess.h>
 +#include <linux/cpumask.h>
 +#include <linux/delay.h>
 +#include <linux/sched/clock.h>
 +#include <linux/sched.h>
 +#include "trace.h"
 +
 +#ifdef CONFIG_X86_LOCAL_APIC
 +#include <asm/trace/irq_vectors.h>
 +#undef TRACE_INCLUDE_PATH
 +#undef TRACE_INCLUDE_FILE
 +#endif /* CONFIG_X86_LOCAL_APIC */
 +
 +#include <trace/events/irq.h>
 +#include <trace/events/sched.h>
 +
 +#define CREATE_TRACE_POINTS
 +#include <trace/events/osnoise.h>
 +
 +static struct trace_array	*osnoise_trace;
 +
 +/*
 + * Default values.
 + */
 +#define BANNER			"osnoise: "
 +#define DEFAULT_SAMPLE_PERIOD	1000000			/* 1s */
 +#define DEFAULT_SAMPLE_RUNTIME	1000000			/* 1s */
 +
 +/*
 + * NMI runtime info.
 + */
 +struct osn_nmi {
 +	u64	count;
 +	u64	delta_start;
 +};
 +
 +/*
 + * IRQ runtime info.
 + */
 +struct osn_irq {
 +	u64	count;
 +	u64	arrival_time;
 +	u64	delta_start;
 +};
 +
 +/*
]
]

98/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40544
							output: 42
							thoughts: 979
						

Thoughts:
**Analyzing Tracepoint Registration and Error Handling**

Okay, so I'm looking at commit `bce29ac9ce0b` and how it handles tracepoint registration with `osnoise_arch_register`. The use of `goto` labels to unregister in reverse order on failure is interesting, a common pattern to ensure a clean rollback. This immediately makes me think of other instances where we see this kind of registration/unregistration logic.

Let's see, `kernel/trace/trace_events_synth.c` seems relevant. Right, `register_synth_event` also follows a similar strategy. If `register_trace_event` succeeds, it proceeds, but if `set_synth_event_print_fmt` fails *after* registration, it unregisters with `unregister_trace_event` before bailing out. Standard practice.

Now, let's turn to `kernel/trace/ftrace.c` and specifically `ftrace_pid_follow_fork`. Hold on a second... it *registers* `trace_sched_process_fork` and `trace_sched_process_free`, but it doesn't check the return values of these `register_*` functions! That's a potential problem. We are assuming they work?

Moving on, `kernel/trace/trace_events.c` and `register_pid_events` also looks like it's missing the error checking for the registration of `trace_prio_sched_switch`. Why are these return values not being checked? Is there an assumption being made about the underlying functions? Is it because they can never fail?

Now, let's consider `blk_register_tracepoints`. Ah, this is different, because there's `WARN_ON` after calling `register_trace_block_rq_insert`. That's because `register_trace_block_rq_insert` *can* fail, specifically with `-ENOMEM`. It makes sense to check for failure here.

Let's go back and examine `kernel/trace/trace_fprobe.c`. Right, in `enable_trace_fprobe` we have explicit error checking. The return value of `__register_trace_fprobe(tf)` is checked, and if it fails, it properly unregisters the previously registered probes in a loop. A comprehensive approach.

The discrepancy here is pretty glaring, now I'm thinking about searching for commits in `kernel/trace/` that removed these `WARN_ON` checks. It's possible that these functions were assumed to be infallible at one point, or that a change in the underlying mechanisms or usage patterns necessitated the removal of error checking. This warrants further investigation to understand why some registrations are checked and others aren't.



99/2 2026/08/31 21:27 tool git-log
0m Args:
map[CodeRegexp:WARN_ON.*register_trace PathPrefix:kernel/trace/ Since:10 years]

Results:
map[Output:]

100/2 2026/08/31 21:27 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 42163
							output: 43
							thoughts: 27
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing the Absence of Commits**

Well, this is interesting. The system reports *no* commits. That's a starting point, right? Means there's nothing immediately obvious in the repository's history that addresses the core issue. Time to dig deeper. I'm going to focus my search. I'm going to start looking for commits in the `kernel/trace/` directory that specifically address error handling related to `register_trace`. Given the importance of tracepoints, and the potential for delicate system interactions, a robust error-handling regime around tracepoint registration is crucial. I suspect there may have been a historical pattern to the handling that I can identify, or, perhaps, a recent regression that I can narrow down with the correct search terms. A focussed search on that sub-section should yield the right clues.



101/2 2026/08/31 21:28 tool git-log
0m Args:
map[CodeRegexp:if \(ret\).*unregister_trace PathPrefix:kernel/trace/ Since:10 years]

Results:
map[Output:]

102/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 42437
							output: 43
							thoughts: 34
						

Thoughts:
Okay, here's my interpretation of those thoughts, framed as my own, given my expertise:

**Examining Potential Memory Issues Related to Tracepoints**

Right, let's dive into some kernel code. My gut tells me there might be some interplay between tracepoints, memory allocation issues (specifically, ENOMEM errors), and the unregistration process. I need to get a better sense of how those pieces fit together, so I'm going to search through the commit history. My initial focus is going to be within the `block/` and `kernel/trace/` directories, since those areas seem most likely to be relevant given my understanding of the system. I'm going to look for commits that mention "tracepoint", which is a given, but then I'm also going to look for any mentions of "ENOMEM" – because that's a red flag for memory allocation failures – and also "unregister" – as that might be related to leaks or other cleanup problems. With this search, I should be able to get a quick overview of relevant areas in these source repositories and look at related commits.



103/2 2026/08/31 21:28 tool git-log
0m Args:
map[MessageRegexps:[tracepoint ENOMEM] PathPrefix:kernel/trace/ Since:10 years]

Results:
map[Output:1dd349ab74d2 tracing: Do not start benchmark on boot up
]

104/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 42780
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as requested, geared toward an expert audience, and written in the first person:

**Investigating `1dd349ab74d2`**

Alright, time to dive into `1dd349ab74d2`. My initial scan is always critical. I'm immediately running through a mental checklist: Is this a commit hash? A file ID? A process ID? The format definitely suggests something unique, potentially a cryptographic hash or identifier within a system. Given the context of our field, I'm leaning heavily towards it being a version-control identifier.

First, I need to know where I can actually *find* this. What system am I working within? Is this a local sandbox, a production environment, or something in between? Without that context, this is just an alphanumeric string. My priority is establishing the scope. Is there a relevant codebase, a log file, an orchestration system, or a database I should reference?

Once I know where it lives, I’ll need the appropriate tools to look it up. This may involve a `git log` lookup, a database query, or a search through some specific log files. I'm going to determine what my search syntax will need to be to avoid extraneous results and hone in on exactly what I'm looking for.

I'm making a mental note that if it *is* a Git commit hash, I'll need to consider branching strategies, rebasing, merges, and potential conflicts. If it's something else, I'll tailor my expectations accordingly. I'm already anticipating potential dead ends; sometimes these IDs are misleading or refer to data that's been removed or purged. I'm ready to handle that and adjust my strategy.

My goal is to uncover the relevant metadata. I want to know when it was created or modified, what it’s associated with, and, most importantly, *why* it's relevant to what I'm currently working on. Is this a bug fix? A feature implementation? A security patch? I need the context.



105/2 2026/08/31 21:28 tool git-show
0m Args:
map[Commit:1dd349ab74d2]

Results:
map[Output:commit 1dd349ab74d278cee50fc24dc26c023f3b149642
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Mon Nov 28 13:17:25 2016 -0500

    tracing: Do not start benchmark on boot up
    
    Trace events are enabled very early on boot up via the boot command line
    parameter. The benchmark tool creates a new thread to perform the trace
    event benchmarking. But at start up, it is called before scheduling is set
    up and because it creates a new thread before the init thread is created,
    this crashes the kernel.
    
    Have the benchmark fail to register when started via the kernel command
    line.
    
    Also, since the registering of a tracepoint now can handle failure cases,
    return -ENOMEM instead of warning if the thread cannot be created.
    
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
index f76d0416dd83..2bc7dc3e8ff8 100644
--- a/kernel/trace/trace_benchmark.c
+++ b/kernel/trace/trace_benchmark.c
@@ -166,9 +166,18 @@ static int benchmark_event_kthread(void *arg)
  */
 int trace_benchmark_reg(void)
 {
+	if (system_state != SYSTEM_RUNNING) {
+		pr_warning("trace benchmark cannot be started via kernel command line\n");
+		return -EBUSY;
+	}
+
 	bm_event_thread = kthread_run(benchmark_event_kthread,
 				      NULL, "event_benchmark");
-	WARN_ON(!bm_event_thread);
+	if (!bm_event_thread) {
+		pr_warning("trace benchmark failed to create kernel thread\n");
+		return -ENOMEM;
+	}
+
 	return 0;
 }
 
@@ -183,6 +192,7 @@ void trace_benchmark_unreg(void)
 		return;
 
 	kthread_stop(bm_event_thread);
+	bm_event_thread = NULL;
 
 	strcpy(bm_str, "START");
 	bm_total = 0;
]

106/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 43880
							output: 41
							thoughts: 78
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own mental processing:

**Analyzing a Tracepoint Registration Change**

Alright, so this commit's interesting. It's essentially saying, "Hey, we've updated the tracepoint registration process to be more robust, specifically by handling memory allocation failures." Before, if we couldn't create a thread during tracepoint registration, it would just log a warning. Now, we're returning `-ENOMEM`, a proper error code signaling a memory allocation problem, from the `register_trace_*` function. Good. That's a definite improvement. Less vague, more actionable.

Now, I need to dig into how `register_trace_*` actually works. My immediate thought is, how is this memory allocation happening and why is it happening during registration? I remember from the code that these `register_trace_*` functions all ultimately call `tracepoint_probe_register`. So, my next step is to look at the implementation of *that* function and see what's happening under the hood. I expect that's where the thread creation, or at least the logic surrounding it, is happening. I need to understand the implications of this change on the overall registration flow.



107/2 2026/08/31 21:28 tool git-log
0m Args:
map[CodeRegexp:tracepoint_probe_register PathPrefix:kernel/trace/ Since:10 years]

Results:
map[Output:e3d6e1b9a34c tracing: tprobe-events: Support multiple tprobes on the same tracepoint
57a7e6de9e30 tracing/fprobe: Support raw tracepoints on future loaded modules
d4dfc5700e86 bpf: pass whole link instead of prog when triggering raw tracepoint
e2d0d7b2f42d tracing/probes: Add tracepoint support on fprobe_events
3207d0459ef3 user_events: Add basic perf and eBPF support
7f5a08c79df3 user_events: Add minimal support for trace_event into ftrace
9913d5745bd7 tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing
c4f6699dfcb8 bpf: introduce BPF_RAW_TRACEPOINT
]

108/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44483
							output: 30
							thoughts: 28
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Kernel Tracepoint Dive**

Alright, time to get to the heart of this. My initial instinct is to go digging in `kernel/trace/tracepoint.c`. Wait a second… that's almost right, just a quick mental correction. It's actually just `kernel/tracepoint.c`. No big deal, just a minor typo in my mental filesystem, I am so used to the `trace` subdirectory. Let's get to work.



109/2 2026/08/31 21:28 tool git-log
0m Args:
map[PathPrefix:kernel/tracepoint.c Since:10 years]

Results:
map[Output:fad217e16fde tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()
323bbfcf1ef8 Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
a46023d5616e tracing: Guard __DECLARE_TRACE() use of __DO_TRACE_CALL() with SRCU-fast
30c94bbceeda tracepoint: Print the function symbol when tracepoint_debug is set
2e8a12b82c40 tracing: Fix syscall tracepoint use-after-free
a9cfb8778c43 tracing: Introduce tracepoint extended structure
e53244e2c893 tracepoint: Remove SRCU protection
4a8840af5f53 tracepoints: Use new static branch API
]

110/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44924
							output: 24
							thoughts: 38
						

Thoughts:
Okay, here's my interpretation of that thought process, as if I were having it:

**Examining a Tracepoint Issue**

Alright, time to dig into this. Let's see... the commit hash is `fad217e16fde`. That suggests a very specific fix or investigation is underway. The commit message itself, "tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()", is dense but informative. My understanding is it relates to a balancing issue with a registration function in the tracepoint system, specifically when `func_add()` fails within `tracepoint_add_func()`. This sounds like a potential resource leak or an incorrect state transition within the tracepoint framework. This is a common situation with tracepoints, when function addition fails, you often need to consider memory cleanup or other resource management. I will now start going through the code.



111/2 2026/08/31 21:28 tool git-show
0m Args:
map[Commit:fad217e16fde]

Results:
map[Output:commit fad217e16fded7f3c09f8637b0f6a224d58b5f2e
Author: David Carlier <devnexen@gmail.com>
Date:   Mon Apr 13 20:06:01 2026 +0100

    tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()
    
    When a tracepoint goes through the 0 -> 1 transition, tracepoint_add_func()
    invokes the subsystem's ext->regfunc() before attempting to install the
    new probe via func_add(). If func_add() then fails (for example, when
    allocate_probes() cannot allocate a new probe array under memory pressure
    and returns -ENOMEM), the function returns the error without calling the
    matching ext->unregfunc(), leaving the side effects of regfunc() behind
    with no installed probe to justify them.
    
    For syscall tracepoints this is particularly unpleasant: syscall_regfunc()
    bumps sys_tracepoint_refcount and sets SYSCALL_TRACEPOINT on every task.
    After a leaked failure, the refcount is stuck at a non-zero value with no
    consumer, and every task continues paying the syscall trace entry/exit
    overhead until reboot. Other subsystems providing regfunc()/unregfunc()
    pairs exhibit similarly scoped persistent state.
    
    Mirror the existing 1 -> 0 cleanup and call ext->unregfunc() in the
    func_add() error path, gated on the same condition used there so the
    unwind is symmetric with the registration.
    
    Fixes: 8cf868affdc4 ("tracing: Have the reg function allow to fail")
    Cc: stable@vger.kernel.org
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Link: https://patch.msgid.link/20260413190601.21993-1-devnexen@gmail.com
    Signed-off-by: David Carlier <devnexen@gmail.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 91905aa19294..dffef52a807b 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -300,6 +300,8 @@ static int tracepoint_add_func(struct tracepoint *tp,
 			lockdep_is_held(&tracepoints_mutex));
 	old = func_add(&tp_funcs, func, prio);
 	if (IS_ERR(old)) {
+		if (tp->ext && tp->ext->unregfunc && !static_key_enabled(&tp->key))
+			tp->ext->unregfunc();
 		WARN_ON_ONCE(warn && PTR_ERR(old) != -ENOMEM);
 		return PTR_ERR(old);
 	}
]

112/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 45958
							output: 43
							thoughts: 559
						

Thoughts:
**My Thoughts on Handling Tracepoint Registration Errors**

Okay, so this commit addresses a memory and state leak in `tracepoint_add_func` when `func_add()` fails with `-ENOMEM`. Essentially, it's another instance of the "missing rollback on `-ENOMEM`" problem. I've seen this before, and it looks like `blk_register_tracepoints()` in `kernel/trace/blktrace.c` is the culprit, using `WARN_ON(ret)` for error checking on the registration functions. That's a classic mistake.

The correct approach, as I see it, is to return the error code, unregister any successfully registered tracepoints, and propagate the error up. I need to make sure I get this right.

The prompt specifically wants me to outline the common idioms, locking rules, and patterns I should be following based on past similar fixes. Right, let's break it down:

The established pattern, especially when dealing with multiple tracepoint or probe registrations, is pretty clear. I should:

1.  Meticulously check the return value of *every* registration function (e.g., `register_trace_*()`). No shortcuts.
2.  If any registration fails, immediately use `goto` labels to jump to a dedicated error handling block. This avoids messy nested `if` statements.
3.  Within that error handling block, unregister the tracepoints in *reverse* order of their registration. It's crucial for maintaining consistency.
4.  Then, I propagate the specific error code up the call stack so the caller can handle it appropriately.
5.  And finally, I will never use `WARN_ON` or `WARN_ON_ONCE` for error conditions that are expected, like `-ENOMEM` from tracepoint registration. This can trigger kernel panics if `panic_on_warn` is set, and that's exactly what we want to avoid.

I've taken a look around in `kernel/trace/` and `block/` to see what past fixes look like. It looks like:

*   `aca0cd1bf165` "tracing/fprobe: Roll back on enable\_trace\_fprobe() failure"
*   `bce29ac9ce0b` "trace: Add osnoise tracer" demonstrates the `goto` pattern for reverse unregistration.
*   `fad217e16fde` "tracepoint: balance regfunc() on func\_add() failure in tracepoint\_add\_func()" shows proper rollback for tracepoint registration failures.
*   `1dd349ab74d2` "tracing: Do not start benchmark on boot up" is a good example of removing `WARN_ON` and returning `-ENOMEM` instead.

A quick search for `WARN_ON` removals related to tracepoints in those areas should provide even more confidence in the fix. This should be a straightforward implementation of a well-understood pattern.



113/2 2026/08/31 21:28 tool git-log
0m Args:
map[MessageRegexps:[WARN_ON tracepoint] PathPrefix:kernel/trace/ Since:10 years]

Results:
map[Output:3880cdbed1c4 bpf: Fix WARN() in get_bpf_raw_tp_regs
0878355b51f5 tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails
9913d5745bd7 tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing
f27107fa20ad tracing/irqsoff: Handle preempt_count for different configs
]

114/2 2026/08/31 21:28 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 47332
							output: 27
							thoughts: 40
						

Thoughts:
Okay, let's dive into this commit, `0878355b51f5`, specifically the one dealing with `tracing/osnoise`. It looks like we're addressing a crucial error case. I'm immediately drawn to the title: "Properly unhook events if `start_per_cpu_kthreads()` fails."

My initial thought is that this is likely a subtle but potentially critical bug fix. The fact that we're talking about *unhooking* events suggests that there's a mechanism in place to register these events in the first place, likely in a per-CPU context, and that this registration needs to be gracefully undone if something goes wrong during the initialization of those per-CPU kernel threads.

Failing `start_per_cpu_kthreads()` is a serious error. If we can't spin up those threads, then whatever tracing or event collection functionality depends on them is rendered unusable. The concern here seems to be about resource cleanup, specifically making sure that if this initialization fails, we don't leave any dangling pointers or orphaned events that could lead to memory leaks, incorrect data, or even system instability. I'm picturing a situation where events might get registered, but then those threads never get started to actually *process* them. This could be problematic, especially with regards to how it handles the cleanup, which should be robust and thorough. We wouldn't want to create any silent failures that corrupt other systems.

So, the focus here is on ensuring that everything is cleaned up properly if `start_per_cpu_kthreads()` bails out. This is good defensive programming, and exactly the kind of detail you need to get right in kernel development. It's about protecting against a failure scenario and maintaining the overall integrity of the tracing subsystem. Good stuff.



115/2 2026/08/31 21:29 tool git-show
0m Args:
map[Commit:0878355b51f5]

Results:
map[Output:commit 0878355b51f5f26632e652c848a8e174bb02d22d
Author: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
Date:   Sun Jan 9 18:34:59 2022 +0300

    tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails
    
    If start_per_cpu_kthreads() called from osnoise_workload_start() returns
    error, event hooks are left in broken state: unhook_irq_events() called
    but unhook_thread_events() and unhook_softirq_events() not called, and
    trace_osnoise_callback_enabled flag not cleared.
    
    On the next tracer enable, hooks get not installed due to
    trace_osnoise_callback_enabled flag.
    
    And on the further tracer disable an attempt to remove non-installed
    hooks happened, hitting a WARN_ON_ONCE() in tracepoint_remove_func().
    
    Fix the error path by adding the missing part of cleanup.
    While at this, introduce osnoise_unhook_events() to avoid code
    duplication between this error path and normal tracer disable.
    
    Link: https://lkml.kernel.org/r/20220109153459.3701773-1-nikita.yushchenko@virtuozzo.com
    
    Cc: stable@vger.kernel.org
    Fixes: bce29ac9ce0b ("trace: Add osnoise tracer")
    Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 4719a848bf17..36d9d5be08b4 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -2122,6 +2122,13 @@ static int osnoise_hook_events(void)
 	return -EINVAL;
 }
 
+static void osnoise_unhook_events(void)
+{
+	unhook_thread_events();
+	unhook_softirq_events();
+	unhook_irq_events();
+}
+
 /*
  * osnoise_workload_start - start the workload and hook to events
  */
@@ -2154,7 +2161,14 @@ static int osnoise_workload_start(void)
 
 	retval = start_per_cpu_kthreads();
 	if (retval) {
-		unhook_irq_events();
+		trace_osnoise_callback_enabled = false;
+		/*
+		 * Make sure that ftrace_nmi_enter/exit() see
+		 * trace_osnoise_callback_enabled as false before continuing.
+		 */
+		barrier();
+
+		osnoise_unhook_events();
 		return retval;
 	}
 
@@ -2185,9 +2199,7 @@ static void osnoise_workload_stop(void)
 
 	stop_per_cpu_kthreads();
 
-	unhook_irq_events();
-	unhook_softirq_events();
-	unhook_thread_events();
+	osnoise_unhook_events();
 }
 
 static void osnoise_tracer_start(struct trace_array *tr)
]

116/2 2026/08/31 21:29 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 48732
							output: 43
							thoughts: 346
						

Thoughts:
**Analyzing a Recent Kernel Commit**

Okay, this commit, `0878355b51f5`, is remarkably similar to the issue we were dealing with! The description nails it: a failed `start_per_cpu_kthreads()` call from `osnoise_workload_start()` leaves the event hooks in a broken state. Consequently, a subsequent attempt to disable the tracer triggers the `WARN_ON_ONCE()` in `tracepoint_remove_func()` – a familiar error.

Essentially, it's the exact scenario we were dealing with: an attempt to unregister a tracepoint that wasn't properly registered results in `-ENOENT` from `tracepoint_remove_func()`, which then triggers that `WARN_ON_ONCE`. The pattern is clear now:

1.  When you're registering multiple tracepoints or event hooks, and one fails, you *must* unregister any that succeeded.
2.  Leaving them registered after a failure creates a broken state.
3.  Later, a tracer stop unconditionally attempts to unregister everything.
4.  Attempting to unregister a tracepoint that isn't there leads to the `WARN_ON_ONCE()` inside `tracepoint_remove_func()`.
5.  The solution is a proper rollback mechanism during registration – maybe using `goto` labels to unregister in reverse order – and propagate errors up the call stack so the initialization fails cleanly rather than leaving the system in a half-baked state.

I should probably confirm that `WARN_ON_ONCE` in `tracepoint_remove_func` is what the commit is referring to by looking at the source code in `kernel/tracepoint.c`. Always good to double-check the details.



117/2 2026/08/31 21:29 tool git-log
0m Args:
map[CodeRegexp:tracepoint_remove_func PathPrefix:kernel/tracepoint.c Since:10 years]

Results:
map[Output:]

118/2 2026/08/31 21:29 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49509
							output: 32
							thoughts: 28
						

Thoughts:
Here's my thought process, summarized as you requested:

**Navigating Kernel Code: A Potential Location for `tracepoint_remove_func`**

Okay, so I'm thinking about where `tracepoint_remove_func` might actually reside within the kernel source. My first hunch is that it's likely nestled within `kernel/tracepoint.c`. That seems like a logical place, given its function. Now, I'm going to quickly confirm this suspicion. Time to whip out a `grep` and see if my intuition holds. That should give me a definitive answer pretty fast.



119/2 2026/08/31 21:29 tool grepper
0m Args:
map[Expression:tracepoint_remove_func PathPrefix:kernel/tracepoint.c]

Results:
map[Output:kernel/tracepoint.c=286=static int tracepoint_add_func(struct tracepoint *tp,
--
kernel/tracepoint.c-360- */
kernel/tracepoint.c:361:static int tracepoint_remove_func(struct tracepoint *tp,
kernel/tracepoint.c-362-		struct tracepoint_func *func)
--
kernel/tracepoint.c=507=int tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data)
--
kernel/tracepoint.c-514-	tp_func.data = data;
kernel/tracepoint.c:515:	ret = tracepoint_remove_func(tp, &tp_func);
kernel/tracepoint.c-516-	mutex_unlock(&tracepoints_mutex);
]

120/2 2026/08/31 21:29 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49907
							output: 34
							thoughts: 21
						

Thoughts:
Here's my summary, as though I'm reading and thinking about the code:

**Diving into `tracepoint_remove_func`**

Okay, let's get into the heart of this. I'm going to pull up `tracepoint_remove_func` from `kernel/tracepoint.c`. I need to understand how we're actually *removing* a function from a tracepoint, not just how we're attaching it. This is crucial for cleanup, avoiding dangling pointers, and generally maintaining system integrity after a tracepoint is no longer needed or if a module is unloaded. The details in *this* function, whatever they might be, have the potential to make or break the design's stability. I need to be sure that the removal is handled correctly for all the possible cases. I expect to be reading very carefully.



121/2 2026/08/31 21:29 tool read-file
0m Args:
map[File:kernel/tracepoint.c FirstLine:361 LineCount:20]

Results:
map[Contents: 361:	static int tracepoint_remove_func(struct tracepoint *tp,
 362:			struct tracepoint_func *func)
 363:	{
 364:		struct tracepoint_func *old, *tp_funcs;
 365:	
 366:		tp_funcs = rcu_dereference_protected(tp->funcs,
 367:				lockdep_is_held(&tracepoints_mutex));
 368:		old = func_remove(&tp_funcs, func);
 369:		if (WARN_ON_ONCE(IS_ERR(old)))
 370:			return PTR_ERR(old);
 371:	
 372:		if (tp_funcs == old)
 373:			/* Failed allocating new tp_funcs, replaced func with stub */
 374:			return 0;
 375:	
 376:		switch (nr_func_state(tp_funcs)) {
 377:		case TP_FUNC_0:		/* 1->0 */
 378:			/* Removed last function */
 379:			if (tp->ext && tp->ext->unregfunc && static_key_enabled(&tp->key))
 380:				tp->ext->unregfunc();
]

122/2 2026/08/31 21:29 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 50482
							output: 796
							thoughts: 1023
						

Thoughts:
**My Analysis of the Tracepoint Registration Issue**

Okay, so I've confirmed that `WARN_ON_ONCE(IS_ERR(old))` is present, and `func_remove` returns `-ENOENT` if the function isn't found, which is expected. The core of the problem boils down to a failure to handle potential errors when registering multiple tracepoints. The `register_trace_*` functions *can* fail, typically due to memory pressure (`-ENOMEM`).

My findings are as follows:

1.  The root cause is a missing error-handling mechanism when registering multiple tracepoints.  We don't adequately handle the scenarios where `register_trace_*` might fail, for instance, due to memory allocation issues within the probe array.
2.  The original approach used `WARN_ON(ret)` to catch registration errors, but this is clearly flawed, as it can lead to a kernel panic if `panic_on_warn` is enabled, which is unacceptable.
3.  Moreover, ignoring the error leaves tracepoints in a partially registered state. Later, when the tracing is stopped, the system attempts to unregister *all* tracepoints unconditionally. This then results in an attempt to unregister a tracepoint that wasn't actually registered, leading to `tracepoint_remove_func()` returning `-ENOENT` and thus triggering the now-infamous `WARN_ON_ONCE`.
4.  I see similar issues addressed and resolved in the past. Notable examples include commits like `0878355b51f5` ("tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails"), `aca0cd1bf165` ("tracing/fprobe: Roll back on enable_trace_fprobe() failure"), and `1dd349ab74d2` ("tracing: Do not start benchmark on boot up"). This pattern is familiar, so I'm confident we're on the right track.
5.  Based on my review of the codebase, I can confidently say that the established idiom for fixing this is clear. We need to:
    *   Thoroughly check the return value of *each* `register_trace_*` call.
    *   If a registration fails, *never* use `WARN_ON`. Instead, employ `goto` labels to jump to an error-handling block.
    *   Within the error-handling block, unregister the tracepoints that were successfully registered. It's *crucial* to unregister them in the *reverse* order of registration, to ensure everything's properly rolled back.
    *   Finally, return the appropriate error code (like `-ENOMEM`) and, very importantly, propagate that error up the call stack, so the setup sequence fails gracefully and resources are cleaned up.

I double-checked the locking rules, specifically the `blk_register_tracepoints()` function. I can see that it's called from `get_probe_ref()`, which holds `blk_probe_mutex`. The code here looks correct, and the proposed fix addresses the issues related to tracepoint registration and unregistration outside of this mutex.

Now, to summarize this for the final reply, here's what I'm seeing as the key idiomatic patterns:

**Key Takeaways**

*   **Error Checking without `WARN_ON`:** Tracepoint registration functions are expected to fail, and doing so is not an error in the sense that `WARN_ON` is expected. `WARN_ON()` is an anti-pattern for handling these expected failures and will cause an unrecoverable kernel panic when `panic_on_warn` is enabled. Past commits like `1dd349ab74d2` ("tracing: Do not start benchmark on boot up") show that returning `-ENOMEM` is preferred.
*   **Symmetric Rollback on Failure:** Whenever a function registers multiple tracepoints or hooks, the code must implement a rollback strategy when a registration fails. Use `goto` labels to unregister successfully registered tracepoints in reverse order of registration. Commit examples include `aca0cd1bf165` ("tracing/fprobe: Roll back on enable_trace_fprobe() failure") and `bce29ac9ce0b` ("trace: Add osnoise tracer").
*   **Preventing `WARN_ON_ONCE` in `tracepoint_remove_func`:** Leaving tracepoints in a partially registered state, then trying to unregister all of them unconditionally later, results in `tracepoint_remove_func()` failing with `-ENOENT`, which triggers `WARN_ON_ONCE`. Commit `0878355b51f5` ("tracing/osnoise: Properly unhook events if start_


123/1 2026/08/31 21:29 action kernel-scratch-checkouter
0m Results:
map[KernelScratchSrc:/app/workdir/cache/tmp/tmp526336236]

124/1 2026/08/31 21:29 loop
28m
125/2 2026/08/31 21:29 iteration 0
28m
126/3 2026/08/31 21:29 agent patch-generator
2m Model:
core

Instruction:
You are an experienced Linux kernel developer tasked with creating a fix for a kernel bug.
You will be given a crash report, an initial explanation of the root cause done by another
kernel expert, and a summary of how similar bugs were fixed in the past.

Use the codeeditor tool to do code edits.
Note: you will not see your changes when looking at the code using codesearch tools.
Use the patch-diff tool to review the modifications you applied.

Your final reply should contain explanation of what you did in the patch and why
(details not present in the initial explanation of the bug).

Your fix must not just prevent the given crash, but also be the best fix for the underlying
root cause from the software engineering point of view. There can be several ways to fix the
same bug. Consider alternatives, and pick the best one. For example, additional checks may be
added at different locations/functions, it's usually better to place them earlier in the
execution to avoid multiple checks at various locations later.

Frequently the same coding mistake is done in several locations in the source code.
Check if your fix should be extended/applied to similar cases around to fix other similar bugs.
But don't go too wide, don't try to fix problems kernel-wide, fix similar issues
in the same file only.


If you are changing post-conditions of a function, consider all callers of the functions,
and if they need to be updated to handle new post-conditions. For example, if you make
a function that previously never returned a NULL, return NULL, consider if callers
need to be updated to handle NULL return value.


If you will end up removing the WARN_ON macro because the condition can legitimately happen,
add a pr_err/dev_err/... (whatever is the macro for printing runtime errors used in the file)
call that logs that the unlikely condition has happened. The pr_err/dev_err/... message
must not include "WARNING" nor "BUG" strings.


Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash that corresponds to the bug is:

R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>


The explanation of the root cause of the bug is:

The root cause of the crash is that `blk_register_tracepoints()` uses `WARN_ON(ret)` to check the return values of `register_trace_block_*()` functions. These tracepoint registration functions allocate memory for the probe array and can fail with `-ENOMEM` (e.g., under memory pressure or fault injection, as seen in the syzbot report). When they fail, `WARN_ON()` triggers a kernel panic if `panic_on_warn` is set.

Furthermore, `blk_register_tracepoints()` currently ignores the error and continues, leaving the tracepoints in a partially registered state. Later, when tracing is stopped, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. Unregistering a tracepoint that was not successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers another `WARN_ON_ONCE` inside `tracepoint_remove_func()`.

To fix this, we need to properly handle the registration failures by returning the error, unregistering the successfully registered tracepoints, and propagating the error up the call stack to fail the blktrace setup.

### Fix Details

1. **Change `blk_register_tracepoints()` to return an `int` and handle errors:**
   Instead of `WARN_ON(ret)`, check the return value of each `register_trace_*()` call. If it fails, use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error.

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		return ret;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto err_issue;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto err_merge;
        // ... (do this for all 18 tracepoints) ...
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto err_rq_remap;
	return 0;

err_rq_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
// ... (unregister labels in reverse order) ...
err_merge:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
err_issue:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	return ret;
}
```

2. **Propagate the error through `get_probe_ref()`:**
```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

3. **Propagate the error through `blk_trace_setup_finalize()`:**
```c
static int blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)
{
	int ret;
        // ... existing code ...
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
}
```

4. **Handle the error in the callers of `blk_trace_setup_finalize()`:**
   In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, check the return value of `blk_trace_setup_finalize()`. If it fails, clean up the allocated `bt` and return the error:
```c
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
```

5. **Handle the error in `blk_trace_setup_queue()`:**
```c
static int blk_trace_setup_queue(struct request_queue *q,
				 struct block_device *bdev)
{
        // ... existing code ...
	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt:
	blk_trace_free(q, bt);
	return ret;
}
```


Historical context on how similar bugs were fixed in the past:

Based on the research into how similar bugs were addressed in the kernel (particularly within the tracing subsystem), the proposed fix strategy aligns perfectly with established kernel idioms and past fixes. 

Here is a summary of the findings, common patterns, and locking rules that should be followed when writing the fix:

### 1. Removing `WARN_ON` for Expected Errors
Tracepoint registration functions (e.g., `register_trace_*()`) can legitimately fail, most commonly with `-ENOMEM` when allocating memory for the probe array. Using `WARN_ON()` to handle these expected failures is an anti-pattern because it will crash the kernel if `panic_on_warn` is enabled (which is common in testing environments like syzbot). 
* **Prior Art:** Commit `1dd349ab74d2` ("tracing: Do not start benchmark on boot up") explicitly removed a `WARN_ON` on tracepoint setup failure, noting that registration can handle failure cases and should simply return `-ENOMEM`.

### 2. Symmetric Rollback via `goto` Labels
When a function registers multiple tracepoints sequentially, it must implement a symmetric rollback if any registration fails partway through. The standard kernel idiom is to use `goto` labels to unregister the successfully registered tracepoints in the **reverse order** of their registration.
* **Prior Art:** 
  * Commit `aca0cd1bf165` ("tracing/fprobe: Roll back on enable_trace_fprobe() failure") fixed a similar issue where failing partway through left events half-enabled. It introduced a rollback path to unregister all previously registered probes.
  * Commit `bce29ac9ce0b` ("trace: Add osnoise tracer") demonstrates the exact `goto` label pattern for registering/unregistering multiple tracepoints in `osnoise_arch_register()`.

### 3. Preventing Secondary `WARN_ON_ONCE` in Unregistration
If a rollback is not performed, the subsystem is left in a partially initialized state. Later, when the tracer is stopped, it will unconditionally attempt to unregister all tracepoints. Unregistering a tracepoint that was never successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers a secondary `WARN_ON_ONCE`.
* **Prior Art:** Commit `0878355b51f5` ("tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails") fixed an identical bug where failing to clean up hooks on an error path led to a `WARN_ON_ONCE()` in `tracepoint_remove_func()` during tracer disablement.

### 4. Error Propagation and Locking Rules
The error must be propagated up the call stack to ensure the setup fails gracefully. 
* In `get_probe_ref()`, the `blk_probe_mutex` is held. If `blk_register_tracepoints()` fails, you must decrement the `blk_probes_ref` counter before unlocking the mutex, which your proposed fix correctly does.
* In the callers (`blk_trace_setup_finalize()` and `blk_trace_setup_queue()`), propagating the error and cleaning up allocated resources (like `blk_trace_free(q, bt)`) is the correct and expected behavior to prevent memory leaks.

**Conclusion:**
Your proposed fix strategy is completely correct. You should proceed with changing `blk_register_tracepoints()` to return an `int`, replacing the `WARN_ON()` checks with standard `if (ret) goto err_*` blocks for reverse-order unregistration, and propagating the error up through `get_probe_ref()` and the blktrace setup functions.




Reply:
The crash occurred because `blk_register_tracepoints()` used `WARN_ON(ret)` on `register_trace_*()` calls. Tracepoint registration functions allocate memory for probe arrays and can legitimately fail with `-ENOMEM` (e.g. under memory pressure or fault injection). Using `WARN_ON()` in this situation triggered kernel panics when `panic_on_warn` was set. Furthermore, ignoring the return value left tracepoints in a partially registered state, leading to subsequent warnings or errors during unregistration.

### Changes Made
1. **Error handling and rollback in `blk_register_tracepoints()`**:
   - Changed `blk_register_tracepoints()` to return an `int`.
   - Removed `WARN_ON(ret)` for all 18 tracepoints.
   - Added sequential error checks and a symmetric `goto` rollback path that unregisters previously registered tracepoints in reverse order and invokes `tracepoint_synchronize_unregister()` before returning the error code.

2. **Reference counter handling in `get_probe_ref()`**:
   - Changed `get_probe_ref()` to return an `int`.
   - If `blk_register_tracepoints()` fails when initializing the first probe reference (`blk_probes_ref == 1`), `blk_probes_ref` is decremented back to 0 before releasing `blk_probe_mutex` and propagating the error.

3. **Error propagation in `blk_trace_setup_finalize()`**:
   - Changed `blk_trace_setup_finalize()` to return an `int`.
   - Called `get_probe_ref()` before assigning `rcu_assign_pointer(q->blk_trace, bt)`.
   - Propagated the error code to the caller.

4. **Resource cleanup in setup callers**:
   - In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, checked the return value of `blk_trace_setup_finalize()`. If setup fails, freed the allocated `blk_trace` structure using `blk_trace_free(q, bt)` and released debugfs locks before returning the error.
   - In `blk_trace_setup_queue()`, checked `get_probe_ref()` before assigning `q->blk_trace`, jumping to `free_bt` on failure.

127/4 2026/08/31 21:29 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 8351
							output: 75
							thoughts: 66
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Diving into blktrace.c**

Okay, let's get right to it. I need to understand the current implementation of `blktrace` – the go-to file is obviously `kernel/trace/blktrace.c`. My plan is to start with a targeted inspection. I'll use `read-file` to zero in on the key areas. I want to look closely at the code around line 492, then jump down to around line 1332, focusing on the relevant function calls within this file, to quickly grasp its core mechanics and data flow. This approach should give me a solid high-level understanding of what's going on quickly.



128/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:480 LineCount:50]

Results:
map[Contents: 480:		} else {
 481:			debugfs_remove(bt->dir);
 482:		}
 483:		free_percpu(bt->sequence);
 484:		free_percpu(bt->msg_data);
 485:		kfree(bt);
 486:	}
 487:	
 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
 495:	
 496:	static void put_probe_ref(void)
 497:	{
 498:		mutex_lock(&blk_probe_mutex);
 499:		if (!--blk_probes_ref)
 500:			blk_unregister_tracepoints();
 501:		mutex_unlock(&blk_probe_mutex);
 502:	}
 503:	
 504:	static int blk_trace_start(struct blk_trace *bt)
 505:	{
 506:		if (bt->trace_state != Blktrace_setup &&
 507:		    bt->trace_state != Blktrace_stopped)
 508:			return -EINVAL;
 509:	
 510:		blktrace_seq++;
 511:		smp_mb();
 512:		bt->trace_state = Blktrace_running;
 513:		raw_spin_lock_irq(&running_trace_lock);
 514:		list_add(&bt->running_list, &running_trace_list);
 515:		raw_spin_unlock_irq(&running_trace_lock);
 516:		trace_note_time(bt);
 517:	
 518:		return 0;
 519:	}
 520:	
 521:	static int blk_trace_stop(struct blk_trace *bt)
 522:	{
 523:		if (bt->trace_state != Blktrace_running)
 524:			return -EINVAL;
 525:	
 526:		bt->trace_state = Blktrace_stopped;
 527:		raw_spin_lock_irq(&running_trace_lock);
 528:		list_del_init(&bt->running_list);
 529:		raw_spin_unlock_irq(&running_trace_lock);
]

129/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1300 LineCount:80]

Results:
map[Contents:1300:	 * blk_add_driver_data - Add binary message with driver-specific data
1301:	 * @rq:		io request
1302:	 * @data:	driver-specific data
1303:	 * @len:	length of driver-specific data
1304:	 *
1305:	 * Description:
1306:	 *     Some drivers might want to write driver-specific data per request.
1307:	 *
1308:	 **/
1309:	void blk_add_driver_data(struct request *rq, void *data, size_t len)
1310:	{
1311:		struct blk_trace *bt;
1312:	
1313:		rcu_read_lock();
1314:		bt = rcu_dereference(rq->q->blk_trace);
1315:		if (likely(!bt)) {
1316:			rcu_read_unlock();
1317:			return;
1318:		}
1319:	
1320:		__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0,
1321:					BLK_TA_DRV_DATA, 0, len, data,
1322:					blk_trace_request_get_cgid(rq));
1323:		rcu_read_unlock();
1324:	}
1325:	EXPORT_SYMBOL_GPL(blk_add_driver_data);
1326:	
1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
1377:		unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
1378:		unregister_trace_block_plug(blk_add_trace_plug, NULL);
1379:		unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
]

130/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 10890
							output: 114
							thoughts: 55
						

Thoughts:
Here's my take on the kernel tracing code, specifically `kernel/trace/blktrace.c`:

**Deep Dive into `blktrace.c` - Unregistration and Setup**

Alright, let's get into the nitty-gritty of how block trace points work. I need to understand how the system unregisters and sets up these trace points, especially around `blk_unregister_tracepoints` and the setup functions. I'm focusing on the sections of the code spanning roughly lines 550 to 700 and then a bit later, from 1900 to 2150. These areas likely contain the core logic for managing the lifecycle of these trace points. I'm expecting to find details about cleanup procedures when the tracing is stopped, memory management related to the trace buffer, and interactions with other kernel subsystems. I'll be looking for how the data structures are initialized, linked, and eventually freed. More than likely I will find function calls to the general kernel trace points interface. I'm hoping to confirm my understanding of how tracing is enabled, disabled, and how the resources associated with tracing blocks are managed during their lifecycle. I'll need to pay close attention to potential race conditions and locking mechanisms. I'll be looking for design patterns that are common in this kind of kernel module. The goal is to fully grasp the unregistration and setup sequence.



131/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1370 LineCount:60]

Results:
map[Contents:1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
1377:		unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
1378:		unregister_trace_block_plug(blk_add_trace_plug, NULL);
1379:		unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
1380:		unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
1381:		unregister_trace_blk_zone_append_update_request_bio(
1382:			blk_add_trace_zone_update_request, NULL);
1383:		unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
1384:		unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1385:		unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1386:		unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1387:		unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1388:		unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1389:		unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1390:		unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1391:		unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1392:		unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1393:	
1394:		tracepoint_synchronize_unregister();
1395:	}
1396:	
1397:	/*
1398:	 * struct blk_io_tracer formatting routines
1399:	 */
1400:	
1401:	static void fill_rwbs(char *rwbs, const struct blk_io_trace2 *t)
1402:	{
1403:		int i = 0;
1404:		int tc = t->action >> BLK_TC_SHIFT;
1405:	
1406:		if ((t->action & ~__BLK_TN_CGROUP) == BLK_TN_MESSAGE) {
1407:			rwbs[i++] = 'N';
1408:			goto out;
1409:		}
1410:	
1411:		if (tc & BLK_TC_FLUSH)
1412:			rwbs[i++] = 'F';
1413:	
1414:		if (tc & BLK_TC_DISCARD)
1415:			rwbs[i++] = 'D';
1416:		else if (tc & BLK_TC_WRITE_ZEROES) {
1417:			rwbs[i++] = 'W';
1418:			rwbs[i++] = 'Z';
1419:		} else if (tc & BLK_TC_WRITE)
1420:			rwbs[i++] = 'W';
1421:		else if (t->bytes)
1422:			rwbs[i++] = 'R';
1423:		else
1424:			rwbs[i++] = 'N';
1425:	
1426:		if (tc & BLK_TC_FUA)
1427:			rwbs[i++] = 'F';
1428:		if (tc & BLK_TC_AHEAD)
1429:			rwbs[i++] = 'A';
]

132/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:550 LineCount:100]

Results:
map[Contents: 550:			return -EINVAL;
 551:	
 552:		blk_trace_cleanup(q, bt);
 553:	
 554:		return 0;
 555:	}
 556:	
 557:	int blk_trace_remove(struct request_queue *q)
 558:	{
 559:		int ret;
 560:	
 561:		blk_debugfs_lock_nomemsave(q);
 562:		ret = __blk_trace_remove(q);
 563:		blk_debugfs_unlock_nomemrestore(q);
 564:	
 565:		return ret;
 566:	}
 567:	EXPORT_SYMBOL_GPL(blk_trace_remove);
 568:	
 569:	static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
 570:					size_t count, loff_t *ppos)
 571:	{
 572:		struct blk_trace *bt = filp->private_data;
 573:		size_t dropped = relay_stats(bt->rchan, RELAY_STATS_BUF_FULL);
 574:		char buf[16];
 575:	
 576:		snprintf(buf, sizeof(buf), "%zu\n", dropped);
 577:	
 578:		return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
 579:	}
 580:	
 581:	static const struct file_operations blk_dropped_fops = {
 582:		.owner =	THIS_MODULE,
 583:		.open =		simple_open,
 584:		.read =		blk_dropped_read,
 585:		.llseek =	default_llseek,
 586:	};
 587:	
 588:	static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
 589:					size_t count, loff_t *ppos)
 590:	{
 591:		char *msg;
 592:		struct blk_trace *bt;
 593:	
 594:		if (count >= BLK_TN_MAX_MSG)
 595:			return -EINVAL;
 596:	
 597:		msg = memdup_user_nul(buffer, count);
 598:		if (IS_ERR(msg))
 599:			return PTR_ERR(msg);
 600:	
 601:		bt = filp->private_data;
 602:		__blk_trace_note_message(bt, NULL, "%s", msg);
 603:		kfree(msg);
 604:	
 605:		return count;
 606:	}
 607:	
 608:	static const struct file_operations blk_msg_fops = {
 609:		.owner =	THIS_MODULE,
 610:		.open =		simple_open,
 611:		.write =	blk_msg_write,
 612:		.llseek =	noop_llseek,
 613:	};
 614:	
 615:	static int blk_remove_buf_file_callback(struct dentry *dentry)
 616:	{
 617:		debugfs_remove(dentry);
 618:	
 619:		return 0;
 620:	}
 621:	
 622:	static struct dentry *blk_create_buf_file_callback(const char *filename,
 623:							   struct dentry *parent,
 624:							   umode_t mode,
 625:							   struct rchan_buf *buf,
 626:							   int *is_global)
 627:	{
 628:		return debugfs_create_file(filename, mode, parent, buf,
 629:						&relay_file_operations);
 630:	}
 631:	
 632:	static const struct rchan_callbacks blk_relay_callbacks = {
 633:		.create_buf_file	= blk_create_buf_file_callback,
 634:		.remove_buf_file	= blk_remove_buf_file_callback,
 635:	};
 636:	
 637:	static void blk_trace_setup_lba(struct blk_trace *bt,
 638:					struct block_device *bdev)
 639:	{
 640:		if (bdev) {
 641:			bt->start_lba = bdev->bd_start_sect;
 642:			bt->end_lba = bdev->bd_start_sect + bdev_nr_sectors(bdev);
 643:		} else {
 644:			bt->start_lba = 0;
 645:			bt->end_lba = -1ULL;
 646:		}
 647:	}
 648:	
 649:	/*
]

133/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:650 LineCount:100]

Results:
map[Contents: 650:	 * Setup everything required to start tracing
 651:	 */
 652:	static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 653:							 char *name, dev_t dev,
 654:							 u32 buf_size, u32 buf_nr,
 655:							 struct block_device *bdev)
 656:	{
 657:		struct blk_trace *bt = NULL;
 658:		struct dentry *dir = NULL;
 659:		int ret;
 660:	
 661:		lockdep_assert_held(&q->debugfs_mutex);
 662:	
 663:		/*
 664:		 * bdev can be NULL, as with scsi-generic, this is a helpful as
 665:		 * we can be.
 666:		 */
 667:		if (rcu_dereference_protected(q->blk_trace,
 668:					      lockdep_is_held(&q->debugfs_mutex))) {
 669:			pr_warn("Concurrent blktraces are not allowed on %s\n", name);
 670:			return ERR_PTR(-EBUSY);
 671:		}
 672:	
 673:		bt = kzalloc_obj(*bt);
 674:		if (!bt)
 675:			return ERR_PTR(-ENOMEM);
 676:	
 677:		ret = -ENOMEM;
 678:		bt->sequence = alloc_percpu(unsigned long);
 679:		if (!bt->sequence)
 680:			goto err;
 681:	
 682:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
 683:		if (!bt->msg_data)
 684:			goto err;
 685:	
 686:		/*
 687:		 * When tracing the whole disk reuse the existing debugfs directory
 688:		 * created by the block layer on init. For partitions block devices,
 689:		 * and scsi-generic block devices we create a temporary new debugfs
 690:		 * directory that will be removed once the trace ends.
 691:		 */
 692:		if (bdev && !bdev_is_partition(bdev))
 693:			dir = q->debugfs_dir;
 694:		else
 695:			bt->dir = dir = debugfs_create_dir(name, blk_debugfs_root);
 696:	
 697:		/*
 698:		 * As blktrace relies on debugfs for its interface the debugfs directory
 699:		 * is required, contrary to the usual mantra of not checking for debugfs
 700:		 * files or directories.
 701:		 */
 702:		if (IS_ERR_OR_NULL(dir)) {
 703:			pr_warn("debugfs_dir not present for %s so skipping\n", name);
 704:			ret = -ENOENT;
 705:			goto err;
 706:		}
 707:	
 708:		bt->dev = dev;
 709:		INIT_LIST_HEAD(&bt->running_list);
 710:	
 711:		ret = -EIO;
 712:		debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 713:		debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 714:	
 715:		bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
 716:				       &blk_relay_callbacks, bt);
 717:		if (!bt->rchan)
 718:			goto err;
 719:	
 720:		blk_trace_setup_lba(bt, bdev);
 721:	
 722:		return bt;
 723:	
 724:	err:
 725:		blk_trace_free(q, bt);
 726:	
 727:		return ERR_PTR(ret);
 728:	}
 729:	
 730:	static void blk_trace_setup_finalize(struct request_queue *q,
 731:					     char *name, int version,
 732:					     struct blk_trace *bt,
 733:					     struct blk_user_trace_setup2 *buts)
 734:	
 735:	{
 736:		strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 737:	
 738:		/*
 739:		 * some device names have larger paths - convert the slashes
 740:		 * to underscores for this to work as expected
 741:		 */
 742:		strreplace(buts->name, '/', '_');
 743:	
 744:		bt->version = version;
 745:		bt->act_mask = buts->act_mask;
 746:		if (!bt->act_mask)
 747:			bt->act_mask = (u16) -1;
 748:	
 749:		/* overwrite with user settings */
]

134/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 15384
							output: 77
							thoughts: 36
						

Thoughts:
Here's my take on those code segments in blktrace.c:

**Diving Deep into blktrace.c**

Alright, let's get down to brass tacks. I'm focusing in on specific segments of `blktrace.c` – specifically lines 740 through 860 and then a jump to 1900 through 2200. These sections are crucial to how the tool actually functions, and I need to refresh my understanding and perhaps spot any nuances I might have missed before. My expertise allows me to quickly navigate the codebase, understand the potential implications of various operations, and pinpoint areas that might warrant further investigation or optimization. I'm anticipating that these segments deal with core aspects of event handling, filtering, or data processing within the blktrace workflow. I'm keen to see if any new techniques or approaches have been implemented since the last time I reviewed it. Time to dig in!



135/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:740 LineCount:100]

Results:
map[Contents: 740:		 * to underscores for this to work as expected
 741:		 */
 742:		strreplace(buts->name, '/', '_');
 743:	
 744:		bt->version = version;
 745:		bt->act_mask = buts->act_mask;
 746:		if (!bt->act_mask)
 747:			bt->act_mask = (u16) -1;
 748:	
 749:		/* overwrite with user settings */
 750:		if (buts->start_lba)
 751:			bt->start_lba = buts->start_lba;
 752:		if (buts->end_lba)
 753:			bt->end_lba = buts->end_lba;
 754:	
 755:		bt->pid = buts->pid;
 756:		bt->trace_state = Blktrace_setup;
 757:	
 758:		rcu_assign_pointer(q->blk_trace, bt);
 759:		get_probe_ref();
 760:	}
 761:	
 762:	int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 763:			    struct block_device *bdev,
 764:			    char __user *arg)
 765:	{
 766:		struct blk_user_trace_setup2 buts2;
 767:		struct blk_user_trace_setup buts;
 768:		struct blk_trace *bt;
 769:		unsigned int memflags;
 770:		int ret;
 771:	
 772:		ret = copy_from_user(&buts, arg, sizeof(buts));
 773:		if (ret)
 774:			return -EFAULT;
 775:	
 776:		if (!buts.buf_size || !buts.buf_nr)
 777:			return -EINVAL;
 778:	
 779:		buts2 = (struct blk_user_trace_setup2) {
 780:			.act_mask = buts.act_mask,
 781:			.buf_size = buts.buf_size,
 782:			.buf_nr = buts.buf_nr,
 783:			.start_lba = buts.start_lba,
 784:			.end_lba = buts.end_lba,
 785:			.pid = buts.pid,
 786:		};
 787:	
 788:		memflags = blk_debugfs_lock(q);
 789:		bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 790:					     bdev);
 791:		if (IS_ERR(bt)) {
 792:			blk_debugfs_unlock(q, memflags);
 793:			return PTR_ERR(bt);
 794:		}
 795:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 796:		strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 797:		blk_debugfs_unlock(q, memflags);
 798:	
 799:		if (copy_to_user(arg, &buts, sizeof(buts))) {
 800:			blk_trace_remove(q);
 801:			return -EFAULT;
 802:		}
 803:		return 0;
 804:	}
 805:	EXPORT_SYMBOL_GPL(blk_trace_setup);
 806:	
 807:	static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 808:				    struct block_device *bdev, char __user *arg)
 809:	{
 810:		struct blk_user_trace_setup2 buts2;
 811:		struct blk_trace *bt;
 812:		unsigned int memflags;
 813:	
 814:		if (copy_from_user(&buts2, arg, sizeof(buts2)))
 815:			return -EFAULT;
 816:	
 817:		if (!buts2.buf_size || !buts2.buf_nr)
 818:			return -EINVAL;
 819:	
 820:		if (buts2.flags != 0)
 821:			return -EINVAL;
 822:	
 823:		memflags = blk_debugfs_lock(q);
 824:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 825:					     bdev);
 826:		if (IS_ERR(bt)) {
 827:			blk_debugfs_unlock(q, memflags);
 828:			return PTR_ERR(bt);
 829:		}
 830:		blk_trace_setup_finalize(q, name, 2, bt, &buts2);
 831:		blk_debugfs_unlock(q, memflags);
 832:	
 833:		if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 834:			blk_trace_remove(q);
 835:			return -EFAULT;
 836:		}
 837:		return 0;
 838:	}
 839:	
]

136/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1900 LineCount:100]

Results:
map[Contents:1900:	static int blk_trace_setup_queue(struct request_queue *q,
1901:					 struct block_device *bdev)
1902:	{
1903:		struct blk_trace *bt = NULL;
1904:		int ret = -ENOMEM;
1905:	
1906:		bt = kzalloc_obj(*bt);
1907:		if (!bt)
1908:			return -ENOMEM;
1909:	
1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
1930:	 */
1931:	
1932:	static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
1933:						 struct device_attribute *attr,
1934:						 char *buf);
1935:	static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
1936:						  struct device_attribute *attr,
1937:						  const char *buf, size_t count);
1938:	#define BLK_TRACE_DEVICE_ATTR(_name) \
1939:		DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
1940:			    sysfs_blk_trace_attr_show, \
1941:			    sysfs_blk_trace_attr_store)
1942:	
1943:	static BLK_TRACE_DEVICE_ATTR(enable);
1944:	static BLK_TRACE_DEVICE_ATTR(act_mask);
1945:	static BLK_TRACE_DEVICE_ATTR(pid);
1946:	static BLK_TRACE_DEVICE_ATTR(start_lba);
1947:	static BLK_TRACE_DEVICE_ATTR(end_lba);
1948:	
1949:	static struct attribute *blk_trace_attrs[] = {
1950:		&dev_attr_enable.attr,
1951:		&dev_attr_act_mask.attr,
1952:		&dev_attr_pid.attr,
1953:		&dev_attr_start_lba.attr,
1954:		&dev_attr_end_lba.attr,
1955:		NULL
1956:	};
1957:	
1958:	struct attribute_group blk_trace_attr_group = {
1959:		.name  = "trace",
1960:		.attrs = blk_trace_attrs,
1961:	};
1962:	
1963:	static const struct {
1964:		int mask;
1965:		const char *str;
1966:	} mask_maps[] = {
1967:		{ BLK_TC_READ,		"read"		},
1968:		{ BLK_TC_WRITE,		"write"		},
1969:		{ BLK_TC_FLUSH,		"flush"		},
1970:		{ BLK_TC_SYNC,		"sync"		},
1971:		{ BLK_TC_QUEUE,		"queue"		},
1972:		{ BLK_TC_REQUEUE,	"requeue"	},
1973:		{ BLK_TC_ISSUE,		"issue"		},
1974:		{ BLK_TC_COMPLETE,	"complete"	},
1975:		{ BLK_TC_FS,		"fs"		},
1976:		{ BLK_TC_PC,		"pc"		},
1977:		{ BLK_TC_NOTIFY,	"notify"	},
1978:		{ BLK_TC_AHEAD,		"ahead"		},
1979:		{ BLK_TC_META,		"meta"		},
1980:		{ BLK_TC_DISCARD,	"discard"	},
1981:		{ BLK_TC_DRV_DATA,	"drv_data"	},
1982:		{ BLK_TC_FUA,		"fua"		},
1983:		{ BLK_TC_WRITE_ZEROES,	"write-zeroes"	},
1984:	};
1985:	
1986:	static int blk_trace_str2mask(const char *str)
1987:	{
1988:		int i;
1989:		int mask = 0;
1990:		char *buf, *s, *token;
1991:	
1992:		buf = kstrdup(str, GFP_KERNEL);
1993:		if (buf == NULL)
1994:			return -ENOMEM;
1995:		s = strstrip(buf);
1996:	
1997:		while (1) {
1998:			token = strsep(&s, ",");
1999:			if (token == NULL)
]

137/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 18814
							output: 37
							thoughts: 73
						

Thoughts:
**Diving Deep into the Blktrace Implementation**

Okay, so we need to make absolutely sure we've covered our bases here. Before we go any further, I need to thoroughly examine the interactions with `compat_blk_trace_setup`. I also need to verify every single caller of `blk_trace_setup_finalize`, as well as `get_probe_ref`, `blk_register_tracepoints`, and any other related function in this area. We can't afford to miss any potential points of integration or conflict. To get a handle on the current implementation, I should direct my attention to lines 830 through 900 in `kernel/trace/blktrace.c`. Let's get reading.



138/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:830 LineCount:80]

Results:
map[Contents: 830:		blk_trace_setup_finalize(q, name, 2, bt, &buts2);
 831:		blk_debugfs_unlock(q, memflags);
 832:	
 833:		if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 834:			blk_trace_remove(q);
 835:			return -EFAULT;
 836:		}
 837:		return 0;
 838:	}
 839:	
 840:	#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 841:	static int compat_blk_trace_setup(struct request_queue *q, char *name,
 842:					  dev_t dev, struct block_device *bdev,
 843:					  char __user *arg)
 844:	{
 845:		struct blk_user_trace_setup2 buts2;
 846:		struct compat_blk_user_trace_setup cbuts;
 847:		struct blk_trace *bt;
 848:		unsigned int memflags;
 849:	
 850:		if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 851:			return -EFAULT;
 852:	
 853:		if (!cbuts.buf_size || !cbuts.buf_nr)
 854:			return -EINVAL;
 855:	
 856:		buts2 = (struct blk_user_trace_setup2) {
 857:			.act_mask = cbuts.act_mask,
 858:			.buf_size = cbuts.buf_size,
 859:			.buf_nr = cbuts.buf_nr,
 860:			.start_lba = cbuts.start_lba,
 861:			.end_lba = cbuts.end_lba,
 862:			.pid = cbuts.pid,
 863:		};
 864:	
 865:		memflags = blk_debugfs_lock(q);
 866:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 867:					     bdev);
 868:		if (IS_ERR(bt)) {
 869:			blk_debugfs_unlock(q, memflags);
 870:			return PTR_ERR(bt);
 871:		}
 872:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 873:		blk_debugfs_unlock(q, memflags);
 874:	
 875:		if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 876:			blk_trace_remove(q);
 877:			return -EFAULT;
 878:		}
 879:	
 880:		return 0;
 881:	}
 882:	#endif
 883:	
 884:	static int __blk_trace_startstop(struct request_queue *q, int start)
 885:	{
 886:		struct blk_trace *bt;
 887:	
 888:		bt = rcu_dereference_protected(q->blk_trace,
 889:					       lockdep_is_held(&q->debugfs_mutex));
 890:		if (bt == NULL)
 891:			return -EINVAL;
 892:	
 893:		if (start)
 894:			return blk_trace_start(bt);
 895:		else
 896:			return blk_trace_stop(bt);
 897:	}
 898:	
 899:	int blk_trace_startstop(struct request_queue *q, int start)
 900:	{
 901:		int ret;
 902:	
 903:		blk_debugfs_lock_nomemsave(q);
 904:		ret = __blk_trace_startstop(q, start);
 905:		blk_debugfs_unlock_nomemrestore(q);
 906:	
 907:		return ret;
 908:	}
 909:	EXPORT_SYMBOL_GPL(blk_trace_startstop);
]

139/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 20315
							output: 72
							thoughts: 70
						

Thoughts:
Here's my summary, as though I'm thinking through this process:

**Tracing Down Tracepoint Registration & Management**

Okay, so I need to get a handle on how these tracepoints are being registered and managed within the block layer. I know there are a few key functions involved: `blk_register_tracepoints`, `blk_unregister_tracepoints`, those probe reference functions `get_probe_ref`, `put_probe_ref`, and then the setup and finalization routines, `blk_trace_setup_finalize`, `blk_trace_setup_queue`.

My approach is going to be systematic. Instead of wading through the entire codebase manually, I'll leverage my usual tools to quickly pinpoint the relevant code locations. I'm thinking I'll start with either `codesearch-find-references` or `grepper` – probably just use whichever is fastest to index the source and return results. I want to see *every* instance where these functions are called. That should give me a solid map of the call graph and how the tracing infrastructure is initialized and shut down within the block layer. From there, I can analyze the surrounding code to understand the context and flow. This should be a straightforward task to build a base of understanding of the system.



140/4 2026/08/31 21:30 tool grepper
0m Args:
map[Expression:(blk_register_tracepoints|blk_unregister_tracepoints|get_probe_ref|put_probe_ref|blk_trace_setup_finalize|blk_trace_setup_queue) PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:kernel/trace/blktrace.c=61=static int blk_probes_ref;
kernel/trace/blktrace.c-62-
kernel/trace/blktrace.c:63:static void blk_register_tracepoints(void);
kernel/trace/blktrace.c:64:static void blk_unregister_tracepoints(void);
kernel/trace/blktrace.c-65-
--
kernel/trace/blktrace.c=310=static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
--
kernel/trace/blktrace.c-397-			 * For sysfs-enabled tracing path (enabled via
kernel/trace/blktrace.c:398:			 * /sys/block/DEV/trace/enable), blk_trace_setup_queue()
kernel/trace/blktrace.c-399-			 * never initializes bt->version, leaving it 0 from
--
kernel/trace/blktrace.c=469=static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
--
kernel/trace/blktrace.c-487-
kernel/trace/blktrace.c:488:static void get_probe_ref(void)
kernel/trace/blktrace.c-489-{
--
kernel/trace/blktrace.c-491-	if (++blk_probes_ref == 1)
kernel/trace/blktrace.c:492:		blk_register_tracepoints();
kernel/trace/blktrace.c-493-	mutex_unlock(&blk_probe_mutex);
--
kernel/trace/blktrace.c-495-
kernel/trace/blktrace.c:496:static void put_probe_ref(void)
kernel/trace/blktrace.c-497-{
--
kernel/trace/blktrace.c-499-	if (!--blk_probes_ref)
kernel/trace/blktrace.c:500:		blk_unregister_tracepoints();
kernel/trace/blktrace.c-501-	mutex_unlock(&blk_probe_mutex);
--
kernel/trace/blktrace.c=535=static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt)
--
kernel/trace/blktrace.c-539-	blk_trace_free(q, bt);
kernel/trace/blktrace.c:540:	put_probe_ref();
kernel/trace/blktrace.c-541-}
--
kernel/trace/blktrace.c=652=static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
--
kernel/trace/blktrace.c-729-
kernel/trace/blktrace.c:730:static void blk_trace_setup_finalize(struct request_queue *q,
kernel/trace/blktrace.c-731-				     char *name, int version,
--
kernel/trace/blktrace.c-758-	rcu_assign_pointer(q->blk_trace, bt);
kernel/trace/blktrace.c:759:	get_probe_ref();
kernel/trace/blktrace.c-760-}
--
kernel/trace/blktrace.c=762=int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
--
kernel/trace/blktrace.c-794-	}
kernel/trace/blktrace.c:795:	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
kernel/trace/blktrace.c-796-	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
--
kernel/trace/blktrace.c=807=static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
--
kernel/trace/blktrace.c-829-	}
kernel/trace/blktrace.c:830:	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
kernel/trace/blktrace.c-831-	blk_debugfs_unlock(q, memflags);
--
kernel/trace/blktrace.c=841=static int compat_blk_trace_setup(struct request_queue *q, char *name,
--
kernel/trace/blktrace.c-871-	}
kernel/trace/blktrace.c:872:	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
kernel/trace/blktrace.c-873-	blk_debugfs_unlock(q, memflags);
--
kernel/trace/blktrace.c=1325=EXPORT_SYMBOL_GPL(blk_add_driver_data);
kernel/trace/blktrace.c-1326-
kernel/trace/blktrace.c:1327:static void blk_register_tracepoints(void)
kernel/trace/blktrace.c-1328-{
--
kernel/trace/blktrace.c-1371-
kernel/trace/blktrace.c:1372:static void blk_unregister_tracepoints(void)
kernel/trace/blktrace.c-1373-{
--
kernel/trace/blktrace.c=1880=static int blk_trace_remove_queue(struct request_queue *q)
--
kernel/trace/blktrace.c-1890-
kernel/trace/blktrace.c:1891:	put_probe_ref();
kernel/trace/blktrace.c-1892-	synchronize_rcu();
--
kernel/trace/blktrace.c-1899- */
kernel/trace/blktrace.c:1900:static int blk_trace_setup_queue(struct request_queue *q,
kernel/trace/blktrace.c-1901-				 struct block_device *bdev)
--
kernel/trace/blktrace.c-1919-	rcu_assign_pointer(q->blk_trace, bt);
kernel/trace/blktrace.c:1920:	get_probe_ref();
kernel/trace/blktrace.c-1921-	return 0;
--
kernel/trace/blktrace.c=2071=static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
--
kernel/trace/blktrace.c-2107-		if (value)
kernel/trace/blktrace.c:2108:			ret = blk_trace_setup_queue(q, bdev);
kernel/trace/blktrace.c-2109-		else
--
kernel/trace/blktrace.c-2115-	if (bt == NULL) {
kernel/trace/blktrace.c:2116:		ret = blk_trace_setup_queue(q, bdev);
kernel/trace/blktrace.c-2117-		bt = rcu_dereference_protected(q->blk_trace,
]

141/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 22578
							output: 36
							thoughts: 28
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Analyzing `blktrace.c` Forward Declarations**

Alright, time to dive into this. Based on my existing knowledge, I need to understand how the forward declarations are set up in `kernel/trace/blktrace.c`. It's a key spot to ensure proper function linking and avoid compilation issues. Let's zero in on lines 60-70. That range is usually where you'd find a concentration of those critical function prototypes, definitions that the compiler uses to link up the rest of the code. This is where I will begin my analysis.



142/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:55 LineCount:25]

Results:
map[Contents:  55:		.val  = 0,
  56:		.opts = blk_tracer_opts,
  57:	};
  58:	
  59:	/* Global reference count of probes */
  60:	static DEFINE_MUTEX(blk_probe_mutex);
  61:	static int blk_probes_ref;
  62:	
  63:	static void blk_register_tracepoints(void);
  64:	static void blk_unregister_tracepoints(void);
  65:	
  66:	static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
  67:					  sector_t sector, int bytes, u64 what,
  68:					  dev_t dev, int error, u64 cgid,
  69:					  ssize_t cgid_len, void *pdu_data, int pdu_len)
  70:	
  71:	{
  72:		/*
  73:		 * These two are not needed in ftrace as they are in the
  74:		 * generic trace_entry, filled by tracing_generic_entry_update,
  75:		 * but for the trace_event->bin() synthesizer benefit we do it
  76:		 * here too.
  77:		 */
  78:		t->cpu = cpu;
  79:		t->pid = pid;
]

143/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 23158
							output: 20
							thoughts: 1388
						

Thoughts:
**Analyzing Tracepoint Registration and Error Handling**

Okay, let's break this down. First, I'm looking at `static void blk_register_tracepoints(void);` and I'm pretty sure it should be returning an `int`, not `void`, given the registration logic. So, that's the first thing I need to correct: `static int blk_register_tracepoints(void);`.

Now, I'm going to meticulously examine every instance of `blk_register_tracepoints`, `get_probe_ref`, `blk_trace_setup_finalize`, `blk_trace_setup`, `blk_trace_setup2`, `compat_blk_trace_setup`, and `blk_trace_setup_queue`, and especially their associated error paths. We need to make sure any change here cascades correctly. I have to be absolutely certain of the correct behavior.

Let's start with `blk_register_tracepoints` itself. I'm going to inspect the registration process in detail.  Here's the current code:

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
	WARN_ON(ret);
	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
	WARN_ON(ret);
	ret = register_trace_blk_zone_append_update_request_bio(
		blk_add_trace_zone_update_request, NULL);
	WARN_ON(ret);
	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
						     NULL);
	WARN_ON(ret);
	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
						NULL);
	WARN_ON(ret);
	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
	WARN_ON(ret);
	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
	WARN_ON(ret);
	ret = register_trace_block_split(blk_add_trace_split, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	WARN_ON(ret);
}
```

Okay, so it registers a whole bunch of tracepoints.  And here's the unregistration function:

```c
static void blk_unregister_tracepoints(void)
{
	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
	unregister_trace_block_split(blk_add_trace_split, NULL);
	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
	


144/4 2026/08/31 21:30 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:register_trace_.*goto]

Results:
map[Output:]

145/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 25605
							output: 28
							thoughts: 18
						

Thoughts:
Here's my take on those thoughts:

**Tracing Kernel Unregistration Functions**

Alright, time to get digging. I need to find the specific functions related to unregistering trace points within the kernel's tracing subsystem. My instinct is to zero in on `kernel/trace/`. That's the logical place to start looking for the core implementation of tracing functionality. I'll need to use my search tools to pinpoint those unregistration functions; my go-to search term will be `unregister_trace_`. That should be precise enough to filter out a lot of the irrelevant noise and hone in on the code I'm actually interested in. Let's see what that search yields.



146/4 2026/08/31 21:30 tool grepper
0m Args:
map[Expression:unregister_trace_ PathPrefix:kernel/trace/]

Results:
map[Output:kernel/trace/blktrace.c=1372=static void blk_unregister_tracepoints(void)
kernel/trace/blktrace.c-1373-{
kernel/trace/blktrace.c:1374:	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c:1375:	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c:1376:	unregister_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c:1377:	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c:1378:	unregister_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c:1379:	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
kernel/trace/blktrace.c:1380:	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
kernel/trace/blktrace.c:1381:	unregister_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1382-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c:1383:	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c:1384:	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c:1385:	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c:1386:	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c:1387:	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c:1388:	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c:1389:	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c:1390:	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c:1391:	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c:1392:	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1393-
--
kernel/trace/blktrace.c=1839=static int __init __init_blk_tracer(void)
--
kernel/trace/blktrace.c-1847-		pr_warn("Warning: could not register the block tracer\n");
kernel/trace/blktrace.c:1848:		unregister_trace_event(&trace_blk_event);
kernel/trace/blktrace.c-1849-		return 1;
--
kernel/trace/fgraph.c=1426=void unregister_ftrace_graph(struct fgraph_ops *gops)
--
kernel/trace/fgraph.c-1463-		unregister_pm_notifier(&ftrace_suspend_notifier);
kernel/trace/fgraph.c:1464:		unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1465-	}
--
kernel/trace/ftrace.c=8691=void ftrace_pid_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/ftrace.c-8698-	} else {
kernel/trace/ftrace.c:8699:		unregister_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8700-						    tr);
kernel/trace/ftrace.c:8701:		unregister_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8702-						    tr);
--
kernel/trace/ftrace.c=8706=static void clear_ftrace_pids(struct trace_array *tr, int type)
--
kernel/trace/ftrace.c-8722-	if (!still_need_pid_events(type, pid_list, no_pid_list)) {
kernel/trace/ftrace.c:8723:		unregister_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8724-		for_each_possible_cpu(cpu)
--
kernel/trace/trace_eprobe.c=77=static int eprobe_dyn_event_show(struct seq_file *m, struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-94-
kernel/trace/trace_eprobe.c:95:static int unregister_trace_eprobe(struct trace_eprobe *ep)
kernel/trace/trace_eprobe.c-96-{
--
kernel/trace/trace_eprobe.c=116=static int eprobe_dyn_event_release(struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-118-	struct trace_eprobe *ep = to_trace_eprobe(ev);
kernel/trace/trace_eprobe.c:119:	int ret = unregister_trace_eprobe(ep);
kernel/trace/trace_eprobe.c-120-
--
kernel/trace/trace_events.c=1093=void trace_event_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/trace_events.c-1100-	} else {
kernel/trace/trace_events.c:1101:		unregister_trace_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1102-						    tr);
kernel/trace/trace_events.c:1103:		unregister_trace_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1104-						    tr);
--
kernel/trace/trace_events.c=1188=static void unregister_pid_events(struct trace_array *tr)
kernel/trace/trace_events.c-1189-{
kernel/trace/trace_events.c:1190:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_pre, tr);
kernel/trace/trace_events.c:1191:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_post, tr);
kernel/trace/trace_events.c-1192-
kernel/trace/trace_events.c:1193:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1194:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1195-
kernel/trace/trace_events.c:1196:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1197:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1198-
kernel/trace/trace_events.c:1199:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1200:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1201-}
--
kernel/trace/trace_events.c=3350=static void event_remove(struct trace_event_call *call)
--
kernel/trace/trace_events.c-3372-	if (call->event.funcs)
kernel/trace/trace_events.c:3373:		__unregister_trace_event(&call->event);
kernel/trace/trace_events.c-3374-	remove_event_from_tracers(call);
--
kernel/trace/trace_events_synth.c=955=static int register_synth_event(struct synth_event *event)
--
kernel/trace/trace_events_synth.c-999-	ret = set_synth_event_print_fmt(call);
kernel/trace/trace_events_synth.c:1000:	/* unregister_trace_event() will be called inside */
kernel/trace/trace_events_synth.c-1001-	if (ret < 0)
--
kernel/trace/trace_events_synth.c-1005- err:
kernel/trace/trace_events_synth.c:1006:	unregister_trace_event(&call->event);
kernel/trace/trace_events_synth.c-1007-	goto out;
--
kernel/trace/trace_events_user.c=1966=static int user_event_trace_register(struct user_event *user)
--
kernel/trace/trace_events_user.c-1977-	if (ret)
kernel/trace/trace_events_user.c:1978:		unregister_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1979-
--
kernel/trace/trace_fprobe.c=814=static int __register_trace_fprobe(struct trace_fprobe *tf)
--
kernel/trace/trace_fprobe.c-841-/* Internal unregister function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:842:static void __unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-843-{
--
kernel/trace/trace_fprobe.c-853-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_fprobe.c:854:static int unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-855-{
--
kernel/trace/trace_fprobe.c-872-unreg:
kernel/trace/trace_fprobe.c:873:	__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-874-	dyn_event_remove(&tf->devent);
--
kernel/trace/trace_fprobe.c=1419=static int trace_fprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_fprobe.c-1421-	struct trace_fprobe *tf = to_trace_fprobe(ev);
kernel/trace/trace_fprobe.c:1422:	int ret = unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1423-
--
kernel/trace/trace_fprobe.c=1457=static int enable_trace_fprobe(struct trace_event_call *call,
--
kernel/trace/trace_fprobe.c-1490-	list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list)
kernel/trace/trace_fprobe.c:1491:		__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1492-	if (file)
--
kernel/trace/trace_kprobe.c=495=static int __register_trace_kprobe(struct trace_kprobe *tk)
--
kernel/trace/trace_kprobe.c-532-/* Internal unregister function - just handle k*probes and flags */
kernel/trace/trace_kprobe.c:533:static void __unregister_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-534-{
--
kernel/trace/trace_kprobe.c-548-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_kprobe.c:549:static int unregister_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-550-{
--
kernel/trace/trace_kprobe.c-567-unreg:
kernel/trace/trace_kprobe.c:568:	__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-569-	dyn_event_remove(&tk->devent);
--
kernel/trace/trace_kprobe.c=703=static int trace_kprobe_module_callback(struct notifier_block *nb,
--
kernel/trace/trace_kprobe.c-718-			/* Don't need to check busy - this should have gone. */
kernel/trace/trace_kprobe.c:719:			__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-720-			ret = register_module_trace_kprobe(mod, tk);
--
kernel/trace/trace_kprobe.c=1298=static int trace_kprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_kprobe.c-1300-	struct trace_kprobe *tk = to_trace_kprobe(ev);
kernel/trace/trace_kprobe.c:1301:	int ret = unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1302-
--
kernel/trace/trace_kprobe.c=1978=void destroy_local_trace_kprobe(struct trace_event_call *event_call)
--
kernel/trace/trace_kprobe.c-1990-
kernel/trace/trace_kprobe.c:1991:	__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1992-
--
kernel/trace/trace_osnoise.c=1004=static int hook_irq_events(void)
--
kernel/trace/trace_osnoise.c-1022-out_irq_exit:
kernel/trace/trace_osnoise.c:1023:	unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c-1024-out_unregister_entry:
kernel/trace/trace_osnoise.c:1025:	unregister_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1026-out_err:
--
kernel/trace/trace_osnoise.c=1036=static void unhook_irq_events(void)
--
kernel/trace/trace_osnoise.c-1038-	osnoise_arch_unregister();
kernel/trace/trace_osnoise.c:1039:	unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c:1040:	unregister_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1041-}
--
kernel/trace/trace_osnoise.c=1100=static int hook_softirq_events(void)
--
kernel/trace/trace_osnoise.c-1114-out_unreg_entry:
kernel/trace/trace_osnoise.c:1115:	unregister_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c-1116-out_err:
--
kernel/trace/trace_osnoise.c=1126=static void unhook_softirq_events(void)
kernel/trace/trace_osnoise.c-1127-{
kernel/trace/trace_osnoise.c:1128:	unregister_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c:1129:	unregister_trace_softirq_exit(trace_softirq_exit_callback, NULL);
kernel/trace/trace_osnoise.c-1130-}
--
kernel/trace/trace_osnoise.c=1259=static void unregister_migration_monitor(void)
--
kernel/trace/trace_osnoise.c-1263-
kernel/trace/trace_osnoise.c:1264:	unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL);
kernel/trace/trace_osnoise.c-1265-	monitor_enabled = false;
--
kernel/trace/trace_osnoise.c=1302=static int hook_thread_events(void)
--
kernel/trace/trace_osnoise.c-1316-out_unreg:
kernel/trace/trace_osnoise.c:1317:	unregister_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1318-	return -EINVAL;
--
kernel/trace/trace_osnoise.c=1327=static void unhook_thread_events(void)
kernel/trace/trace_osnoise.c-1328-{
kernel/trace/trace_osnoise.c:1329:	unregister_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1330-	unregister_migration_monitor();
--
kernel/trace/trace_output.c=924=EXPORT_SYMBOL_GPL(register_trace_event);
--
kernel/trace/trace_output.c-928- */
kernel/trace/trace_output.c:929:int __unregister_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-930-{
--
kernel/trace/trace_output.c-936-/**
kernel/trace/trace_output.c:937: * unregister_trace_event - remove a no longer used event
kernel/trace/trace_output.c-938- * @event: the event to remove
kernel/trace/trace_output.c-939- */
kernel/trace/trace_output.c:940:int unregister_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-941-{
kernel/trace/trace_output.c-942-	down_write(&trace_event_sem);
kernel/trace/trace_output.c:943:	__unregister_trace_event(event);
kernel/trace/trace_output.c-944-	up_write(&trace_event_sem);
--
kernel/trace/trace_output.c-947-}
kernel/trace/trace_output.c:948:EXPORT_SYMBOL_GPL(unregister_trace_event);
kernel/trace/trace_output.c-949-
--
kernel/trace/trace_output.h=43=trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry);
--
kernel/trace/trace_output.h-45-/* used by module unregistering */
kernel/trace/trace_output.h:46:extern int __unregister_trace_event(struct trace_event *event);
kernel/trace/trace_output.h-47-extern struct rw_semaphore trace_event_sem;
--
kernel/trace/trace_probe.c=2691=int trace_probe_register_event_call(struct trace_probe *tp)
--
kernel/trace/trace_probe.c-2707-	if (ret)
kernel/trace/trace_probe.c:2708:		unregister_trace_event(&call->event);
kernel/trace/trace_probe.c-2709-
--
kernel/trace/trace_sched_switch.c=52=static int tracing_sched_register(void)
--
kernel/trace/trace_sched_switch.c-78-fail_deprobe_wake_new:
kernel/trace/trace_sched_switch.c:79:	unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-80-fail_deprobe:
kernel/trace/trace_sched_switch.c:81:	unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-82-	return ret;
--
kernel/trace/trace_sched_switch.c=85=static void tracing_sched_unregister(void)
kernel/trace/trace_sched_switch.c-86-{
kernel/trace/trace_sched_switch.c:87:	unregister_trace_sched_switch(probe_sched_switch, NULL);
kernel/trace/trace_sched_switch.c:88:	unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c:89:	unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-90-}
--
kernel/trace/trace_sched_wakeup.c=612=static void start_wakeup_tracer(struct trace_array *tr)
--
kernel/trace/trace_sched_wakeup.c-659-fail_deprobe_sched_switch:
kernel/trace/trace_sched_wakeup.c:660:	unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL);
kernel/trace/trace_sched_wakeup.c-661-fail_deprobe_wake_new:
kernel/trace/trace_sched_wakeup.c:662:	unregister_trace_sched_wakeup_new(probe_wakeup, NULL);
kernel/trace/trace_sched_wakeup.c-663-fail_deprobe:
kernel/trace/trace_sched_wakeup.c:664:	unregister_trace_sched_wakeup(probe_wakeup, NULL);
kernel/trace/trace_sched_wakeup.c-665-}
--
kernel/trace/trace_sched_wakeup.c=667=static void stop_wakeup_tracer(struct trace_array *tr)
--
kernel/trace/trace_sched_wakeup.c-670-	stop_func_tracer(tr, is_graph(tr));
kernel/trace/trace_sched_wakeup.c:671:	unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL);
kernel/trace/trace_sched_wakeup.c:672:	unregister_trace_sched_wakeup_new(probe_wakeup, NULL);
kernel/trace/trace_sched_wakeup.c:673:	unregister_trace_sched_wakeup(probe_wakeup, NULL);
kernel/trace/trace_sched_wakeup.c:674:	unregister_trace_sched_migrate_task(probe_wakeup_migrate_task, NULL);
kernel/trace/trace_sched_wakeup.c-675-}
--
kernel/trace/trace_syscalls.c=999=static void unreg_event_syscall_enter(struct trace_event_file *file,
--
kernel/trace/trace_syscalls.c-1012-	if (!tr->sys_refcount_enter)
kernel/trace/trace_syscalls.c:1013:		unregister_trace_sys_enter(ftrace_syscall_enter, tr);
kernel/trace/trace_syscalls.c-1014-	if (sys_data->user_mask)
--
kernel/trace/trace_syscalls.c=1039=static void unreg_event_syscall_exit(struct trace_event_file *file,
--
kernel/trace/trace_syscalls.c-1051-	if (!tr->sys_refcount_exit)
kernel/trace/trace_syscalls.c:1052:		unregister_trace_sys_exit(ftrace_syscall_exit, tr);
kernel/trace/trace_syscalls.c-1053-	mutex_unlock(&syscall_trace_lock);
--
kernel/trace/trace_syscalls.c=1527=static void perf_sysenter_disable(struct trace_event_call *call)
--
kernel/trace/trace_syscalls.c-1537-	if (!sys_perf_refcount_enter)
kernel/trace/trace_syscalls.c:1538:		unregister_trace_sys_enter(perf_syscall_enter, NULL);
kernel/trace/trace_syscalls.c-1539-	if (sys_data->user_mask)
--
kernel/trace/trace_syscalls.c=1637=static void perf_sysexit_disable(struct trace_event_call *call)
--
kernel/trace/trace_syscalls.c-1646-	if (!sys_perf_refcount_exit)
kernel/trace/trace_syscalls.c:1647:		unregister_trace_sys_exit(perf_syscall_exit, NULL);
kernel/trace/trace_syscalls.c-1648-}
--
kernel/trace/trace_uprobe.c=381=static struct trace_uprobe *find_probe_event(const char *event, const char *group)
--
kernel/trace/trace_uprobe.c-394-/* Unregister a trace_uprobe and probe_event */
kernel/trace/trace_uprobe.c:395:static int unregister_trace_uprobe(struct trace_uprobe *tu)
kernel/trace/trace_uprobe.c-396-{
--
kernel/trace/trace_uprobe.c=743=static int trace_uprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_uprobe.c-746-
kernel/trace/trace_uprobe.c:747:	return unregister_trace_uprobe(tu);
kernel/trace/trace_uprobe.c-748-}
]

147/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 32600
							output: 38
							thoughts: 34
						

Thoughts:
Okay, here's the summary, rendered as a first-person thought process, keeping in mind the user is an expert:

**Navigating the Scheduler Tracepoint Registration**

Alright, let's dive into this. I'm focusing on the `trace_sched_switch.c` file – that's the one handling the `sched_switch` tracepoint, right? Hmm, time to check my memory... yeah, I'm pretty sure that's where the registration logic lives. So, the key function I'm after should be `tracing_sched_register()`. Makes sense.

Okay, let's pull up the code. *read-file*, let's see what we've got in there... I want to see how that tracepoint gets hooked into the scheduler infrastructure, the details of the arguments it uses... the whole registration process. It's time to dig into the implementation specifics and confirm my initial assumptions. Let's start reading.



148/4 2026/08/31 21:30 tool read-file
0m Args:
map[File:kernel/trace/trace_sched_switch.c FirstLine:50 LineCount:45]

Results:
map[Contents:  50:	}
  51:	
  52:	static int tracing_sched_register(void)
  53:	{
  54:		int ret;
  55:	
  56:		ret = register_trace_sched_wakeup(probe_sched_wakeup, NULL);
  57:		if (ret) {
  58:			pr_info("wakeup trace: Couldn't activate tracepoint"
  59:				" probe to kernel_sched_wakeup\n");
  60:			return ret;
  61:		}
  62:	
  63:		ret = register_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
  64:		if (ret) {
  65:			pr_info("wakeup trace: Couldn't activate tracepoint"
  66:				" probe to kernel_sched_wakeup_new\n");
  67:			goto fail_deprobe;
  68:		}
  69:	
  70:		ret = register_trace_sched_switch(probe_sched_switch, NULL);
  71:		if (ret) {
  72:			pr_info("sched trace: Couldn't activate tracepoint"
  73:				" probe to kernel_sched_switch\n");
  74:			goto fail_deprobe_wake_new;
  75:		}
  76:	
  77:		return ret;
  78:	fail_deprobe_wake_new:
  79:		unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
  80:	fail_deprobe:
  81:		unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
  82:		return ret;
  83:	}
  84:	
  85:	static void tracing_sched_unregister(void)
  86:	{
  87:		unregister_trace_sched_switch(probe_sched_switch, NULL);
  88:		unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
  89:		unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
  90:	}
  91:	
  92:	static void tracing_start_sched_switch(int ops)
  93:	{
  94:		bool sched_register;
]

149/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 33481
							output: 21
							thoughts: 103
						

Thoughts:
**Analyzing Tracepoint Unregistration**

Okay, let's dive into this. My initial focus is on `tracepoint_synchronize_unregister()`. Specifically, I'm trying to determine the correct call flow and if it's being handled appropriately in all scenarios. Right now, I see that `blk_unregister_tracepoints()` calls `tracepoint_synchronize_unregister()` at the very end. That makes logical sense, but I'm thinking about error handling during the *registration* process, `blk_register_tracepoints()`. If there's a rollback during registration due to an error, should `tracepoint_synchronize_unregister()` be part of that rollback sequence? That's the critical question I need to answer. To do that effectively, I'm going to need a deeper understanding of what `tracepoint_synchronize_unregister()` actually *does*. I need to see what's happening under the hood. Time to fire up my search tools and look for every instance of `tracepoint_synchronize_unregister` across the entire kernel. This will paint a complete picture of its usage and any potential dependencies or side effects.



150/4 2026/08/31 21:30 tool grepper
0m Args:
map[Expression:tracepoint_synchronize_unregister]

Results:
map[Output:Documentation/trace/tracepoints.rst=96=unregister_trace_subsys_eventname(); it will remove the probe.
Documentation/trace/tracepoints.rst-97-
Documentation/trace/tracepoints.rst:98:tracepoint_synchronize_unregister() must be called before the end of
Documentation/trace/tracepoints.rst-99-the module exit function to make sure there is no caller left using
--
drivers/greybus/core.c=367=static void __exit gb_exit(void)
--
drivers/greybus/core.c-372-	gb_debugfs_cleanup();
drivers/greybus/core.c:373:	tracepoint_synchronize_unregister();
drivers/greybus/core.c-374-}
--
drivers/i2c/i2c-core-base.c=2154=static void __exit i2c_exit(void)
--
drivers/i2c/i2c-core-base.c-2162-	bus_unregister(&i2c_bus_type);
drivers/i2c/i2c-core-base.c:2163:	tracepoint_synchronize_unregister();
drivers/i2c/i2c-core-base.c-2164-}
--
include/linux/tracepoint.h=96=void for_each_tracepoint_in_module(struct module *mod,
--
include/linux/tracepoint.h-104-/*
include/linux/tracepoint.h:105: * tracepoint_synchronize_unregister must be called between the last tracepoint
include/linux/tracepoint.h-106- * probe unregistration and the end of module exit to make sure there is no
--
include/linux/tracepoint.h=116=extern struct srcu_struct tracepoint_srcu;
include/linux/tracepoint.h:117:static inline void tracepoint_synchronize_unregister(void)
include/linux/tracepoint.h-118-{
--
include/linux/tracepoint.h=138=static inline void call_tracepoint_unregister_syscall(struct rcu_head *rcu, rcu_callback_t func)
--
include/linux/tracepoint.h-142-#else
include/linux/tracepoint.h:143:static inline void tracepoint_synchronize_unregister(void)
include/linux/tracepoint.h-144-{ }
--
include/rv/da_monitor.h=387=static inline void da_monitor_destroy(void)
--
include/rv/da_monitor.h-393-
include/rv/da_monitor.h:394:	tracepoint_synchronize_unregister();
include/rv/da_monitor.h-395-	da_monitor_reset_all();
--
include/rv/da_monitor.h=596=static inline void da_monitor_destroy(void)
--
include/rv/da_monitor.h-601-
include/rv/da_monitor.h:602:	tracepoint_synchronize_unregister();
include/rv/da_monitor.h-603-	da_monitor_reset_all();
--
include/rv/ltl_monitor.h=76=static void ltl_monitor_destroy(void)
--
include/rv/ltl_monitor.h-79-
include/rv/ltl_monitor.h:80:	tracepoint_synchronize_unregister();
include/rv/ltl_monitor.h-81-	rv_put_task_monitor_slot(ltl_monitor_slot);
--
kernel/kcsan/kcsan_test.c=1606=static void kcsan_suite_exit(struct kunit_suite *suite)
--
kernel/kcsan/kcsan_test.c-1608-	unregister_tracepoints();
kernel/kcsan/kcsan_test.c:1609:	tracepoint_synchronize_unregister();
kernel/kcsan/kcsan_test.c-1610-}
--
kernel/trace/blktrace.c=1372=static void blk_unregister_tracepoints(void)
--
kernel/trace/blktrace.c-1393-
kernel/trace/blktrace.c:1394:	tracepoint_synchronize_unregister();
kernel/trace/blktrace.c-1395-}
--
kernel/trace/rv/rv.c=249=static int __rv_disable_monitor(struct rv_monitor *mon, bool sync)
--
kernel/trace/rv/rv.c-263-		if (sync)
kernel/trace/rv/rv.c:264:			tracepoint_synchronize_unregister();
kernel/trace/rv/rv.c-265-		return 1;
--
kernel/trace/rv/rv.c=292=static void rv_disable_container(struct rv_monitor *mon)
--
kernel/trace/rv/rv.c-302-	if (enabled)
kernel/trace/rv/rv.c:303:		tracepoint_synchronize_unregister();
kernel/trace/rv/rv.c-304-	mon->enabled = 0;
--
kernel/trace/rv/rv.c=550=static void disable_all_monitors(void)
--
kernel/trace/rv/rv.c-565-		 */
kernel/trace/rv/rv.c:566:		tracepoint_synchronize_unregister();
kernel/trace/rv/rv.c-567-	}
--
kernel/trace/rv/rv.c=710=static ssize_t monitoring_on_write_data(struct file *filp, const char __user *user_buf,
--
kernel/trace/rv/rv.c-730-	 */
kernel/trace/rv/rv.c:731:	tracepoint_synchronize_unregister();
kernel/trace/rv/rv.c-732-
--
kernel/trace/rv/rv_reactors.c=373=static ssize_t reacting_on_write_data(struct file *filp, const char __user *user_buf,
--
kernel/trace/rv/rv_reactors.c-393-	 */
kernel/trace/rv/rv_reactors.c:394:	tracepoint_synchronize_unregister();
kernel/trace/rv/rv_reactors.c-395-
--
kernel/trace/trace_eprobe.c=600=static int disable_eprobe(struct trace_eprobe *ep,
--
kernel/trace/trace_eprobe.c-629-	/* Make sure nothing is using the edata or trigger */
kernel/trace/trace_eprobe.c:630:	tracepoint_synchronize_unregister();
kernel/trace/trace_eprobe.c-631-
--
kernel/trace/trace_eprobe.c=699=static int disable_trace_eprobe(struct trace_event_call *call,
--
kernel/trace/trace_eprobe.c-727-		 * file == NULL and perf_trace_event_unreg() calls
kernel/trace/trace_eprobe.c:728:		 * tracepoint_synchronize_unregister() to ensure synchronize
kernel/trace/trace_eprobe.c-729-		 * event. We don't need to care about it.
--
kernel/trace/trace_event_perf.c=154=static void perf_trace_event_unreg(struct perf_event *p_event)
--
kernel/trace/trace_event_perf.c-167-	 */
kernel/trace/trace_event_perf.c:168:	tracepoint_synchronize_unregister();
kernel/trace/trace_event_perf.c-169-
--
kernel/trace/trace_events.c=1203=static void __ftrace_clear_event_pids(struct trace_array *tr, int type)
--
kernel/trace/trace_events.c-1236-	/* Wait till all users are no longer using pid filtering */
kernel/trace/trace_events.c:1237:	tracepoint_synchronize_unregister();
kernel/trace/trace_events.c-1238-
--
kernel/trace/trace_events.c=2592=event_pid_write(struct file *filp, const char __user *ubuf,
--
kernel/trace/trace_events.c-2637-	if (filtered_pids) {
kernel/trace/trace_events.c:2638:		tracepoint_synchronize_unregister();
kernel/trace/trace_events.c-2639-		trace_pid_list_free(filtered_pids);
--
kernel/trace/trace_events.c=4779=int event_trace_del_tracer(struct trace_array *tr)
--
kernel/trace/trace_events.c-4792-	/* Make sure no more events are being executed */
kernel/trace/trace_events.c:4793:	tracepoint_synchronize_unregister();
kernel/trace/trace_events.c-4794-
--
kernel/trace/trace_events_filter.c=1374=static void free_filter_list_tasks(struct rcu_head *rhp)
--
kernel/trace/trace_events_filter.c-1382-/*
kernel/trace/trace_events_filter.c:1383: * The tracepoint_synchronize_unregister() is a double rcu call.
kernel/trace/trace_events_filter.c-1384- * It calls synchronize_rcu_tasks_trace() followed by synchronize_rcu().
--
kernel/trace/trace_events_filter.c=1393=static void try_delay_free_filter(struct event_filter *filter)
--
kernel/trace/trace_events_filter.c-1416-	/* Make sure the filter is not being used */
kernel/trace/trace_events_filter.c:1417:	tracepoint_synchronize_unregister();
kernel/trace/trace_events_filter.c-1418-	__free_filter(filter);
--
kernel/trace/trace_events_filter.c=1438=static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,
--
kernel/trace/trace_events_filter.c-1472- free_now:
kernel/trace/trace_events_filter.c:1473:	tracepoint_synchronize_unregister();
kernel/trace/trace_events_filter.c-1474-
--
kernel/trace/trace_events_hist.c=6358=static void event_hist_trigger_free(struct event_trigger_data *data)
--
kernel/trace/trace_events_hist.c-6371-
kernel/trace/trace_events_hist.c:6372:		tracepoint_synchronize_unregister();
kernel/trace/trace_events_hist.c-6373-		remove_hist_vars(hist_data);
--
kernel/trace/trace_events_hist.c=6399=static void event_hist_trigger_named_free(struct event_trigger_data *data)
--
kernel/trace/trace_events_hist.c-6411-		trigger_data_free(data);
kernel/trace/trace_events_hist.c:6412:		tracepoint_synchronize_unregister();
kernel/trace/trace_events_hist.c-6413-		kfree(cmd_ops);
--
kernel/trace/trace_events_hist.c=6417=static void hist_clear(struct event_trigger_data *data)
--
kernel/trace/trace_events_hist.c-6423-
kernel/trace/trace_events_hist.c:6424:	tracepoint_synchronize_unregister();
kernel/trace/trace_events_hist.c-6425-
--
kernel/trace/trace_events_trigger.c=48=static void trigger_data_free_queued_locked(void)
--
kernel/trace/trace_events_trigger.c-58-
kernel/trace/trace_events_trigger.c:59:	tracepoint_synchronize_unregister();
kernel/trace/trace_events_trigger.c-60-
--
kernel/trace/trace_events_trigger.c=66=static int trigger_kthread_fn(void *ignore)
--
kernel/trace/trace_events_trigger.c-81-		/* make sure current triggers exit before free */
kernel/trace/trace_events_trigger.c:82:		tracepoint_synchronize_unregister();
kernel/trace/trace_events_trigger.c-83-
--
kernel/trace/trace_events_trigger.c=1192=int set_trigger_filter(char *filter_str,
--
kernel/trace/trace_events_trigger.c-1238-		if (system_state != SYSTEM_BOOTING)
kernel/trace/trace_events_trigger.c:1239:			tracepoint_synchronize_unregister();
kernel/trace/trace_events_trigger.c-1240-		free_event_filter(tmp);
--
kernel/trace/trace_fprobe.c=1503=static int disable_trace_fprobe(struct trace_event_call *call,
--
kernel/trace/trace_fprobe.c-1536-		 * file == NULL and perf_trace_event_unreg() calls
kernel/trace/trace_fprobe.c:1537:		 * tracepoint_synchronize_unregister() to ensure synchronize
kernel/trace/trace_fprobe.c-1538-		 * event. We don't need to care about it.
--
kernel/trace/trace_kprobe.c=416=static int disable_trace_kprobe(struct trace_event_call *call,
--
kernel/trace/trace_kprobe.c-441-		 * file == NULL and perf_trace_event_unreg() calls
kernel/trace/trace_kprobe.c:442:		 * tracepoint_synchronize_unregister() to ensure synchronize
kernel/trace/trace_kprobe.c-443-		 * event. We don't need to care about it.
--
mm/kasan/kasan_test_c.c=83=static void kasan_suite_exit(struct kunit_suite *suite)
--
mm/kasan/kasan_test_c.c-87-	unregister_trace_console(probe_console, NULL);
mm/kasan/kasan_test_c.c:88:	tracepoint_synchronize_unregister();
mm/kasan/kasan_test_c.c-89-}
--
mm/kfence/kfence_test.c=855=static void kfence_suite_exit(struct kunit_suite *suite)
--
mm/kfence/kfence_test.c-857-	unregister_trace_console(probe_console, NULL);
mm/kfence/kfence_test.c:858:	tracepoint_synchronize_unregister();
mm/kfence/kfence_test.c-859-}
--
mm/kmsan/kmsan_test.c=794=static void kmsan_suite_exit(struct kunit_suite *suite)
--
mm/kmsan/kmsan_test.c-796-	unregister_trace_console(probe_console, NULL);
mm/kmsan/kmsan_test.c:797:	tracepoint_synchronize_unregister();
mm/kmsan/kmsan_test.c-798-	panic_on_kmsan = orig_panic_on_kmsan;
--
net/core/drop_monitor.c=1028=static void net_dm_hw_probe_unregister(const struct net_dm_alert_ops *ops)
--
net/core/drop_monitor.c-1030-	unregister_trace_devlink_trap_report(ops->hw_trap_probe, NULL);
net/core/drop_monitor.c:1031:	tracepoint_synchronize_unregister();
net/core/drop_monitor.c-1032-}
--
net/core/drop_monitor.c=1190=static void net_dm_trace_off_set(void)
--
net/core/drop_monitor.c-1199-
net/core/drop_monitor.c:1200:	tracepoint_synchronize_unregister();
net/core/drop_monitor.c-1201-
]

151/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 37965
							output: 19
							thoughts: 4160
						

Thoughts:
**Analysis of Blktrace Tracepoint Registration and Synchronization**

Okay, here's what I've been thinking through. First, I confirmed that `tracepoint_synchronize_unregister()` is indeed called within `blk_unregister_tracepoints()` and that it's good practice. Then I systematically reviewed the 18 tracepoints registered in `blk_register_tracepoints()` and double-checked the unregistering process to confirm the matching between the registration and unregistration. I verified that the unregistration occurs in reverse order, which makes perfect sense. Furthermore, I went through the registration process within `blk_register_tracepoints()`. I confirmed that `tracepoint_synchronize_unregister()` is only executed if any tracepoint was registered (and thus needs to be unregistered). If a registration fails, the execution jumps to `out` and does not call `tracepoint_synchronize_unregister()`.

Next, I looked at the change in `get_probe_ref()`. The core of the change is correct: we now properly handle the failure of `blk_register_tracepoints()` by decrementing the reference count if the registration fails. This ensures that a failed registration doesn't leave the probe reference count in an inconsistent state, causing the system to possibly attempt unregistration when nothing was actually registered. I carefully analyzed the multi-threaded aspect, verifying the locking mechanism and making certain that there are no race conditions by analyzing its implementation, specifically related to the mutex and reference count handling. The updated code maintains thread safety by decrementing the reference count when registration fails inside the mutex, which is precisely what is needed.

Finally, I checked all the call sites to `get_probe_ref()` and double-checked the blktrace initialization path. I identified the call sites to ensure that the tracepoint registration and unregistration paths are appropriately managed. I will now search through the rest of the kernel for any other occurrences of these functions for good measure.



152/4 2026/08/31 21:30 tool grepper
0m Args:
map[Expression:get_probe_ref]

Results:
map[Output:kernel/trace/blktrace.c=469=static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
--
kernel/trace/blktrace.c-487-
kernel/trace/blktrace.c:488:static void get_probe_ref(void)
kernel/trace/blktrace.c-489-{
--
kernel/trace/blktrace.c=730=static void blk_trace_setup_finalize(struct request_queue *q,
--
kernel/trace/blktrace.c-758-	rcu_assign_pointer(q->blk_trace, bt);
kernel/trace/blktrace.c:759:	get_probe_ref();
kernel/trace/blktrace.c-760-}
--
kernel/trace/blktrace.c=1900=static int blk_trace_setup_queue(struct request_queue *q,
--
kernel/trace/blktrace.c-1919-	rcu_assign_pointer(q->blk_trace, bt);
kernel/trace/blktrace.c:1920:	get_probe_ref();
kernel/trace/blktrace.c-1921-	return 0;
]

153/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 42877
							output: 19
							thoughts: 20
						

Thoughts:
Here's my summary, as I understand it:

**Digging Deeper into Teardown with `put_probe_ref`**

Okay, so we're looking at the teardown process, and to get a more comprehensive grasp of how everything's cleaned up, I think we need to examine the `put_probe_ref` function, too. I already have a handle on the main teardown procedures, but `put_probe_ref` likely handles a crucial piece of the puzzle, especially when dealing with probe references. It could be responsible for managing memory, releasing resources, or performing other cleanup actions specific to those references. Understanding its role will give me a more complete picture of the whole teardown mechanism. I'll need to see how it integrates with the rest of the teardown process to identify any potential gaps or areas for optimization.



154/4 2026/08/31 21:30 tool grepper
0m Args:
map[Expression:put_probe_ref]

Results:
map[Output:kernel/trace/blktrace.c=488=static void get_probe_ref(void)
--
kernel/trace/blktrace.c-495-
kernel/trace/blktrace.c:496:static void put_probe_ref(void)
kernel/trace/blktrace.c-497-{
--
kernel/trace/blktrace.c=535=static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt)
--
kernel/trace/blktrace.c-539-	blk_trace_free(q, bt);
kernel/trace/blktrace.c:540:	put_probe_ref();
kernel/trace/blktrace.c-541-}
--
kernel/trace/blktrace.c=1880=static int blk_trace_remove_queue(struct request_queue *q)
--
kernel/trace/blktrace.c-1890-
kernel/trace/blktrace.c:1891:	put_probe_ref();
kernel/trace/blktrace.c-1892-	synchronize_rcu();
]

155/4 2026/08/31 21:30 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 43395
							output: 75
							thoughts: 59
						

Thoughts:
Here's my analysis of what I'm thinking about, presented as you requested:

**Investigating Block Trace Removal Procedures**

Alright, I need to get a clear picture of the cleanup process involved when a block trace is removed. My focus is going to be on understanding the mechanics of `blk_trace_cleanup` and `blk_trace_remove_queue`. I know there are specific aspects of these functions that are critical to my work.

To make sure I'm getting the right picture, I'm going to jump into the code and focus on the regions around lines 530-570 and then jump to lines 1870-1930. These sections usually hold the core logic I'm interested in, based on my past experience with the codebase. I expect to find the handling of resources, data structures, and any specific considerations for removing a trace.



156/4 2026/08/31 21:31 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:530 LineCount:40]

Results:
map[Contents: 530:		relay_flush(bt->rchan);
 531:	
 532:		return 0;
 533:	}
 534:	
 535:	static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt)
 536:	{
 537:		blk_trace_stop(bt);
 538:		synchronize_rcu();
 539:		blk_trace_free(q, bt);
 540:		put_probe_ref();
 541:	}
 542:	
 543:	static int __blk_trace_remove(struct request_queue *q)
 544:	{
 545:		struct blk_trace *bt;
 546:	
 547:		bt = rcu_replace_pointer(q->blk_trace, NULL,
 548:					 lockdep_is_held(&q->debugfs_mutex));
 549:		if (!bt)
 550:			return -EINVAL;
 551:	
 552:		blk_trace_cleanup(q, bt);
 553:	
 554:		return 0;
 555:	}
 556:	
 557:	int blk_trace_remove(struct request_queue *q)
 558:	{
 559:		int ret;
 560:	
 561:		blk_debugfs_lock_nomemsave(q);
 562:		ret = __blk_trace_remove(q);
 563:		blk_debugfs_unlock_nomemrestore(q);
 564:	
 565:		return ret;
 566:	}
 567:	EXPORT_SYMBOL_GPL(blk_trace_remove);
 568:	
 569:	static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
]

157/4 2026/08/31 21:31 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1870 LineCount:60]

Results:
map[Contents:1870:			queue_work(trace_init_wq, &blktrace_works);
1871:		} else {
1872:			ret = __init_blk_tracer();
1873:		}
1874:	
1875:		return ret;
1876:	}
1877:	
1878:	device_initcall(init_blk_tracer);
1879:	
1880:	static int blk_trace_remove_queue(struct request_queue *q)
1881:	{
1882:		struct blk_trace *bt;
1883:	
1884:		bt = rcu_replace_pointer(q->blk_trace, NULL,
1885:					 lockdep_is_held(&q->debugfs_mutex));
1886:		if (bt == NULL)
1887:			return -EINVAL;
1888:	
1889:		blk_trace_stop(bt);
1890:	
1891:		put_probe_ref();
1892:		synchronize_rcu();
1893:		blk_trace_free(q, bt);
1894:		return 0;
1895:	}
1896:	
1897:	/*
1898:	 * Setup everything required to start tracing
1899:	 */
1900:	static int blk_trace_setup_queue(struct request_queue *q,
1901:					 struct block_device *bdev)
1902:	{
1903:		struct blk_trace *bt = NULL;
1904:		int ret = -ENOMEM;
1905:	
1906:		bt = kzalloc_obj(*bt);
1907:		if (!bt)
1908:			return -ENOMEM;
1909:	
1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
]

158/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 45040
							output: 36
							thoughts: 823
						

Thoughts:
**Analyzing the `blk_trace_setup_queue` Function**

Okay, let's dive into how `blk_trace_setup_queue` actually functions. I need to understand its subtleties. First, I see the basic setup.  A `blk_trace` struct is allocated and initialized, which includes allocation of per-CPU message data. The device and activity mask are set, and then `blk_trace_setup_lba` is called.

The critical part jumps out: the call to `get_probe_ref()` happens *before* the `rcu_assign_pointer(q->blk_trace, bt)`.  Wait, is this order safe? If `get_probe_ref()` fails, `q->blk_trace` remains NULL. The code then jumps to `free_bt` and calls `blk_trace_free(q, bt)`. But is this sequence valid?

Ah, right! It *is* safe. Until `q->blk_trace` is assigned with `rcu_assign_pointer`, no block tracepoints will actually see the `blk_trace` structure.  Even if probes *are* registered, the `rcu_dereference(rq->q->blk_trace)` will still evaluate to NULL, causing probes to exit early. This means that a failure in `get_probe_ref()` doesn't leak an uninitialized structure. Furthermore, the code cleanly frees `bt` via `blk_trace_free(q, bt)` if `get_probe_ref()` fails, which is exactly what we want. The `put_probe_ref()` call is *not* necessary here because the `get_probe_ref()` function handles restoring the reference count on failure.

Now, let's verify `blk_trace_free`. It's crucial that this function is safe to call on a potentially partially initialized `bt`. Let's look at that function directly.

Okay, inside `blk_trace_free`: the code calls `relay_close(bt->rchan)`. In our case, `bt->rchan` is NULL. This means that we need to confirm `relay_close` can handle a NULL argument. Then we have a `dir` member to deal with: if `bt->dir` is set, there's debugfs cleanup. However, in our context `bt->dir` is NULL. After that, we have `free_percpu(bt->sequence)` and `free_percpu(bt->msg_data)`. Finally, `kfree(bt)`. The per-cpu allocations are the crucial points.

Therefore,  in `blk_trace_setup_queue`, `bt->rchan` is NULL, `bt->dir` is NULL, `bt->sequence` is NULL, and `bt->msg_data` is either allocated or NULL. So, the question remains: is `relay_close(NULL)` safe? I need to check the `relay_close` definition or references to verify this.



159/4 2026/08/31 21:31 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/trace/blktrace.c Name:relay_close]

Results:
map[SourceCode: 643:	/**
 644:	 *	relay_close - close the channel
 645:	 *	@chan: the channel
 646:	 *
 647:	 *	Closes all channel buffers and frees the channel.
 648:	 */
 649:	void relay_close(struct rchan *chan)
 650:	{
 651:		struct rchan_buf *buf;
 652:		unsigned int i;
 653:	
 654:		if (!chan)
 655:			return;
 656:	
 657:		mutex_lock(&relay_channels_mutex);
 658:		if (chan->is_global && (buf = *per_cpu_ptr(chan->buf, 0)))
 659:			relay_close_buf(buf);
 660:		else
 661:			for_each_possible_cpu(i)
 662:				if ((buf = *per_cpu_ptr(chan->buf, i)))
 663:					relay_close_buf(buf);
 664:	
 665:		list_del(&chan->list);
 666:		kref_put(&chan->kref, relay_destroy_channel);
 667:		mutex_unlock(&relay_channels_mutex);
 668:	}
 SourceFile:kernel/relay.c]

160/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 46926
							output: 38
							thoughts: 2806
						

Thoughts:
**Analysis of blktrace Setup and Cleanup**

Okay, so I've gone through the `blktrace` code to ensure everything is handled correctly, particularly regarding resource management. I've confirmed that `free_percpu(NULL)`, `kfree(NULL)`, and `relay_close(NULL)` are perfectly safe operations, as one would expect. Further, I've checked that `blk_trace_free(q, bt)` is already present and correctly used within `blk_trace_setup_queue()` at line 1924, specifically in the error path.

Now, the focus shifts to `blk_trace_setup_finalize()` and its callers. The logic within `blk_trace_setup_finalize()` itself appears sound; it populates the `blk_user_trace_setup2` structure, sets up trace parameters, and attempts to acquire a probe reference. The crucial aspect here is the RCU assignment of `q->blk_trace`. That will be important.

The next step is to examine the callers of `blk_trace_setup_finalize()`: `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. I read through the code of each of the callers.

In the first case, `blk_trace_setup`, I am meticulously reviewing the error handling paths.  Specifically, I see that if `blk_trace_setup_prepare` succeeds but `blk_trace_setup_finalize` fails, `blk_trace_free(q, bt)` *is* correctly called to clean up.  The key is that the assignment to `q->blk_trace` hasn't happened yet, so `blk_trace_free` on that `bt` will be safe. If `copy_to_user` fails *after* `blk_trace_setup_finalize` has succeeded, which means `q->blk_trace` was already set,  then `blk_trace_remove(q)` gets called. This is a crucial detail, as it ensures that if the setup appears to succeed, but the data copy to user fails, the trace is properly removed, including the decrementing of the probe reference.

I checked `blk_trace_setup2` and verified that `int ret;` is declared.

I also checked `compat_blk_trace_setup` and added the declaration.

Now, my attention is directed towards the `sysfs_blk_trace_attr_store` function (lines 2070-2160), which I need to check too.



161/4 2026/08/31 21:31 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:2070 LineCount:90]

Results:
map[Contents:2070:	
2071:	static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
2072:						  struct device_attribute *attr,
2073:						  const char *buf, size_t count)
2074:	{
2075:		struct block_device *bdev = dev_to_bdev(dev);
2076:		struct request_queue *q = bdev_get_queue(bdev);
2077:		struct blk_trace *bt;
2078:		unsigned int memflags;
2079:		u64 value;
2080:		ssize_t ret = -EINVAL;
2081:	
2082:		if (count == 0)
2083:			goto out;
2084:	
2085:		if (attr == &dev_attr_act_mask) {
2086:			if (kstrtoull(buf, 0, &value)) {
2087:				/* Assume it is a list of trace category names */
2088:				ret = blk_trace_str2mask(buf);
2089:				if (ret < 0)
2090:					goto out;
2091:				value = ret;
2092:			}
2093:		} else {
2094:			if (kstrtoull(buf, 0, &value))
2095:				goto out;
2096:		}
2097:	
2098:		memflags = blk_debugfs_lock(q);
2099:	
2100:		bt = rcu_dereference_protected(q->blk_trace,
2101:					       lockdep_is_held(&q->debugfs_mutex));
2102:		if (attr == &dev_attr_enable) {
2103:			if (!!value == !!bt) {
2104:				ret = 0;
2105:				goto out_unlock_bdev;
2106:			}
2107:			if (value)
2108:				ret = blk_trace_setup_queue(q, bdev);
2109:			else
2110:				ret = blk_trace_remove_queue(q);
2111:			goto out_unlock_bdev;
2112:		}
2113:	
2114:		ret = 0;
2115:		if (bt == NULL) {
2116:			ret = blk_trace_setup_queue(q, bdev);
2117:			bt = rcu_dereference_protected(q->blk_trace,
2118:					lockdep_is_held(&q->debugfs_mutex));
2119:		}
2120:	
2121:		if (ret == 0) {
2122:			if (attr == &dev_attr_act_mask)
2123:				bt->act_mask = value;
2124:			else if (attr == &dev_attr_pid)
2125:				bt->pid = value;
2126:			else if (attr == &dev_attr_start_lba)
2127:				bt->start_lba = value;
2128:			else if (attr == &dev_attr_end_lba)
2129:				bt->end_lba = value;
2130:		}
2131:	
2132:	out_unlock_bdev:
2133:		blk_debugfs_unlock(q, memflags);
2134:	out:
2135:		return ret ? ret : count;
2136:	}
2137:	#endif /* CONFIG_BLK_DEV_IO_TRACE */
2138:	
2139:	#ifdef CONFIG_EVENT_TRACING
2140:	
2141:	/**
2142:	 * blk_fill_rwbs - Fill the buffer rwbs by mapping op to character string.
2143:	 * @rwbs:	buffer to be filled
2144:	 * @opf:	request operation type (REQ_OP_XXX) and flags for the tracepoint
2145:	 *
2146:	 * Description:
2147:	 *     Maps each request operation and flag to a single character and fills the
2148:	 *     buffer provided by the caller with resulting string.
2149:	 *
2150:	 **/
2151:	void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
2152:	{
2153:		int i = 0;
2154:	
2155:		if (opf & REQ_PREFLUSH)
2156:			rwbs[i++] = 'F';
2157:	
2158:		switch (opf & REQ_OP_MASK) {
2159:		case REQ_OP_WRITE:
]

162/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 51647
							output: 32
							thoughts: 521
						

Thoughts:
**Analyzing `sysfs_blk_trace_attr_store()` and the Crash Report**

Okay, let's break this down. I'm looking at `sysfs_blk_trace_attr_store()`, specifically the code path where `blk_trace_setup_queue()` is called. It's clear that the return value of `blk_trace_setup_queue()` is crucial, stored in `ret`. If `ret` is non-zero, indicating an error, the function should return that error. The critical observation here is that the function then returns this error.

The crash report confirms that the issue stems from within `blk_trace_setup_queue()`, specifically when it calls `blk_register_tracepoints()`. The trace indicates the crash happened at line 2116 where `blk_trace_setup_queue(q, bdev)` was called.

The `WARN_ON(ret)` at line 1332 within `blk_register_tracepoints()` is the smoking gun – it suggests a registration issue. I've got to find the root cause for this registration failure. Since `blk_trace_setup_queue()` calls `blk_register_tracepoints()` which is the root cause, I need to check where `blk_register_tracepoints` is called, and why this is failing.



163/4 2026/08/31 21:31 tool grepper
0m Args:
map[Expression:register_trace PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:kernel/trace/blktrace.c=61=static int blk_probes_ref;
kernel/trace/blktrace.c-62-
kernel/trace/blktrace.c:63:static void blk_register_tracepoints(void);
kernel/trace/blktrace.c:64:static void blk_unregister_tracepoints(void);
kernel/trace/blktrace.c-65-
--
kernel/trace/blktrace.c=488=static void get_probe_ref(void)
--
kernel/trace/blktrace.c-491-	if (++blk_probes_ref == 1)
kernel/trace/blktrace.c:492:		blk_register_tracepoints();
kernel/trace/blktrace.c-493-	mutex_unlock(&blk_probe_mutex);
--
kernel/trace/blktrace.c=496=static void put_probe_ref(void)
--
kernel/trace/blktrace.c-499-	if (!--blk_probes_ref)
kernel/trace/blktrace.c:500:		blk_unregister_tracepoints();
kernel/trace/blktrace.c-501-	mutex_unlock(&blk_probe_mutex);
--
kernel/trace/blktrace.c=1325=EXPORT_SYMBOL_GPL(blk_add_driver_data);
kernel/trace/blktrace.c-1326-
kernel/trace/blktrace.c:1327:static void blk_register_tracepoints(void)
kernel/trace/blktrace.c-1328-{
--
kernel/trace/blktrace.c-1330-
kernel/trace/blktrace.c:1331:	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1332-	WARN_ON(ret);
kernel/trace/blktrace.c:1333:	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c-1334-	WARN_ON(ret);
kernel/trace/blktrace.c:1335:	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c-1336-	WARN_ON(ret);
kernel/trace/blktrace.c:1337:	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c-1338-	WARN_ON(ret);
kernel/trace/blktrace.c:1339:	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c-1340-	WARN_ON(ret);
kernel/trace/blktrace.c:1341:	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c-1342-	WARN_ON(ret);
kernel/trace/blktrace.c:1343:	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c-1344-	WARN_ON(ret);
kernel/trace/blktrace.c:1345:	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c-1346-	WARN_ON(ret);
kernel/trace/blktrace.c:1347:	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c-1348-	WARN_ON(ret);
kernel/trace/blktrace.c:1349:	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c-1350-	WARN_ON(ret);
kernel/trace/blktrace.c:1351:	ret = register_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1352-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c-1353-	WARN_ON(ret);
kernel/trace/blktrace.c:1354:	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
kernel/trace/blktrace.c-1355-						     NULL);
kernel/trace/blktrace.c-1356-	WARN_ON(ret);
kernel/trace/blktrace.c:1357:	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
kernel/trace/blktrace.c-1358-						NULL);
kernel/trace/blktrace.c-1359-	WARN_ON(ret);
kernel/trace/blktrace.c:1360:	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c-1361-	WARN_ON(ret);
kernel/trace/blktrace.c:1362:	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c-1363-	WARN_ON(ret);
kernel/trace/blktrace.c:1364:	ret = register_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c-1365-	WARN_ON(ret);
kernel/trace/blktrace.c:1366:	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c-1367-	WARN_ON(ret);
kernel/trace/blktrace.c:1368:	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c-1369-	WARN_ON(ret);
--
kernel/trace/blktrace.c-1371-
kernel/trace/blktrace.c:1372:static void blk_unregister_tracepoints(void)
kernel/trace/blktrace.c-1373-{
kernel/trace/blktrace.c:1374:	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c:1375:	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c:1376:	unregister_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c:1377:	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c:1378:	unregister_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c:1379:	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
kernel/trace/blktrace.c:1380:	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
kernel/trace/blktrace.c:1381:	unregister_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1382-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c:1383:	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c:1384:	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c:1385:	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c:1386:	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c:1387:	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c:1388:	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c:1389:	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c:1390:	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c:1391:	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c:1392:	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1393-
--
kernel/trace/blktrace.c=1839=static int __init __init_blk_tracer(void)
kernel/trace/blktrace.c-1840-{
kernel/trace/blktrace.c:1841:	if (!register_trace_event(&trace_blk_event)) {
kernel/trace/blktrace.c-1842-		pr_warn("Warning: could not register block events\n");
--
kernel/trace/blktrace.c-1845-
kernel/trace/blktrace.c:1846:	if (register_tracer(&blk_tracer) != 0) {
kernel/trace/blktrace.c-1847-		pr_warn("Warning: could not register the block tracer\n");
kernel/trace/blktrace.c:1848:		unregister_trace_event(&trace_blk_event);
kernel/trace/blktrace.c-1849-		return 1;
]

164/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 55196
							output: 19
							thoughts: 45
						

Thoughts:
Okay, here's my thought process on this, presented as a first-person expert summary:

**Digging into Block Trace Calls**

Right, so I need to understand the scope of these `blk_trace` functions. My first instinct is to see how extensively they're being utilized within the codebase. I need to get a handle on all the call sites for things like `blk_trace_setup`, `blk_trace_remove`, and the other related functions. The goal here is a quick overview of how the tracing system is integrated.

Therefore, I'm going to kick off a search directly within the repository. Let's start with a broad search for `blk_trace_setup`. That will give me a baseline to work from; a kind of inventory of where this function is being called. From there, I can refine the search if necessary, looking for related calls or specific usage patterns. I'll take notes, of course, because this sort of thing requires keeping track of the details.



165/4 2026/08/31 21:31 tool grepper
0m Args:
map[Expression:blk_trace_setup]

Results:
map[Output:drivers/scsi/sg.c=914=sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
--
drivers/scsi/sg.c-1114-	case BLKTRACESETUP:
drivers/scsi/sg.c:1115:		return blk_trace_setup(sdp->device->request_queue, sdp->name,
drivers/scsi/sg.c-1116-				       MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
--
include/linux/blktrace_api.h=76=extern void blk_add_driver_data(struct request *rq, void *data, size_t len);
include/linux/blktrace_api.h:77:extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
include/linux/blktrace_api.h-78-			   struct block_device *bdev,
--
include/linux/blktrace_api.h=81=extern int blk_trace_remove(struct request_queue *q);
--
include/linux/blktrace_api.h-86-# define blk_add_driver_data(rq, data, len)		do {} while (0)
include/linux/blktrace_api.h:87:# define blk_trace_setup(q, name, dev, bdev, arg)	(-ENOTTY)
include/linux/blktrace_api.h-88-# define blk_trace_startstop(q, start)			(-ENOTTY)
--
kernel/trace/blktrace.c=310=static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
--
kernel/trace/blktrace.c-397-			 * For sysfs-enabled tracing path (enabled via
kernel/trace/blktrace.c:398:			 * /sys/block/DEV/trace/enable), blk_trace_setup_queue()
kernel/trace/blktrace.c-399-			 * never initializes bt->version, leaving it 0 from
--
kernel/trace/blktrace.c=632=static const struct rchan_callbacks blk_relay_callbacks = {
--
kernel/trace/blktrace.c-636-
kernel/trace/blktrace.c:637:static void blk_trace_setup_lba(struct blk_trace *bt,
kernel/trace/blktrace.c-638-				struct block_device *bdev)
--
kernel/trace/blktrace.c-651- */
kernel/trace/blktrace.c:652:static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
kernel/trace/blktrace.c-653-						 char *name, dev_t dev,
--
kernel/trace/blktrace.c-719-
kernel/trace/blktrace.c:720:	blk_trace_setup_lba(bt, bdev);
kernel/trace/blktrace.c-721-
--
kernel/trace/blktrace.c-729-
kernel/trace/blktrace.c:730:static void blk_trace_setup_finalize(struct request_queue *q,
kernel/trace/blktrace.c-731-				     char *name, int version,
--
kernel/trace/blktrace.c-761-
kernel/trace/blktrace.c:762:int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
kernel/trace/blktrace.c-763-		    struct block_device *bdev,
--
kernel/trace/blktrace.c-788-	memflags = blk_debugfs_lock(q);
kernel/trace/blktrace.c:789:	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
kernel/trace/blktrace.c-790-				     bdev);
--
kernel/trace/blktrace.c-794-	}
kernel/trace/blktrace.c:795:	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
kernel/trace/blktrace.c-796-	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
--
kernel/trace/blktrace.c-804-}
kernel/trace/blktrace.c:805:EXPORT_SYMBOL_GPL(blk_trace_setup);
kernel/trace/blktrace.c-806-
kernel/trace/blktrace.c:807:static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
kernel/trace/blktrace.c-808-			    struct block_device *bdev, char __user *arg)
--
kernel/trace/blktrace.c-823-	memflags = blk_debugfs_lock(q);
kernel/trace/blktrace.c:824:	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
kernel/trace/blktrace.c-825-				     bdev);
--
kernel/trace/blktrace.c-829-	}
kernel/trace/blktrace.c:830:	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
kernel/trace/blktrace.c-831-	blk_debugfs_unlock(q, memflags);
--
kernel/trace/blktrace.c-840-#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
kernel/trace/blktrace.c:841:static int compat_blk_trace_setup(struct request_queue *q, char *name,
kernel/trace/blktrace.c-842-				  dev_t dev, struct block_device *bdev,
--
kernel/trace/blktrace.c-865-	memflags = blk_debugfs_lock(q);
kernel/trace/blktrace.c:866:	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
kernel/trace/blktrace.c-867-				     bdev);
--
kernel/trace/blktrace.c-871-	}
kernel/trace/blktrace.c:872:	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
kernel/trace/blktrace.c-873-	blk_debugfs_unlock(q, memflags);
--
kernel/trace/blktrace.c=924=int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
--
kernel/trace/blktrace.c-932-		snprintf(b, sizeof(b), "%pg", bdev);
kernel/trace/blktrace.c:933:		ret = blk_trace_setup2(q, b, bdev->bd_dev, bdev, arg);
kernel/trace/blktrace.c-934-		break;
--
kernel/trace/blktrace.c-936-		snprintf(b, sizeof(b), "%pg", bdev);
kernel/trace/blktrace.c:937:		ret = blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
kernel/trace/blktrace.c-938-		break;
--
kernel/trace/blktrace.c-941-		snprintf(b, sizeof(b), "%pg", bdev);
kernel/trace/blktrace.c:942:		ret = compat_blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
kernel/trace/blktrace.c-943-		break;
--
kernel/trace/blktrace.c=1880=static int blk_trace_remove_queue(struct request_queue *q)
--
kernel/trace/blktrace.c-1899- */
kernel/trace/blktrace.c:1900:static int blk_trace_setup_queue(struct request_queue *q,
kernel/trace/blktrace.c-1901-				 struct block_device *bdev)
--
kernel/trace/blktrace.c-1916-
kernel/trace/blktrace.c:1917:	blk_trace_setup_lba(bt, bdev);
kernel/trace/blktrace.c-1918-
--
kernel/trace/blktrace.c=2071=static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
--
kernel/trace/blktrace.c-2107-		if (value)
kernel/trace/blktrace.c:2108:			ret = blk_trace_setup_queue(q, bdev);
kernel/trace/blktrace.c-2109-		else
--
kernel/trace/blktrace.c-2115-	if (bt == NULL) {
kernel/trace/blktrace.c:2116:		ret = blk_trace_setup_queue(q, bdev);
kernel/trace/blktrace.c-2117-		bt = rcu_dereference_protected(q->blk_trace,
]

166/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 57920
							output: 86
							thoughts: 4257
						

Thoughts:
**Analyzing Block Tracepoint Registration and Setup**

Alright, let's break this down. My primary concern here is ensuring the correctness and safety of the block tracepoint registration and setup process within the kernel. I've reviewed `blk_register_tracepoints()` and `blk_unregister_tracepoints()` meticulously. The core function, `blk_register_tracepoints()`, registers a series of tracepoints related to block I/O operations (request insertion, issue, merge, requeue, completion, bio operations, zone operations, etc.). The critical aspect is the error handling using `goto` statements. If a registration fails, the code *must* unregister any previously registered tracepoints in reverse order to maintain consistency and prevent leaks. The unwinding order of `unregister_*` functions is crucial, and a direct comparison shows a perfect match between registration and unregistration sequences.

I've confirmed the matching sequence of registration and unregistration. This is a common pattern, but it *must* be perfect to avoid issues.

Next, I examined `get_probe_ref()` and `blk_trace_setup_finalize()`. The use of a mutex (`blk_probe_mutex`) for reference counting (`blk_probes_ref`) ensures that the tracepoints are only registered when they're actually needed. The `get_probe_ref()` function increments this reference count and *conditionally* calls `blk_register_tracepoints()` only if the count goes from 0 to 1. The reverse happens in `put_probe_ref()`. The critical bit is the placement of `get_probe_ref()` *before* `rcu_assign_pointer(q->blk_trace, bt)`. I wanted to make sure that the tracepoints are active *before* the setup is considered complete. This ordering ensures that tracing is only enabled if the registration of tracepoints is successful. If `get_probe_ref()` fails (tracepoint registration fails), the device is never actually enabled and the trace setup is cleaned up.

Finally, I considered the various callers of `blk_trace_setup_finalize()`: `blk_trace_setup`, `blk_trace_setup2`, `compat_blk_trace_setup`, and `blk_trace_setup_queue`. All of these call paths appear to be sound and consistent with the intended design. They all follow the same pattern of setting up the tracing structure and then calling `blk_trace_setup_finalize()` to finalize the setup. They all handle errors correctly by cleaning up the allocated resources (most importantly, by calling `blk_trace_free()`). `blk_trace_setup_queue()` appears to be an internal setup which just directly creates a trace instance when creating a queue.

Overall, everything appears to be correct and well-handled. The checks and error handling are robust. The critical ordering of registration, reference counting, and assignment to the request queue all contribute to a clean and safe tracing mechanism.



167/4 2026/08/31 21:31 tool codeeditor
0m Args:
map[CurrentCode:static void blk_register_tracepoints(void);
static void blk_unregister_tracepoints(void); NewCode:static int blk_register_tracepoints(void);
static void blk_unregister_tracepoints(void); SourceFile:kernel/trace/blktrace.c]

Results:
map[]

168/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 62891
							output: 37
							thoughts: 39
						

Thoughts:
Okay, here's my interpretation of those thoughts, presented as a personal thought process, as requested:

**Updating `get_probe_ref`**

Alright, time to dive into that `get_probe_ref` function, specifically lines 488-494. Before I make any changes, though, I always like to get a solid grasp of the surrounding context. So, let's take a quick look at the larger section, say from line 485 to 505. That should give me the necessary information to ensure any modifications I make are sound and don't introduce unexpected side effects within this critical piece of code. Context is king, as usual!



169/4 2026/08/31 21:31 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:485 LineCount:20]

Results:
map[Contents: 485:		kfree(bt);
 486:	}
 487:	
 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
 495:	
 496:	static void put_probe_ref(void)
 497:	{
 498:		mutex_lock(&blk_probe_mutex);
 499:		if (!--blk_probes_ref)
 500:			blk_unregister_tracepoints();
 501:		mutex_unlock(&blk_probe_mutex);
 502:	}
 503:	
 504:	static int blk_trace_start(struct blk_trace *bt)
]

170/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 63389
							output: 193
							thoughts: 16
						

Thoughts:
Here's my summary, as though I were thinking through the process:

**Refactoring `get_probe_ref` with `codeeditor`**

Okay, time to get this done. I need to make some changes to `get_probe_ref`, and the most efficient way is definitely going to be using `codeeditor`. It's my go-to for these kinds of edits, so I'll fire it up and get started. Let's see what needs to be changed and make this as seamless as possible. I'll make sure to double check any dependencies after this, as always.



171/4 2026/08/31 21:31 tool codeeditor
0m Args:
map[CurrentCode:static void get_probe_ref(void)
{
	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1)
		blk_register_tracepoints();
	mutex_unlock(&blk_probe_mutex);
} NewCode:static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
} SourceFile:kernel/trace/blktrace.c]

Results:
map[]

172/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 63733
							output: 74
							thoughts: 60
						

Thoughts:
Here's my summary, as though I'm thinking through this myself:

**Diving into Block Trace Setup**

Okay, time to dig into the trace setup code. I need to get a firm grasp on how this all works. Right now, I'm thinking I should start by examining `blk_trace_setup_finalize`, `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. These seem like the core entry points, so understanding their interactions is key. Let's see...I'm going to pull up the source code and I'll focus on lines 730 to 885 with `read-file`. This should give me a solid chunk to work with and give me a good handle on how the initialization and finalization are handled.



173/4 2026/08/31 21:31 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:730 LineCount:80]

Results:
map[Contents: 730:	static void blk_trace_setup_finalize(struct request_queue *q,
 731:					     char *name, int version,
 732:					     struct blk_trace *bt,
 733:					     struct blk_user_trace_setup2 *buts)
 734:	
 735:	{
 736:		strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 737:	
 738:		/*
 739:		 * some device names have larger paths - convert the slashes
 740:		 * to underscores for this to work as expected
 741:		 */
 742:		strreplace(buts->name, '/', '_');
 743:	
 744:		bt->version = version;
 745:		bt->act_mask = buts->act_mask;
 746:		if (!bt->act_mask)
 747:			bt->act_mask = (u16) -1;
 748:	
 749:		/* overwrite with user settings */
 750:		if (buts->start_lba)
 751:			bt->start_lba = buts->start_lba;
 752:		if (buts->end_lba)
 753:			bt->end_lba = buts->end_lba;
 754:	
 755:		bt->pid = buts->pid;
 756:		bt->trace_state = Blktrace_setup;
 757:	
 758:		rcu_assign_pointer(q->blk_trace, bt);
 759:		get_probe_ref();
 760:	}
 761:	
 762:	int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 763:			    struct block_device *bdev,
 764:			    char __user *arg)
 765:	{
 766:		struct blk_user_trace_setup2 buts2;
 767:		struct blk_user_trace_setup buts;
 768:		struct blk_trace *bt;
 769:		unsigned int memflags;
 770:		int ret;
 771:	
 772:		ret = copy_from_user(&buts, arg, sizeof(buts));
 773:		if (ret)
 774:			return -EFAULT;
 775:	
 776:		if (!buts.buf_size || !buts.buf_nr)
 777:			return -EINVAL;
 778:	
 779:		buts2 = (struct blk_user_trace_setup2) {
 780:			.act_mask = buts.act_mask,
 781:			.buf_size = buts.buf_size,
 782:			.buf_nr = buts.buf_nr,
 783:			.start_lba = buts.start_lba,
 784:			.end_lba = buts.end_lba,
 785:			.pid = buts.pid,
 786:		};
 787:	
 788:		memflags = blk_debugfs_lock(q);
 789:		bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 790:					     bdev);
 791:		if (IS_ERR(bt)) {
 792:			blk_debugfs_unlock(q, memflags);
 793:			return PTR_ERR(bt);
 794:		}
 795:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 796:		strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 797:		blk_debugfs_unlock(q, memflags);
 798:	
 799:		if (copy_to_user(arg, &buts, sizeof(buts))) {
 800:			blk_trace_remove(q);
 801:			return -EFAULT;
 802:		}
 803:		return 0;
 804:	}
 805:	EXPORT_SYMBOL_GPL(blk_trace_setup);
 806:	
 807:	static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 808:				    struct block_device *bdev, char __user *arg)
 809:	{
]

174/4 2026/08/31 21:31 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:810 LineCount:80]

Results:
map[Contents: 810:		struct blk_user_trace_setup2 buts2;
 811:		struct blk_trace *bt;
 812:		unsigned int memflags;
 813:	
 814:		if (copy_from_user(&buts2, arg, sizeof(buts2)))
 815:			return -EFAULT;
 816:	
 817:		if (!buts2.buf_size || !buts2.buf_nr)
 818:			return -EINVAL;
 819:	
 820:		if (buts2.flags != 0)
 821:			return -EINVAL;
 822:	
 823:		memflags = blk_debugfs_lock(q);
 824:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 825:					     bdev);
 826:		if (IS_ERR(bt)) {
 827:			blk_debugfs_unlock(q, memflags);
 828:			return PTR_ERR(bt);
 829:		}
 830:		blk_trace_setup_finalize(q, name, 2, bt, &buts2);
 831:		blk_debugfs_unlock(q, memflags);
 832:	
 833:		if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 834:			blk_trace_remove(q);
 835:			return -EFAULT;
 836:		}
 837:		return 0;
 838:	}
 839:	
 840:	#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 841:	static int compat_blk_trace_setup(struct request_queue *q, char *name,
 842:					  dev_t dev, struct block_device *bdev,
 843:					  char __user *arg)
 844:	{
 845:		struct blk_user_trace_setup2 buts2;
 846:		struct compat_blk_user_trace_setup cbuts;
 847:		struct blk_trace *bt;
 848:		unsigned int memflags;
 849:	
 850:		if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 851:			return -EFAULT;
 852:	
 853:		if (!cbuts.buf_size || !cbuts.buf_nr)
 854:			return -EINVAL;
 855:	
 856:		buts2 = (struct blk_user_trace_setup2) {
 857:			.act_mask = cbuts.act_mask,
 858:			.buf_size = cbuts.buf_size,
 859:			.buf_nr = cbuts.buf_nr,
 860:			.start_lba = cbuts.start_lba,
 861:			.end_lba = cbuts.end_lba,
 862:			.pid = cbuts.pid,
 863:		};
 864:	
 865:		memflags = blk_debugfs_lock(q);
 866:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 867:					     bdev);
 868:		if (IS_ERR(bt)) {
 869:			blk_debugfs_unlock(q, memflags);
 870:			return PTR_ERR(bt);
 871:		}
 872:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 873:		blk_debugfs_unlock(q, memflags);
 874:	
 875:		if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 876:			blk_trace_remove(q);
 877:			return -EFAULT;
 878:		}
 879:	
 880:		return 0;
 881:	}
 882:	#endif
 883:	
 884:	static int __blk_trace_startstop(struct request_queue *q, int start)
 885:	{
 886:		struct blk_trace *bt;
 887:	
 888:		bt = rcu_dereference_protected(q->blk_trace,
 889:					       lockdep_is_held(&q->debugfs_mutex));
]

175/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 66582
							output: 640
							thoughts: 1541
						

Thoughts:
**Analyzing blk-trace Setup and Finalization**

Okay, let's dive into these functions. I'm focusing on `blk_trace_setup_finalize`, `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. I see a clear sequence here, a common pattern that's worth noting.

First, I'm checking out `blk_trace_setup_finalize`. This function seems to be the core of the setup process. It takes a `request_queue`, a name, a version, a `blk_trace` structure, and a `blk_user_trace_setup2` structure. It copies the provided name into the `buts->name` field, crucially replacing any forward slashes with underscores. I know this is to avoid issues with some device names, which makes sense. Then, the version and activity mask (`act_mask`) are set in the `blk_trace` structure.  If `act_mask` is zero, a default value of -1 (all bits set) is assigned, so it covers all requests.  Next, user-provided values for `start_lba`, `end_lba`, and the process ID (`pid`) are applied. It also sets the state to `Blktrace_setup`. Crucially, there's a reference count managed via `get_probe_ref()`. The final step is assigning the `blk_trace` structure to the `request_queue`, using `rcu_assign_pointer`.

Now, looking at `blk_trace_setup`, this function seems to be the entry point for version 1. It calls `blk_debugfs_lock` to protect the critical sections. It calls `blk_trace_setup_prepare` which handles some of the pre-allocation tasks. It then calls `blk_trace_setup_finalize`. If there are any errors during `blk_trace_setup_finalize`, it cleans up any allocated resources before returning.  After a successful finalize call, it copies the device name from the `buts2` structure back into the `buts` structure, and unlocks the debugfs.

Next, I'm examining `blk_trace_setup2`, which seems to be the entry point for version 2. It also acquires the debugfs lock and does some basic input validation on `buts2` (checking for valid `buf_size` and `buf_nr` values, and ensuring the `flags` field is zero). Then, it also calls `blk_trace_setup_prepare`, and ultimately `blk_trace_setup_finalize`. I can see the pattern is very similar, just the arguments have been passed differently. The main difference is the copying back of the `buts2` structure to the user space.

Finally, `compat_blk_trace_setup` handles compatibility with older versions, specifically for 64-bit systems.  It receives a `compat_blk_user_trace_setup` structure. This function converts the old structure into the new `blk_user_trace_setup2` format. This looks like a shim, translating the old data format to the new one. The rest of this function's code flow is like the above two, `blk_trace_setup_prepare`, `blk_trace_setup_finalize`, then locking and unlocking debugfs. The `copy_to_user` here copies the device name back, and no additional fields.

So, the pattern is: lock, prepare, finalize, unlock, with appropriate error handling and resource cleanup throughout. The main job of these functions is to set up a `blk_trace` structure, assign it to a `request_queue`, and handle user-provided configuration.



176/4 2026/08/31 21:31 tool codeeditor
0m Args:
map[CurrentCode:static void blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)

{
	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);

	/*
	 * some device names have larger paths - convert the slashes
	 * to underscores for this to work as expected
	 */
	strreplace(buts->name, '/', '_');

	bt->version = version;
	bt->act_mask = buts->act_mask;
	if (!bt->act_mask)
		bt->act_mask = (u16) -1;

	/* overwrite with user settings */
	if (buts->start_lba)
		bt->start_lba = buts->start_lba;
	if (buts->end_lba)
		bt->end_lba = buts->end_lba;

	bt->pid = buts->pid;
	bt->trace_state = Blktrace_setup;

	rcu_assign_pointer(q->blk_trace, bt);
	get_probe_ref();
} NewCode:static int blk_trace_setup_finalize(struct request_queue *q,
				    char *name, int version,
				    struct blk_trace *bt,
				    struct blk_user_trace_setup2 *buts)

{
	int ret;

	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);

	/*
	 * some device names have larger paths - convert the slashes
	 * to underscores for this to work as expected
	 */
	strreplace(buts->name, '/', '_');

	bt->version = version;
	bt->act_mask = buts->act_mask;
	if (!bt->act_mask)
		bt->act_mask = (u16) -1;

	/* overwrite with user settings */
	if (buts->start_lba)
		bt->start_lba = buts->start_lba;
	if (buts->end_lba)
		bt->end_lba = buts->end_lba;

	bt->pid = buts->pid;
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
} SourceFile:kernel/trace/blktrace.c]

Results:
map[]

177/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 69563
							output: 382
							thoughts: 26
						

Thoughts:
Here's my take on those thoughts, tailored for an expert like yourself:

**Refactoring Block Tracing Initialization**

Alright, let's get down to brass tacks. I'm focusing on the setup procedures for block tracing, specifically `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. I see a potential for streamlining or consolidation here. I need to dive into the internals of these functions and understand their individual roles and overlapping functionality. My initial hunch is there's probably some redundant code, especially if we're dealing with older compatibility modes.

The key questions I'm asking myself are: Are there opportunities to avoid code duplication across these functions? Can I make the control flow easier to follow, maybe even eliminate the distinct '2' variant by merging it with the first one and incorporating all features in the core one? Does `compat_blk_trace_setup` still need to exist, or can its functionality be subsumed elsewhere, perhaps with a more elegant compatibility layer? I'll be paying close attention to any conditional logic dependent on specific kernel versions or configuration options, as that will drive any potential refactoring strategy. We want to clean this up, increase its performance and make it more manageable for future developments.



178/4 2026/08/31 21:31 tool codeeditor
0m Args:
map[CurrentCode:	memflags = blk_debugfs_lock(q);
	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
				     bdev);
	if (IS_ERR(bt)) {
		blk_debugfs_unlock(q, memflags);
		return PTR_ERR(bt);
	}
	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
	blk_debugfs_unlock(q, memflags); NewCode:	memflags = blk_debugfs_lock(q);
	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
				     bdev);
	if (IS_ERR(bt)) {
		blk_debugfs_unlock(q, memflags);
		return PTR_ERR(bt);
	}
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
	blk_debugfs_unlock(q, memflags); SourceFile:kernel/trace/blktrace.c]

Results:
map[]

179/4 2026/08/31 21:31 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 70245
							output: 1760
							thoughts: 23
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Diving into blk_trace_setup2 and Compat Considerations**

Right, let's get down to brass tacks. I'm going to jump into `blk_trace_setup2` and `compat_blk_trace_setup`. These are the core functions for initializing and configuring block trace setups, and naturally, compatibility has to be a top concern. I need to refresh my memory on the interactions with the underlying trace infrastructure – specifically, how we handle the trace buffer, the filters, and the control mechanisms. There's a high probability I'll need to double check the differences between these versions, including any changes in data structures or argument passing, especially regarding the 'compat' aspects. Ensuring that the new version doesn't break the compatibility of the older version will be a priority. I'll need to carefully review how the user-space interface interacts, too. Specifically, I should look into the control files, the format of trace events, and the potential for any discrepancies across kernel versions. In the back of my mind, I'm already anticipating the typical race conditions and locking complexities in any tracing setup – the challenges in guaranteeing atomic updates, particularly when dealing with concurrent access from multiple CPUs or processes. I'm thinking about the potential need for read-copy-update (RCU) or other synchronization primitives. Time to grab the code and start digging!



180/4 2026/08/31 21:32 tool codeeditor
0m Args:
map[CurrentCode:static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
				    struct block_device *bdev, char __user *arg)
{
	struct blk_user_trace_setup2 buts2;
	struct blk_trace *bt;
	unsigned int memflags;

	if (copy_from_user(&buts2, arg, sizeof(buts2)))
		return -EFAULT;

	if (!buts2.buf_size || !buts2.buf_nr)
		return -EINVAL;

	if (buts2.flags != 0)
		return -EINVAL;

	memflags = blk_debugfs_lock(q);
	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
				     bdev);
	if (IS_ERR(bt)) {
		blk_debugfs_unlock(q, memflags);
		return PTR_ERR(bt);
	}
	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
	blk_debugfs_unlock(q, memflags);

	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
		blk_trace_remove(q);
		return -EFAULT;
	}
	return 0;
}

#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
static int compat_blk_trace_setup(struct request_queue *q, char *name,
				  dev_t dev, struct block_device *bdev,
				  char __user *arg)
{
	struct blk_user_trace_setup2 buts2;
	struct compat_blk_user_trace_setup cbuts;
	struct blk_trace *bt;
	unsigned int memflags;

	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
		return -EFAULT;

	if (!cbuts.buf_size || !cbuts.buf_nr)
		return -EINVAL;

	buts2 = (struct blk_user_trace_setup2) {
		.act_mask = cbuts.act_mask,
		.buf_size = cbuts.buf_size,
		.buf_nr = cbuts.buf_nr,
		.start_lba = cbuts.start_lba,
		.end_lba = cbuts.end_lba,
		.pid = cbuts.pid,
	};

	memflags = blk_debugfs_lock(q);
	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
				     bdev);
	if (IS_ERR(bt)) {
		blk_debugfs_unlock(q, memflags);
		return PTR_ERR(bt);
	}
	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	blk_debugfs_unlock(q, memflags);

	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
		blk_trace_remove(q);
		return -EFAULT;
	}

	return 0;
}
#endif NewCode:static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
				    struct block_device *bdev, char __user *arg)
{
	struct blk_user_trace_setup2 buts2;
	struct blk_trace *bt;
	unsigned int memflags;
	int ret;

	if (copy_from_user(&buts2, arg, sizeof(buts2)))
		return -EFAULT;

	if (!buts2.buf_size || !buts2.buf_nr)
		return -EINVAL;

	if (buts2.flags != 0)
		return -EINVAL;

	memflags = blk_debugfs_lock(q);
	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
				     bdev);
	if (IS_ERR(bt)) {
		blk_debugfs_unlock(q, memflags);
		return PTR_ERR(bt);
	}
	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
	blk_debugfs_unlock(q, memflags);

	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
		blk_trace_remove(q);
		return -EFAULT;
	}
	return 0;
}

#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
static int compat_blk_trace_setup(struct request_queue *q, char *name,
				  dev_t dev, struct block_device *bdev,
				  char __user *arg)
{
	struct blk_user_trace_setup2 buts2;
	struct compat_blk_user_trace_setup cbuts;
	struct blk_trace *bt;
	unsigned int memflags;
	int ret;

	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
		return -EFAULT;

	if (!cbuts.buf_size || !cbuts.buf_nr)
		return -EINVAL;

	buts2 = (struct blk_user_trace_setup2) {
		.act_mask = cbuts.act_mask,
		.buf_size = cbuts.buf_size,
		.buf_nr = cbuts.buf_nr,
		.start_lba = cbuts.start_lba,
		.end_lba = cbuts.end_lba,
		.pid = cbuts.pid,
	};

	memflags = blk_debugfs_lock(q);
	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
				     bdev);
	if (IS_ERR(bt)) {
		blk_debugfs_unlock(q, memflags);
		return PTR_ERR(bt);
	}
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
	blk_debugfs_unlock(q, memflags);

	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
		blk_trace_remove(q);
		return -EFAULT;
	}

	return 0;
}
#endif SourceFile:kernel/trace/blktrace.c]

Results:
map[]

181/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 72338
							output: 38
							thoughts: 44
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Analyzing `blk_register_tracepoints`**

Right, let's zero in on `blk_register_tracepoints`. Specifically, I'm going to jump to that function around line 1327. I want to get a good overview of what's happening there, so I'll quickly use `read-file` to get a look at the code block spanning lines 1325 to 1398. That should give me enough context to understand the surrounding logic and the core of what `blk_register_tracepoints` is doing. I need to refresh my memory on the interactions of those tracepoints within this module.



182/4 2026/08/31 21:32 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1325 LineCount:75]

Results:
map[Contents:1325:	EXPORT_SYMBOL_GPL(blk_add_driver_data);
1326:	
1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
1377:		unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
1378:		unregister_trace_block_plug(blk_add_trace_plug, NULL);
1379:		unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
1380:		unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
1381:		unregister_trace_blk_zone_append_update_request_bio(
1382:			blk_add_trace_zone_update_request, NULL);
1383:		unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
1384:		unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1385:		unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1386:		unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1387:		unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1388:		unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1389:		unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1390:		unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1391:		unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1392:		unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1393:	
1394:		tracepoint_synchronize_unregister();
1395:	}
1396:	
1397:	/*
1398:	 * struct blk_io_tracer formatting routines
1399:	 */
]

183/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 74147
							output: 2036
							thoughts: 1777
						

Thoughts:
**Analyzing Tracepoint Registration and Unregistration in blk_register_tracepoints**

Okay, let's dive into this `blk_register_tracepoints` function. My primary concern here is the integrity of the tracepoint system within the block layer, ensuring each registration has a corresponding unregistration, and that everything handles errors gracefully.

First, I'm noting the sequence of 18 tracepoint registrations. Each call, such as `register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL)`, has a corresponding conditional jump to an `out_` label if the registration fails. The `NULL` argument suggests these tracepoints are not associated with any specific data.

Now, the error handling is where the real interesting stuff is: The `out_` labels, `out_bio_remap`, `out_split`, etc. These form a cascade of unregistrations. If registration 18 fails, we jump to `out_bio_remap` and *first* unregister 17 and work back.  Essentially, if *any* registration fails, the code ensures that *all* subsequent registrations are rolled back in reverse order, which is the correct pattern. `tracepoint_synchronize_unregister()` is called at the end, which is important to clean up properly.

It is critical that we have this error unwind logic.  Without it, we could have a partially registered system, leaving us with a corrupted tracing state, which would be a nightmare to debug.

Finally, I'm checking the formatting. I've noted a few lines with long function names like `register_trace_blk_zone_append_update_request_bio()` and their unregister counterparts, which need to be checked against kernel style guidelines regarding line wrapping, to ensure readability.

The core logic appears sound, but a quick `codeeditor` edit would align any stylistic inconsistencies.



184/4 2026/08/31 21:32 tool codeeditor
0m Args:
map[CurrentCode:static void blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
	WARN_ON(ret);
	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
	WARN_ON(ret);
	ret = register_trace_blk_zone_append_update_request_bio(
		blk_add_trace_zone_update_request, NULL);
	WARN_ON(ret);
	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
						     NULL);
	WARN_ON(ret);
	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
						NULL);
	WARN_ON(ret);
	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
	WARN_ON(ret);
	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
	WARN_ON(ret);
	ret = register_trace_block_split(blk_add_trace_split, NULL);
	WARN_ON(ret);
	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
	WARN_ON(ret);
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	WARN_ON(ret);
} NewCode:static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		goto out;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto out_rq_insert;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto out_rq_issue;
	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
	if (ret)
		goto out_rq_merge;
	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
	if (ret)
		goto out_rq_requeue;
	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
	if (ret)
		goto out_rq_complete;
	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
	if (ret)
		goto out_bio_complete;
	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
	if (ret)
		goto out_bio_backmerge;
	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
	if (ret)
		goto out_bio_frontmerge;
	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
	if (ret)
		goto out_bio_queue;
	ret = register_trace_blk_zone_append_update_request_bio(
		blk_add_trace_zone_update_request, NULL);
	if (ret)
		goto out_getrq;
	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
						     NULL);
	if (ret)
		goto out_zone_update_request;
	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
						NULL);
	if (ret)
		goto out_zone_plug;
	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
	if (ret)
		goto out_zone_unplug;
	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
	if (ret)
		goto out_plug;
	ret = register_trace_block_split(blk_add_trace_split, NULL);
	if (ret)
		goto out_unplug;
	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
	if (ret)
		goto out_split;
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto out_bio_remap;

	return 0;

out_bio_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
out_split:
	unregister_trace_block_split(blk_add_trace_split, NULL);
out_unplug:
	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
out_plug:
	unregister_trace_block_plug(blk_add_trace_plug, NULL);
out_zone_unplug:
	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
out_zone_plug:
	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
out_zone_update_request:
	unregister_trace_blk_zone_append_update_request_bio(
		blk_add_trace_zone_update_request, NULL);
out_getrq:
	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
out_bio_queue:
	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
out_bio_frontmerge:
	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
out_bio_backmerge:
	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
out_bio_complete:
	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
out_rq_complete:
	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
out_rq_requeue:
	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
out_rq_merge:
	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
out_rq_issue:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
out_rq_insert:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	tracepoint_synchronize_unregister();
out:
	return ret;
} SourceFile:kernel/trace/blktrace.c]

Results:
map[]

185/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 78370
							output: 38
							thoughts: 45
						

Thoughts:
Here's my take on the thought process:

**Diving into `blk_trace_setup_queue`**

Okay, time to dig into the `blk_trace_setup_queue` function. Let's start by zeroing in on that area around line 1900. I'll use the `read-file` command, specifically pulling lines 1900 through 1930. This should give me a good, focused snippet to understand the core logic within that region of the code. I need a clear picture of what's happening there to proceed.



186/4 2026/08/31 21:32 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1945 LineCount:40]

Results:
map[Contents:1945:	static BLK_TRACE_DEVICE_ATTR(pid);
1946:	static BLK_TRACE_DEVICE_ATTR(start_lba);
1947:	static BLK_TRACE_DEVICE_ATTR(end_lba);
1948:	
1949:	static struct attribute *blk_trace_attrs[] = {
1950:		&dev_attr_enable.attr,
1951:		&dev_attr_act_mask.attr,
1952:		&dev_attr_pid.attr,
1953:		&dev_attr_start_lba.attr,
1954:		&dev_attr_end_lba.attr,
1955:		NULL
1956:	};
1957:	
1958:	struct attribute_group blk_trace_attr_group = {
1959:		.name  = "trace",
1960:		.attrs = blk_trace_attrs,
1961:	};
1962:	
1963:	static const struct {
1964:		int mask;
1965:		const char *str;
1966:	} mask_maps[] = {
1967:		{ BLK_TC_READ,		"read"		},
1968:		{ BLK_TC_WRITE,		"write"		},
1969:		{ BLK_TC_FLUSH,		"flush"		},
1970:		{ BLK_TC_SYNC,		"sync"		},
1971:		{ BLK_TC_QUEUE,		"queue"		},
1972:		{ BLK_TC_REQUEUE,	"requeue"	},
1973:		{ BLK_TC_ISSUE,		"issue"		},
1974:		{ BLK_TC_COMPLETE,	"complete"	},
1975:		{ BLK_TC_FS,		"fs"		},
1976:		{ BLK_TC_PC,		"pc"		},
1977:		{ BLK_TC_NOTIFY,	"notify"	},
1978:		{ BLK_TC_AHEAD,		"ahead"		},
1979:		{ BLK_TC_META,		"meta"		},
1980:		{ BLK_TC_DISCARD,	"discard"	},
1981:		{ BLK_TC_DRV_DATA,	"drv_data"	},
1982:		{ BLK_TC_FUA,		"fua"		},
1983:		{ BLK_TC_WRITE_ZEROES,	"write-zeroes"	},
1984:	};
]

187/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 79291
							output: 36
							thoughts: 24
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Pinpointing `blk_trace_setup_queue`**

Okay, time to zero in on the exact location of `blk_trace_setup_queue`. Let's use `grepper` – it's the most efficient tool for this kind of precise code navigation within the kernel source. No need to mess around with `find` or `grep` iteratively. I'm after the direct hit, the line numbers, pronto. I need to get into the details quickly, and understand the calling context if necessary. `grepper` is the fastest way to get there. Now, let's see what it turns up.



188/4 2026/08/31 21:32 tool grepper
0m Args:
map[Expression:blk_trace_setup_queue PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:kernel/trace/blktrace.c=310=static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
--
kernel/trace/blktrace.c-397-			 * For sysfs-enabled tracing path (enabled via
kernel/trace/blktrace.c:398:			 * /sys/block/DEV/trace/enable), blk_trace_setup_queue()
kernel/trace/blktrace.c-399-			 * never initializes bt->version, leaving it 0 from
--
kernel/trace/blktrace.c=1880=static int blk_trace_remove_queue(struct request_queue *q)
--
kernel/trace/blktrace.c-1899- */
kernel/trace/blktrace.c:1900:static int blk_trace_setup_queue(struct request_queue *q,
kernel/trace/blktrace.c-1901-				 struct block_device *bdev)
--
kernel/trace/blktrace.c=2071=static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
--
kernel/trace/blktrace.c-2107-		if (value)
kernel/trace/blktrace.c:2108:			ret = blk_trace_setup_queue(q, bdev);
kernel/trace/blktrace.c-2109-		else
--
kernel/trace/blktrace.c-2115-	if (bt == NULL) {
kernel/trace/blktrace.c:2116:		ret = blk_trace_setup_queue(q, bdev);
kernel/trace/blktrace.c-2117-		bt = rcu_dereference_protected(q->blk_trace,
]

189/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 79965
							output: 38
							thoughts: 28
						

Thoughts:
Here's a first-person summary, tailored as requested:

**Diving into `blktrace.c` - a Critical Section**

Okay, time to get my hands dirty and jump into the heart of `blktrace.c`. I'm going to focus specifically on lines 1935 through 1980. This usually indicates a crucial section, a block dealing with data collection, event handling, or potentially some core logic regarding tracing block I/O operations. Given my understanding of the kernel's tracing infrastructure, I'm anticipating that this section likely manages the interaction with the underlying block device driver or the queueing mechanism, or perhaps deals with how trace data is formatted before being written out. I'll need to pay close attention to the data structures involved – the `blktrace_dev`, `blktrace_percpu`, or whatever context is being maintained. This could be where the rubber meets the road in terms of performance impact; I'll be looking for any potential bottlenecks or areas that could introduce latency. Any use of spinlocks, mutexes, or atomic operations is immediately going to catch my eye. I'm especially keen on any conditional logic within this section, any "if" statements that could indicate how the trace data is handled in different situations. This is where the subtleties of the blktrace design will really come through. Let's see what gems are hidden in this code.



190/4 2026/08/31 21:32 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1935 LineCount:45]

Results:
map[Contents:1935:	static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
1936:						  struct device_attribute *attr,
1937:						  const char *buf, size_t count);
1938:	#define BLK_TRACE_DEVICE_ATTR(_name) \
1939:		DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
1940:			    sysfs_blk_trace_attr_show, \
1941:			    sysfs_blk_trace_attr_store)
1942:	
1943:	static BLK_TRACE_DEVICE_ATTR(enable);
1944:	static BLK_TRACE_DEVICE_ATTR(act_mask);
1945:	static BLK_TRACE_DEVICE_ATTR(pid);
1946:	static BLK_TRACE_DEVICE_ATTR(start_lba);
1947:	static BLK_TRACE_DEVICE_ATTR(end_lba);
1948:	
1949:	static struct attribute *blk_trace_attrs[] = {
1950:		&dev_attr_enable.attr,
1951:		&dev_attr_act_mask.attr,
1952:		&dev_attr_pid.attr,
1953:		&dev_attr_start_lba.attr,
1954:		&dev_attr_end_lba.attr,
1955:		NULL
1956:	};
1957:	
1958:	struct attribute_group blk_trace_attr_group = {
1959:		.name  = "trace",
1960:		.attrs = blk_trace_attrs,
1961:	};
1962:	
1963:	static const struct {
1964:		int mask;
1965:		const char *str;
1966:	} mask_maps[] = {
1967:		{ BLK_TC_READ,		"read"		},
1968:		{ BLK_TC_WRITE,		"write"		},
1969:		{ BLK_TC_FLUSH,		"flush"		},
1970:		{ BLK_TC_SYNC,		"sync"		},
1971:		{ BLK_TC_QUEUE,		"queue"		},
1972:		{ BLK_TC_REQUEUE,	"requeue"	},
1973:		{ BLK_TC_ISSUE,		"issue"		},
1974:		{ BLK_TC_COMPLETE,	"complete"	},
1975:		{ BLK_TC_FS,		"fs"		},
1976:		{ BLK_TC_PC,		"pc"		},
1977:		{ BLK_TC_NOTIFY,	"notify"	},
1978:		{ BLK_TC_AHEAD,		"ahead"		},
1979:		{ BLK_TC_META,		"meta"		},
]

191/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 81128
							output: 38
							thoughts: 27
						

Thoughts:
Here's my attempt at summarizing that thought process, tailored for an expert audience:

**Diving into `blk_trace_setup_queue`**

Okay, so I need to understand how the tracing infrastructure hooks into the block layer. Let's zero in on lines 1900 to 1935. The function `blk_trace_setup_queue` is probably the key here. It's almost certainly responsible for the initialization and configuration of tracing-related aspects for a specific block device queue. I'm guessing this function will handle setting up per-queue data structures, registering relevant tracepoints (if it's using the tracepoint infrastructure, which is highly likely given the context), and potentially managing filters or control mechanisms for event capture. It's also possible there's some interaction with the global tracing infrastructure here – registering the queue with a central manager, or perhaps initializing a specific per-queue buffer. I’ll need to look for calls to functions related to tracepoint registration, ring buffer allocation, or potentially even filter setup within that section of code to get a complete picture. This is where the real mechanics of event collection are defined and it should be an interesting area to investigate in detail.



192/4 2026/08/31 21:32 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1900 LineCount:35]

Results:
map[Contents:1900:	static int blk_trace_setup_queue(struct request_queue *q,
1901:					 struct block_device *bdev)
1902:	{
1903:		struct blk_trace *bt = NULL;
1904:		int ret = -ENOMEM;
1905:	
1906:		bt = kzalloc_obj(*bt);
1907:		if (!bt)
1908:			return -ENOMEM;
1909:	
1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
1930:	 */
1931:	
1932:	static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
1933:						 struct device_attribute *attr,
1934:						 char *buf);
]

193/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 81931
							output: 153
							thoughts: 18
						

Thoughts:
Here's my summary, as though I were thinking through the process:

**Diving into `blk_trace_setup_queue` with `codeeditor`**

Okay, time to get to work. I need to take a look at `blk_trace_setup_queue`. I'm going to fire up `codeeditor` and open that function. This is a critical function in the block tracing subsystem, so I need to be thorough. I'll need to understand how it's setting up the tracing queue itself. I'll be looking for how it handles memory allocation, initialization of the data structures, and how it interacts with the underlying block device or virtual block device structures. I'll have to pay very close attention to any locking mechanisms to ensure concurrency is properly handled. I know this code pretty well, so I'm expecting to see specific calls to the ring buffer implementation, likely calls to allocate the trace buffer. Also, I'll be focused on how tracing is enabled and disabled and how the setup function plays a role in configuring it. This should be interesting; let's get started.



194/4 2026/08/31 21:32 tool codeeditor
0m Args:
map[CurrentCode:	blk_trace_setup_lba(bt, bdev);

	rcu_assign_pointer(q->blk_trace, bt);
	get_probe_ref();
	return 0;

free_bt: NewCode:	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt: SourceFile:kernel/trace/blktrace.c]

Results:
map[]

195/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 82341
							output: 10
							thoughts: 19
						

Thoughts:
Okay, let's dive into it.

**My Analysis of the Current Code State**

Right, time to get a clear picture of the modifications I've implemented. My next step is to examine the output of `patch-diff`. This command will provide me with a comprehensive view of all the changes I've made up to this point, detailing every line added, removed, or modified. By carefully reviewing this diff, I'll be able to ensure the codebase is evolving as intended and that no unexpected regressions or unintended consequences have been introduced. This is a critical checkpoint for me.



196/4 2026/08/31 21:32 tool patch-diff
0m Error:
log-in to see details

197/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 82510
							output: 15
							thoughts: 20
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing the `patch-diff` Strategy**

Alright, so I'm thinking about how to leverage `patch-diff` effectively here. The core idea is to understand the state of changes, and I'm considering a specific approach: calling `patch-diff` with a blank `File` parameter. The reasoning behind this is pretty straightforward: it's a quick way to get a consolidated overview of *all* the diffs present. Essentially, I want to see everything at once, like a global delta of the entire workspace. By giving an empty file parameter it becomes clear how to do this. I'm exploring the implications of using this approach. My goal is to understand how this can be implemented.

I'm mentally running through the edge cases and potential pitfalls.



198/4 2026/08/31 21:32 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..4e4f85a9f 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -53,21 +53,21 @@ static struct tracer_opt blk_tracer_opts[] = {
 
 static struct tracer_flags blk_tracer_flags = {
 	.val  = 0,
 	.opts = blk_tracer_opts,
 };
 
 /* Global reference count of probes */
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
 				  sector_t sector, int bytes, u64 what,
 				  dev_t dev, int error, u64 cgid,
 				  ssize_t cgid_len, void *pdu_data, int pdu_len)
 
 {
 	/*
 	 * These two are not needed in ftrace as they are in the
@@ -478,26 +478,32 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 		debugfs_lookup_and_remove("dropped", q->debugfs_dir);
 		debugfs_lookup_and_remove("msg", q->debugfs_dir);
 	} else {
 		debugfs_remove(bt->dir);
 	}
 	free_percpu(bt->sequence);
 	free_percpu(bt->msg_data);
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
 {
 	mutex_lock(&blk_probe_mutex);
 	if (!--blk_probes_ref)
 		blk_unregister_tracepoints();
 	mutex_unlock(&blk_probe_mutex);
 }
 
@@ -720,163 +726,186 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	blk_trace_setup_lba(bt, bdev);
 
 	return bt;
 
 err:
 	blk_trace_free(q, bt);
 
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
 	 * some device names have larger paths - convert the slashes
 	 * to underscores for this to work as expected
 	 */
 	strreplace(buts->name, '/', '_');
 
 	bt->version = version;
 	bt->act_mask = buts->act_mask;
 	if (!bt->act_mask)
 		bt->act_mask = (u16) -1;
 
 	/* overwrite with user settings */
 	if (buts->start_lba)
 		bt->start_lba = buts->start_lba;
 	if (buts->end_lba)
 		bt->end_lba = buts->end_lba;
 
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		    struct block_device *bdev,
 		    char __user *arg)
 {
 	struct blk_user_trace_setup2 buts2;
 	struct blk_user_trace_setup buts;
 	struct blk_trace *bt;
 	unsigned int memflags;
 	int ret;
 
 	ret = copy_from_user(&buts, arg, sizeof(buts));
 	if (ret)
 		return -EFAULT;
 
 	if (!buts.buf_size || !buts.buf_nr)
 		return -EINVAL;
 
 	buts2 = (struct blk_user_trace_setup2) {
 		.act_mask = buts.act_mask,
 		.buf_size = buts.buf_size,
 		.buf_nr = buts.buf_nr,
 		.start_lba = buts.start_lba,
 		.end_lba = buts.end_lba,
 		.pid = buts.pid,
 	};
 
 	memflags = blk_debugfs_lock(q);
 	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 				     bdev);
 	if (IS_ERR(bt)) {
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts, sizeof(buts))) {
 		blk_trace_remove(q);
 		return -EFAULT;
 	}
 	return 0;
 }
 EXPORT_SYMBOL_GPL(blk_trace_setup);
 
 static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
-			    struct block_device *bdev, char __user *arg)
+				    struct block_device *bdev, char __user *arg)
 {
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
 
 	if (!buts2.buf_size || !buts2.buf_nr)
 		return -EINVAL;
 
 	if (buts2.flags != 0)
 		return -EINVAL;
 
 	memflags = blk_debugfs_lock(q);
 	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 				     bdev);
 	if (IS_ERR(bt)) {
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 		blk_trace_remove(q);
 		return -EFAULT;
 	}
 	return 0;
 }
 
 #if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 static int compat_blk_trace_setup(struct request_queue *q, char *name,
 				  dev_t dev, struct block_device *bdev,
 				  char __user *arg)
 {
 	struct blk_user_trace_setup2 buts2;
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
 
 	if (!cbuts.buf_size || !cbuts.buf_nr)
 		return -EINVAL;
 
 	buts2 = (struct blk_user_trace_setup2) {
 		.act_mask = cbuts.act_mask,
 		.buf_size = cbuts.buf_size,
 		.buf_nr = cbuts.buf_nr,
 		.start_lba = cbuts.start_lba,
 		.end_lba = cbuts.end_lba,
 		.pid = cbuts.pid,
 	};
 
 	memflags = blk_debugfs_lock(q);
 	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 				     bdev);
 	if (IS_ERR(bt)) {
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 		blk_trace_remove(q);
 		return -EFAULT;
 	}
 
 	return 0;
 }
 #endif
@@ -1317,63 +1346,122 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 		return;
 	}
 
 	__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0,
 				BLK_TA_DRV_DATA, 0, len, data,
 				blk_trace_request_get_cgid(rq));
 	rcu_read_unlock();
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
 {
 	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
 	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
 	unregister_trace_block_split(blk_add_trace_split, NULL);
 	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
 	unregister_trace_block_plug(blk_add_trace_plug, NULL);
 	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
@@ -1897,34 +1985,37 @@ static int blk_trace_remove_queue(struct request_queue *q)
 /*
  * Setup everything required to start tracing
  */
 static int blk_trace_setup_queue(struct request_queue *q,
 				 struct block_device *bdev)
 {
 	struct blk_trace *bt = NULL;
 	int ret = -ENOMEM;
 
 	bt = kzalloc_obj(*bt);
 	if (!bt)
 		return -ENOMEM;
 
 	bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
 	if (!bt->msg_data)
 		goto free_bt;
 
 	bt->dev = bdev->bd_dev;
 	bt->act_mask = (u16)-1;
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:
 	blk_trace_free(q, bt);
 	return ret;
 }
 
 /*
  * sysfs interface to enable and configure tracing
  */
]

199/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 87931
							output: 122
							thoughts: 116
						

Thoughts:
**Fixing a Minor Indentation Quirk in Block Trace Setup**

Alright, let's take a look at this `blk_trace_setup2` function. Specifically, I need to make a quick adjustment on line 808. There's a subtle indentation inconsistency there that's bugging me. I mean, it's probably just spaces versus tabs, but consistency is key, especially in something as critical as the block layer. I want to ensure the formatting aligns perfectly with the established style in this code base. Let's get the indentation sorted out to match the original formatting. I'll fire up the code editor and make that minor tweak. A little cleanup goes a long way.



200/4 2026/08/31 21:32 tool codeeditor
0m Args:
map[CurrentCode:static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
				    struct block_device *bdev, char __user *arg) NewCode:static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
			    struct block_device *bdev, char __user *arg) SourceFile:kernel/trace/blktrace.c]

Results:
map[]

201/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 88323
							output: 24
							thoughts: 11
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert and adopting a first-person perspective:

**Checking That Diff Again...**

Alright, time to revisit that `patch-diff`. I remember going over it, but there's a nagging feeling, a little doubt whispering in the back of my mind. It's that subtle sense you get when you've reviewed something, but you haven't quite *felt* it sink in completely. I need to make absolutely sure everything there aligns with my understanding and the overall architecture we're working with. This project's intricacies demand that level of rigor. Let's make sure there aren't any potential edge cases that I missed on the first pass. No point in pushing something upstream without having absolute confidence. Deep breath, and let's dive back in.



202/4 2026/08/31 21:32 tool patch-diff
0m Args:
map[File:kernel/trace/blktrace.c]

Results:
map[Output:diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -53,21 +53,21 @@ static struct tracer_opt blk_tracer_opts[] = {
 
 static struct tracer_flags blk_tracer_flags = {
 	.val  = 0,
 	.opts = blk_tracer_opts,
 };
 
 /* Global reference count of probes */
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
 				  sector_t sector, int bytes, u64 what,
 				  dev_t dev, int error, u64 cgid,
 				  ssize_t cgid_len, void *pdu_data, int pdu_len)
 
 {
 	/*
 	 * These two are not needed in ftrace as they are in the
@@ -478,26 +478,32 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 		debugfs_lookup_and_remove("dropped", q->debugfs_dir);
 		debugfs_lookup_and_remove("msg", q->debugfs_dir);
 	} else {
 		debugfs_remove(bt->dir);
 	}
 	free_percpu(bt->sequence);
 	free_percpu(bt->msg_data);
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
 {
 	mutex_lock(&blk_probe_mutex);
 	if (!--blk_probes_ref)
 		blk_unregister_tracepoints();
 	mutex_unlock(&blk_probe_mutex);
 }
 
@@ -720,163 +726,186 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	blk_trace_setup_lba(bt, bdev);
 
 	return bt;
 
 err:
 	blk_trace_free(q, bt);
 
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
 	 * some device names have larger paths - convert the slashes
 	 * to underscores for this to work as expected
 	 */
 	strreplace(buts->name, '/', '_');
 
 	bt->version = version;
 	bt->act_mask = buts->act_mask;
 	if (!bt->act_mask)
 		bt->act_mask = (u16) -1;
 
 	/* overwrite with user settings */
 	if (buts->start_lba)
 		bt->start_lba = buts->start_lba;
 	if (buts->end_lba)
 		bt->end_lba = buts->end_lba;
 
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		    struct block_device *bdev,
 		    char __user *arg)
 {
 	struct blk_user_trace_setup2 buts2;
 	struct blk_user_trace_setup buts;
 	struct blk_trace *bt;
 	unsigned int memflags;
 	int ret;
 
 	ret = copy_from_user(&buts, arg, sizeof(buts));
 	if (ret)
 		return -EFAULT;
 
 	if (!buts.buf_size || !buts.buf_nr)
 		return -EINVAL;
 
 	buts2 = (struct blk_user_trace_setup2) {
 		.act_mask = buts.act_mask,
 		.buf_size = buts.buf_size,
 		.buf_nr = buts.buf_nr,
 		.start_lba = buts.start_lba,
 		.end_lba = buts.end_lba,
 		.pid = buts.pid,
 	};
 
 	memflags = blk_debugfs_lock(q);
 	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 				     bdev);
 	if (IS_ERR(bt)) {
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts, sizeof(buts))) {
 		blk_trace_remove(q);
 		return -EFAULT;
 	}
 	return 0;
 }
 EXPORT_SYMBOL_GPL(blk_trace_setup);
 
 static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 			    struct block_device *bdev, char __user *arg)
 {
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
 
 	if (!buts2.buf_size || !buts2.buf_nr)
 		return -EINVAL;
 
 	if (buts2.flags != 0)
 		return -EINVAL;
 
 	memflags = blk_debugfs_lock(q);
 	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 				     bdev);
 	if (IS_ERR(bt)) {
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 		blk_trace_remove(q);
 		return -EFAULT;
 	}
 	return 0;
 }
 
 #if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 static int compat_blk_trace_setup(struct request_queue *q, char *name,
 				  dev_t dev, struct block_device *bdev,
 				  char __user *arg)
 {
 	struct blk_user_trace_setup2 buts2;
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
 
 	if (!cbuts.buf_size || !cbuts.buf_nr)
 		return -EINVAL;
 
 	buts2 = (struct blk_user_trace_setup2) {
 		.act_mask = cbuts.act_mask,
 		.buf_size = cbuts.buf_size,
 		.buf_nr = cbuts.buf_nr,
 		.start_lba = cbuts.start_lba,
 		.end_lba = cbuts.end_lba,
 		.pid = cbuts.pid,
 	};
 
 	memflags = blk_debugfs_lock(q);
 	bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 				     bdev);
 	if (IS_ERR(bt)) {
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 		blk_trace_remove(q);
 		return -EFAULT;
 	}
 
 	return 0;
 }
 #endif
@@ -1317,63 +1346,122 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 		return;
 	}
 
 	__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0,
 				BLK_TA_DRV_DATA, 0, len, data,
 				blk_trace_request_get_cgid(rq));
 	rcu_read_unlock();
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
 {
 	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
 	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
 	unregister_trace_block_split(blk_add_trace_split, NULL);
 	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
 	unregister_trace_block_plug(blk_add_trace_plug, NULL);
 	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
@@ -1897,34 +1985,37 @@ static int blk_trace_remove_queue(struct request_queue *q)
 /*
  * Setup everything required to start tracing
  */
 static int blk_trace_setup_queue(struct request_queue *q,
 				 struct block_device *bdev)
 {
 	struct blk_trace *bt = NULL;
 	int ret = -ENOMEM;
 
 	bt = kzalloc_obj(*bt);
 	if (!bt)
 		return -ENOMEM;
 
 	bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
 	if (!bt->msg_data)
 		goto free_bt;
 
 	bt->dev = bdev->bd_dev;
 	bt->act_mask = (u16)-1;
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:
 	blk_trace_free(q, bt);
 	return ret;
 }
 
 /*
  * sysfs interface to enable and configure tracing
  */
]

203/4 2026/08/31 21:32 llm patch-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 93729
							output: 514
							thoughts: 502
						

Thoughts:
**Reviewing the Tracepoint Registration Logic**

Okay, let's break this down. I've got a diff in front of me, and I need to ensure it's sound. I'm focusing on how the tracepoints are registered and de-registered, making sure everything is handled correctly, especially error paths.

First, there's a forward declaration: `static int blk_register_tracepoints(void);`. Simple enough, sets the stage.

Then there's `get_probe_ref()`. This seems critical – it returns an integer. Inside, I see it increments `blk_probes_ref`. If that increment results in 1, it calls `blk_register_tracepoints()`. If that call returns non-zero, it decrements the reference count and returns. This seems like it's managing a reference count for the tracepoints, only registering them when the count hits 1. Clever.

`blk_trace_setup_finalize()` then follows. It too returns an integer. It *calls* `get_probe_ref()` before it assigns `q->blk_trace = bt` and if it fails, immediately returns. I see how this is architected. It is using `get_probe_ref()` to safely acquire the tracepoint resources, only proceeding to setup the trace itself if the refcount increment succeeds.

Now I see the callers of `blk_trace_setup_finalize()` – `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. They all check the return value and upon error, they call `blk_trace_free(q, bt)`, unlock the debugfs mutex, and return the error code. Clean and predictable error handling here.

Next, I look at `blk_register_tracepoints()`. It returns an integer and checks the return values of each `register_trace_*()` call. If any of those fail, it uses a `goto` to unwind the registrations in reverse order, calls `tracepoint_synchronize_unregister()`, and returns the error code. This demonstrates that there are a number of tracepoints, and they are handled as a single unit with complete undo capability.

Finally, I see `blk_trace_setup_queue()` which makes a call to `get_probe_ref()`. If it has a failure, it jumps to `free_bt:` and returns. Only if it succeeds it assigns `q->blk_trace = bt` and returns 0. So, again, that same `get_probe_ref()` is being used to acquire the tracepoint resources.

Alright, after this careful review, it is all looking clean and solid. It adheres to kernel conventions, and seems to be a complete fix. I see the flow, the reference counting, the error handling, and the registration/unregistration.



204/3 2026/08/31 21:32 action test-patch
23m Results:
map[PatchDiff:diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:
 TestError:]

205/3 2026/08/31 21:56 action If
1m Args:
map[TestError:]

206/4 2026/08/31 21:56 agent patch-reviewer
1m Model:
core

Results:
map[ReviewApproved:true ReviewComments:[]]

Instruction:
You are an experienced Linux kernel maintainer reviewing a proposed patch that compiles and passes reproducer tests.
Evaluate the patch diff against the crash report, root cause, and the architectural design guidelines below.

Scope Constraint (Single-Patch Submissions):
We only generate single, standalone patches (not patch series). If a comprehensive architectural redesign would require a multi-patch series touching many files, accept a localized single-patch fix as long as it correctly fixes the bug, does not introduce new issues, and avoids sentinel band-aids within its local scope.

Evaluation:
- Set ReviewApproved=true (and leave ReviewComments empty) if the patch is acceptable for upstream submission as a single-patch fix.
- Set ReviewApproved=false and list concise, actionable feedback in ReviewComments if the patch contains fixable "Kernel Architectural Design & Maintainer Taste" violations.

Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

---

# Kernel Architectural Design & Maintainer Taste

Evaluate kernel patches and fix proposals beyond binary bug presence. Enforce **maintainer taste**, **lifecycle symmetry**, **typestate soundness**, and **topological graph simplicity**.

---

## 1. Core Philosophy: Band-Aid vs. Architectural Design

Naive patches often introduce **defensive sentinel guards** (e.g., ad-hoc `if (!ptr) return;` checks, status flags, or suppressed warnings) directly at the point of failure. While locally avoiding crashes, they degrade subsystem architecture by leaving uninitialized states reachable.

Maintainer "good taste" solves the root cause by **shifting invariants** (making invalid states unrepresentable) and moving dynamic runtime checks into static typestate guarantees.

```
HACKY BAND-AID FIX (Monolithic Cleanup)            ARCHITECTURAL DESIGN (Scoped RAII / Invariant Shift)
───────────────────────────────────────            ────────────────────────────────────────────────────
           [ Init / Entry ]                                         [ Init / Entry ]
                  │                                                         │
      (Register Global Cleanup)                                    (Allocate Resource A)
                  │                                                         │
            [ Init Sub-B ] ──fail──┐                                  [ Init Sub-B ] ──fail──┐
                  │ (success)      │                                        │ (success)      │
                  ▼                │                                        ▼                ▼
          [ Setup Complete ]       │                             (Arm B Cleanup / RAII)  (Unwind A Only:
                  │                │                                        │             B never armed)
         (Deferred Teardown)       │                                        ▼                │
                  │                │                                [ Setup Complete ]       ▼
                  ▼                ▼                                        │            [ Error Exit ]
           [ release_all ] ◄───────┘                               (LIFO Scope Teardown)
                  │                                                         │
      (if (!ctx->b) return;) <-- Defensive guard!                           ▼
                  │                                                [ Clean Destruction ]
           [ Unsafe State ]                                        (Zero sentinel checks needed)
```

```c
// ANTI-PATTERN (Defensive Sentinel Guard): Teardown called on partial init -> callee needs guard
void driver_cleanup(struct ctx *ctx) {
    if (!ctx->buf) return; // <-- Sentinel band-aid
    free_buffer(ctx->buf);
}
// CANONICAL SHIFT (Granular Scoped Action): Registered only upon complete initialization
ctx->buf = alloc_buffer();
if (!ctx->buf) return -ENOMEM;
devm_add_action_or_reset(dev, free_buffer_action, ctx->buf);
```

---

## 2. Maintainer Taste as Graph Topology & Structural Simplicity

Software design quality maps directly to graph-theoretic properties across the Control-Flow Graph (CFG), Data-Flow Graph (DFG), and Object Lifecycle DAG:

### A. Control-Flow Graph (CFG) Simplification
* **Branch Minimization & Path Explosion (McCabe 1976):** Every defensive check added to a compound destructor or callback (`if (!ctx->buffer) return;`) adds a predicate node ($\pi$), increases cyclomatic complexity $v(G) = |E| - |V| + 2$, causes exponential path explosion ($O(2^k)$ paths), and enlarges explicit state spaces ($|S| = \prod |D_i|$). Good taste eliminates the branch by guaranteeing destructors are invoked only on initialized typestates. *(Note: Standard idempotent leaf deallocators like `kfree(NULL)` and public API input sanitizers are exempt).*
* **Single-Entry Single-Exit (SESE) Symmetry (Ferrante 1987, Johnson 1994, Dijkstra 1972):** Resource acquisition and release must form strict **nested dominator trees**. If resource $R_i$ is acquired at node $A$, the set of release actions $\{B_1, \dots, B_m\}$ must form a strict **post-dominating cut** relative to $A$ across all maximal exit paths.
* **Pointer Uniformity (Linus's "Good Taste" Rule):** Eliminate special-case conditional branches by operating on address indirection (e.g., indirect pointers `**curr` in linked list unlinking) to unify edge and interior cases into a branchless invariant.
* **Lexical Scope Invariants & Affine Lifecycles (Wadler 1990, RAII):** Enforce SESE symmetry and "consumed exactly once" affine invariants using compiler-backed scoped cleanup (`<linux/cleanup.h>` `guard()`, `scoped_guard()`, `__free()`).

### B. Ownership & Lifetime DAGs
* **Acyclic Lifecycles & Topological Teardown (Tarjan 1972, Kahn 1962):** Resource ownership must form a strict Directed Acyclic Graph (DAG) $G = (R, E)$. Teardown order must strictly follow reverse topological sort $\text{toposort}(G)^R$. Mixing conflicting lifetime paradigms (e.g., embedding a dynamic refcounted `kref`/socket struct inside a device-managed `devres` buffer or parent container) violates DAG acyclicity, creating synchronous blocking hacks (`wait_for_completion`), circular pins, and Use-After-Free hazards.
* **Three-Phase Concurrent Quiescence:** Multi-threaded and asynchronous teardown (networking, block layer, RCU) must strictly sequence: (1) **Deactivation/Delisting** (make unreachable) -> (2) **Quiescence & Draining** (`synchronize_rcu()`, `cancel_work_sync()`, `napi_disable()`) -> (3) **Physical Reclamation** (`kfree()`, `kmem_cache_destroy()`).
* **Typestate Validity (Strom & Yemini 1986, Aldrich et al. 2009):** A struct with $N$ fields should not use runtime boolean flags (`ctx->is_initialized`) to model incomplete typestates. Sub-resources must transition as a deterministic typestate automaton ($S_{uninit} \xrightarrow{\text{alloc}} S_{init} \xrightarrow{\text{publish}} S_{registered}$), and registration functions must accept only fully initialized typestates.

---

## 3. Deterministic Decision Trigger Matrix

| Code Symptom / Trigger (When you see X) | Anti-Pattern Band-Aid (DO NOT DO Z) | Canonical Invariant Shift (DO Y) |
| :--- | :--- | :--- |
| **Null deref in compound destructor / cleanup callback** | Add `if (!priv->buf) return;` in composite cleanup handler | Register granular cleanup immediately upon allocation via `devm_add_action_or_reset()`, `<linux/cleanup.h>` `__free()`, or discrete reverse LIFO labels |
| **UAF on dynamic object after container unbind** | Allocate with `devm_kzalloc()` and block on `wait_for_completion()` | Allocate with `kzalloc()`, manage lifetime via `kref_get()`/`kref_put()`, call unbind/delist on unbind, free in `kref` release callback |
| **Goto ladder lock leaks on early error exit** | Sprinkle manual `mutex_unlock()` across error returns | Use `guard(mutex)(&lock)` or `scoped_guard(spinlock, &lock)` from `<linux/cleanup.h>` |
| **Callback / IRQ / timer fires before full init** | Add `if (!priv->ready)` check inside IRQ/timer handler | Move `request_irq()`, `timer_setup()`, or `napi_enable()` strictly to the end of setup after all state structures are fully initialized |
| **Multi-step setup failure leaks resources** | Route all errors to a single `err:` label calling a monolithic `cleanup(priv)` with NULL checks | Use `cleanup.h` RAII, granular `devm` actions, or a strict reverse LIFO goto ladder (`err_free_b:` -> `err_free_a:`) |
| **Mixed ownership / asymmetric refcount drops** | Conditionally call `kref_put()` in caller based on error code | Enforce unconditional callee-cleans or caller-cleans ownership convention across all paths |
| **Ad-hoc state flag polling during teardown** | Add `priv->stopping = true` and spin/poll in callbacks | Use atomic typestate transitions and synchronous flush/drain APIs (`cancel_work_sync()`, `drain_workqueue()`) |

---

## 4. The Architectural Review Checklist

Before finalizing any kernel fix or review, audit against the following four criteria:

1. **The Sentinel Test (Caller vs. Callee Responsibility):**
   * *Smell:* Adding a defensive guard (`if (!ptr)` or `if (flags & INITIALIZED)`) inside a compound teardown callback or destructor to mask partial initialization.
   * *Invariant:* If a destructor executes on uninitialized data, the defect is at the **caller's registration/invocation point**, not the callee.
   * *Note:* Standard C allocator no-ops (`kfree(NULL)`) and public API parameter validators (`if (WARN_ON(!ptr)) return -EINVAL;`) are exempt; this rule targets *internal subsystem lifecycle pipelines and teardown paths*.
   * *Action:* Move registration to the point of complete initialization (`devm_add_action_or_reset()`, RAII/`__free()`, or discrete caller unwinding).

2. **LIFO Stack Unwinding Symmetry:**
   * *Smell:* Releasing resources in arbitrary order or invoking destructors for partially initialized subsystems.
   * *Invariant:* Resource release must strictly mirror acquisition order in reverse (LIFO) without monolithic cleanup guards.
   * *Action:* Verify that partial setup/initialization failures (e.g., `probe()`, `mount()`, `open()`, `alloc_pool()`) unwind only already-allocated resources in reverse order via strict LIFO labels or `cleanup.h` scope exit.

3. **Ownership Decoupling:**
   * *Smell:* Embedding dynamically refcounted objects (`kref`, `struct sock`, `struct inode`, `struct file`) directly inside hardware device-bound allocations (`devres`) or parent containers (`super_block`, `net_device`).
   * *Invariant:* Dynamic consumer references must outlive parent unregistration without use-after-free, circular pins, or blocking hacks.
   * *Action:* Decouple the refcounted core object from the container binding; container teardown must unbind/delist the object, but memory is freed exclusively by the final `kref_put()`.

4. **Codebase Idiom Alignment:**
   * *Smell:* Using legacy custom rollback ladders, ad-hoc state flags, or manual lock unlocking on error paths.
   * *Invariant:* Prefer standard, modern kernel abstractions with compiler-enforced safety guarantees.
   * *Action (Modern >= 6.6):* Replace manual boilerplate with `cleanup.h` (`guard()`, `scoped_guard()`, `__free()`), `devm_add_action_or_reset()`, `refcount_t`, and standard `kref` helpers.
   * *Action (Legacy / LTS / No-RAII Subsystems):* Enforce clean, branchless reverse LIFO goto ladders (`err_free_b:` -> `err_free_a:`).
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Bug title:
WARNING in get_probe_ref

The crash report:
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>


The root cause explanation:
The root cause of the crash is that `blk_register_tracepoints()` uses `WARN_ON(ret)` to check the return values of `register_trace_block_*()` functions. These tracepoint registration functions allocate memory for the probe array and can fail with `-ENOMEM` (e.g., under memory pressure or fault injection, as seen in the syzbot report). When they fail, `WARN_ON()` triggers a kernel panic if `panic_on_warn` is set.

Furthermore, `blk_register_tracepoints()` currently ignores the error and continues, leaving the tracepoints in a partially registered state. Later, when tracing is stopped, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. Unregistering a tracepoint that was not successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers another `WARN_ON_ONCE` inside `tracepoint_remove_func()`.

To fix this, we need to properly handle the registration failures by returning the error, unregistering the successfully registered tracepoints, and propagating the error up the call stack to fail the blktrace setup.

### Fix Details

1. **Change `blk_register_tracepoints()` to return an `int` and handle errors:**
   Instead of `WARN_ON(ret)`, check the return value of each `register_trace_*()` call. If it fails, use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error.

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		return ret;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto err_issue;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto err_merge;
        // ... (do this for all 18 tracepoints) ...
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto err_rq_remap;
	return 0;

err_rq_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
// ... (unregister labels in reverse order) ...
err_merge:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
err_issue:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	return ret;
}
```

2. **Propagate the error through `get_probe_ref()`:**
```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

3. **Propagate the error through `blk_trace_setup_finalize()`:**
```c
static int blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)
{
	int ret;
        // ... existing code ...
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
}
```

4. **Handle the error in the callers of `blk_trace_setup_finalize()`:**
   In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, check the return value of `blk_trace_setup_finalize()`. If it fails, clean up the allocated `bt` and return the error:
```c
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
```

5. **Handle the error in `blk_trace_setup_queue()`:**
```c
static int blk_trace_setup_queue(struct request_queue *q,
				 struct block_device *bdev)
{
        // ... existing code ...
	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt:
	blk_trace_free(q, bt);
	return ret;
}
```

The proposed patch diff:
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:


Review this patch diff against the crash report, root cause explanation, and kernel architectural design guidelines.

207/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 13242
							output: 37
							thoughts: 128
						

Thoughts:
**Analyzing the Patch for Block Trace Issues**

Okay, let's dive in. I need to understand this patch thoroughly, especially in light of the crash report, the identified root cause, and the existing guidelines. My approach is to be meticulous.

First, I'm going to zero in on the kernel source, specifically `kernel/trace/blktrace.c`. I need to understand the architecture, so I'll be looking closely at how `blk_register_tracepoints`, `get_probe_ref`, `put_probe_ref`, `blk_trace_setup_finalize`, and `blk_trace_setup_queue` are implemented and, more importantly, how they interact. I want to see how the block tracing functionality is structured and where potential weaknesses lie.

I'll be using my standard tools – I'll probably start with a `read-file` command to quickly get an overview, then drill down with something like `codesearch-definition-source` to jump directly to the relevant definitions and usage sites. I want a concrete understanding of the surrounding code and how this patch potentially modifies the critical path. My goal is to determine if the changes address the root cause effectively and if they adhere to the best practices for the kernel's tracing subsystem. This means a careful review of reference counting, initialization, and de-initialization sequences.



208/5 2026/08/31 21:56 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:480 LineCount:50]

Results:
map[Contents: 480:		} else {
 481:			debugfs_remove(bt->dir);
 482:		}
 483:		free_percpu(bt->sequence);
 484:		free_percpu(bt->msg_data);
 485:		kfree(bt);
 486:	}
 487:	
 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
 495:	
 496:	static void put_probe_ref(void)
 497:	{
 498:		mutex_lock(&blk_probe_mutex);
 499:		if (!--blk_probes_ref)
 500:			blk_unregister_tracepoints();
 501:		mutex_unlock(&blk_probe_mutex);
 502:	}
 503:	
 504:	static int blk_trace_start(struct blk_trace *bt)
 505:	{
 506:		if (bt->trace_state != Blktrace_setup &&
 507:		    bt->trace_state != Blktrace_stopped)
 508:			return -EINVAL;
 509:	
 510:		blktrace_seq++;
 511:		smp_mb();
 512:		bt->trace_state = Blktrace_running;
 513:		raw_spin_lock_irq(&running_trace_lock);
 514:		list_add(&bt->running_list, &running_trace_list);
 515:		raw_spin_unlock_irq(&running_trace_lock);
 516:		trace_note_time(bt);
 517:	
 518:		return 0;
 519:	}
 520:	
 521:	static int blk_trace_stop(struct blk_trace *bt)
 522:	{
 523:		if (bt->trace_state != Blktrace_running)
 524:			return -EINVAL;
 525:	
 526:		bt->trace_state = Blktrace_stopped;
 527:		raw_spin_lock_irq(&running_trace_lock);
 528:		list_del_init(&bt->running_list);
 529:		raw_spin_unlock_irq(&running_trace_lock);
]

209/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 14417
							output: 52
							thoughts: 96
						

Thoughts:
**Analyzing Block Trace References**

Okay, let's dive into this. My initial focus will be to meticulously map out the usage of `get_probe_ref` and `put_probe_ref` within the block trace implementation, specifically the `blktrace.c` file. I need to understand how these reference counting functions are being used, and if there are any potential race conditions or locking issues that I can identify.

I will also carefully examine the surrounding setup and finalization routines – `blk_trace_setup_finalize`, `blk_trace_setup_queue`, `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup` – to get a complete picture. Understanding the complete call stack and how these functions are intertwined is vital. The interaction between probe reference management, and the trace setup and teardown process is key.

My first step is to perform a targeted search for `get_probe_ref` within `kernel/trace/blktrace.c`. This will establish the initial baseline, and from there I can assess each call-site within its context.



210/5 2026/08/31 21:56 tool codesearch-find-references
0m Args:
map[ContextFile:kernel/trace/blktrace.c IncludeSnippetLines:10 Name:get_probe_ref SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_setup_finalize SourceFile:kernel/trace/blktrace.c SourceLine:759 SourceSnippet: 749:		/* overwrite with user settings */
 750:		if (buts->start_lba)
 751:			bt->start_lba = buts->start_lba;
 752:		if (buts->end_lba)
 753:			bt->end_lba = buts->end_lba;
 754:	
 755:		bt->pid = buts->pid;
 756:		bt->trace_state = Blktrace_setup;
 757:	
 758:		rcu_assign_pointer(q->blk_trace, bt);
 759:		get_probe_ref();
 760:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_setup_queue SourceFile:kernel/trace/blktrace.c SourceLine:1920 SourceSnippet:1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
]] TruncatedOutput:false]

211/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 15360
							output: 52
							thoughts: 15
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating `put_probe_ref` Usage**

Okay, so we're diving deeper into this issue. I've already explored the immediate context, but now I need a broader view. My primary concern is to ensure a comprehensive understanding of how `put_probe_ref` is being used throughout the codebase. I need to track down all the callers of this function. This isn't just about the direct calls, but also how the return values are being handled and what assumptions are being made based on those returns. Essentially, I'm thinking, "Let's track all the places that could possibly have any impact." The more complete the review, the greater my confidence level.



212/5 2026/08/31 21:56 tool codesearch-find-references
0m Args:
map[ContextFile:kernel/trace/blktrace.c IncludeSnippetLines:10 Name:put_probe_ref SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_cleanup SourceFile:kernel/trace/blktrace.c SourceLine:540 SourceSnippet: 535:	static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt)
 536:	{
 537:		blk_trace_stop(bt);
 538:		synchronize_rcu();
 539:		blk_trace_free(q, bt);
 540:		put_probe_ref();
 541:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_remove_queue SourceFile:kernel/trace/blktrace.c SourceLine:1891 SourceSnippet:1881:	{
1882:		struct blk_trace *bt;
1883:	
1884:		bt = rcu_replace_pointer(q->blk_trace, NULL,
1885:					 lockdep_is_held(&q->debugfs_mutex));
1886:		if (bt == NULL)
1887:			return -EINVAL;
1888:	
1889:		blk_trace_stop(bt);
1890:	
1891:		put_probe_ref();
1892:		synchronize_rcu();
1893:		blk_trace_free(q, bt);
1894:		return 0;
1895:	}
]] TruncatedOutput:false]

213/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 16022
							output: 37
							thoughts: 83
						

Thoughts:
Here's my take on the kernel tracing setup, thinking as an expert:

**Diving Deep into Block Trace Initialization**

Alright, let's get down to brass tacks. I need to understand the initialization sequence for `blktrace`. Time to revisit `kernel/trace/blktrace.c`. Specifically, I'm going to walk through the critical functions managing the setup process. I'll need to dissect the interaction between `blk_trace_setup_prepare`, `blk_trace_setup_finalize`, and the core `blk_trace_setup` and `blk_trace_setup2` functions. I know there's likely some pre/post-processing happening there, and I want to see exactly how the tracing infrastructure is prepared and finalized.

The compatibility layer, `compat_blk_trace_setup`, is another area of focus. I'll need to understand how it handles older trace setups, ensuring forward compatibility. A likely look will be how it handles data structures and configuration differences.

I'm also paying close attention to the tracepoint registration and unregistration logic: `blk_register_tracepoints` and `blk_unregister_tracepoints`. These functions are central to defining the tracing events. I need to see how they interact with the overall trace infrastructure and how the appropriate hooks are installed and removed in the relevant kernel subsystems. A careful review will be crucial to avoiding any race conditions or resource leaks.

Finally, the queue-specific setup, `blk_trace_setup_queue`, is a must. This is where the tracing is hooked into the block layer's queue management, and the devil is in the details, especially around how the tracing contexts are associated with specific block devices and queues. I'll be looking for how the per-queue data structures are initialized and managed, and especially the synchronization mechanisms used to protect the trace data. I'm keen to ensure any performance bottlenecks or locking issues are caught early.



214/5 2026/08/31 21:56 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:710 LineCount:90]

Results:
map[Contents: 710:	
 711:		ret = -EIO;
 712:		debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 713:		debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 714:	
 715:		bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
 716:				       &blk_relay_callbacks, bt);
 717:		if (!bt->rchan)
 718:			goto err;
 719:	
 720:		blk_trace_setup_lba(bt, bdev);
 721:	
 722:		return bt;
 723:	
 724:	err:
 725:		blk_trace_free(q, bt);
 726:	
 727:		return ERR_PTR(ret);
 728:	}
 729:	
 730:	static void blk_trace_setup_finalize(struct request_queue *q,
 731:					     char *name, int version,
 732:					     struct blk_trace *bt,
 733:					     struct blk_user_trace_setup2 *buts)
 734:	
 735:	{
 736:		strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 737:	
 738:		/*
 739:		 * some device names have larger paths - convert the slashes
 740:		 * to underscores for this to work as expected
 741:		 */
 742:		strreplace(buts->name, '/', '_');
 743:	
 744:		bt->version = version;
 745:		bt->act_mask = buts->act_mask;
 746:		if (!bt->act_mask)
 747:			bt->act_mask = (u16) -1;
 748:	
 749:		/* overwrite with user settings */
 750:		if (buts->start_lba)
 751:			bt->start_lba = buts->start_lba;
 752:		if (buts->end_lba)
 753:			bt->end_lba = buts->end_lba;
 754:	
 755:		bt->pid = buts->pid;
 756:		bt->trace_state = Blktrace_setup;
 757:	
 758:		rcu_assign_pointer(q->blk_trace, bt);
 759:		get_probe_ref();
 760:	}
 761:	
 762:	int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 763:			    struct block_device *bdev,
 764:			    char __user *arg)
 765:	{
 766:		struct blk_user_trace_setup2 buts2;
 767:		struct blk_user_trace_setup buts;
 768:		struct blk_trace *bt;
 769:		unsigned int memflags;
 770:		int ret;
 771:	
 772:		ret = copy_from_user(&buts, arg, sizeof(buts));
 773:		if (ret)
 774:			return -EFAULT;
 775:	
 776:		if (!buts.buf_size || !buts.buf_nr)
 777:			return -EINVAL;
 778:	
 779:		buts2 = (struct blk_user_trace_setup2) {
 780:			.act_mask = buts.act_mask,
 781:			.buf_size = buts.buf_size,
 782:			.buf_nr = buts.buf_nr,
 783:			.start_lba = buts.start_lba,
 784:			.end_lba = buts.end_lba,
 785:			.pid = buts.pid,
 786:		};
 787:	
 788:		memflags = blk_debugfs_lock(q);
 789:		bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 790:					     bdev);
 791:		if (IS_ERR(bt)) {
 792:			blk_debugfs_unlock(q, memflags);
 793:			return PTR_ERR(bt);
 794:		}
 795:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 796:		strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 797:		blk_debugfs_unlock(q, memflags);
 798:	
 799:		if (copy_to_user(arg, &buts, sizeof(buts))) {
]

215/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 17940
							output: 38
							thoughts: 26
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into `blktrace.c` for Analysis**

Okay, time to zero in on a specific section of `kernel/trace/blktrace.c`. My immediate focus is on lines 800 through 930. This range typically houses some critical function(s) or logic pertaining to block trace event handling, parsing, or maybe even the writing of trace data. I'm likely looking for something specific – perhaps a particular event type's processing, a suspected bottleneck, or maybe a potential source of a bug I've been chasing. I’ll be paying close attention to data structures used, any locking that might be involved (spinlocks, mutexes, etc.), and the flow of control within that section. It's time to refresh my memory on what that section *should* be doing and assess whether it aligns with what I *expect* it to do, given the context of the problem I'm trying to solve. I anticipate I will be checking for potential race conditions or locking issues that I may have suspected, or perhaps I'm looking to check some calculations to verify whether the data in the trace is accurate. I'm going to start by quickly scanning the code for any immediate red flags, then dig deeper.



216/5 2026/08/31 21:56 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:795 LineCount:100]

Results:
map[Contents: 795:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 796:		strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 797:		blk_debugfs_unlock(q, memflags);
 798:	
 799:		if (copy_to_user(arg, &buts, sizeof(buts))) {
 800:			blk_trace_remove(q);
 801:			return -EFAULT;
 802:		}
 803:		return 0;
 804:	}
 805:	EXPORT_SYMBOL_GPL(blk_trace_setup);
 806:	
 807:	static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 808:				    struct block_device *bdev, char __user *arg)
 809:	{
 810:		struct blk_user_trace_setup2 buts2;
 811:		struct blk_trace *bt;
 812:		unsigned int memflags;
 813:	
 814:		if (copy_from_user(&buts2, arg, sizeof(buts2)))
 815:			return -EFAULT;
 816:	
 817:		if (!buts2.buf_size || !buts2.buf_nr)
 818:			return -EINVAL;
 819:	
 820:		if (buts2.flags != 0)
 821:			return -EINVAL;
 822:	
 823:		memflags = blk_debugfs_lock(q);
 824:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 825:					     bdev);
 826:		if (IS_ERR(bt)) {
 827:			blk_debugfs_unlock(q, memflags);
 828:			return PTR_ERR(bt);
 829:		}
 830:		blk_trace_setup_finalize(q, name, 2, bt, &buts2);
 831:		blk_debugfs_unlock(q, memflags);
 832:	
 833:		if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 834:			blk_trace_remove(q);
 835:			return -EFAULT;
 836:		}
 837:		return 0;
 838:	}
 839:	
 840:	#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 841:	static int compat_blk_trace_setup(struct request_queue *q, char *name,
 842:					  dev_t dev, struct block_device *bdev,
 843:					  char __user *arg)
 844:	{
 845:		struct blk_user_trace_setup2 buts2;
 846:		struct compat_blk_user_trace_setup cbuts;
 847:		struct blk_trace *bt;
 848:		unsigned int memflags;
 849:	
 850:		if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 851:			return -EFAULT;
 852:	
 853:		if (!cbuts.buf_size || !cbuts.buf_nr)
 854:			return -EINVAL;
 855:	
 856:		buts2 = (struct blk_user_trace_setup2) {
 857:			.act_mask = cbuts.act_mask,
 858:			.buf_size = cbuts.buf_size,
 859:			.buf_nr = cbuts.buf_nr,
 860:			.start_lba = cbuts.start_lba,
 861:			.end_lba = cbuts.end_lba,
 862:			.pid = cbuts.pid,
 863:		};
 864:	
 865:		memflags = blk_debugfs_lock(q);
 866:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 867:					     bdev);
 868:		if (IS_ERR(bt)) {
 869:			blk_debugfs_unlock(q, memflags);
 870:			return PTR_ERR(bt);
 871:		}
 872:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 873:		blk_debugfs_unlock(q, memflags);
 874:	
 875:		if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 876:			blk_trace_remove(q);
 877:			return -EFAULT;
 878:		}
 879:	
 880:		return 0;
 881:	}
 882:	#endif
 883:	
 884:	static int __blk_trace_startstop(struct request_queue *q, int start)
 885:	{
 886:		struct blk_trace *bt;
 887:	
 888:		bt = rcu_dereference_protected(q->blk_trace,
 889:					       lockdep_is_held(&q->debugfs_mutex));
 890:		if (bt == NULL)
 891:			return -EINVAL;
 892:	
 893:		if (start)
 894:			return blk_trace_start(bt);
]

217/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 19885
							output: 38
							thoughts: 47
						

Thoughts:
Here's my take on the thought process, as if it were my own:

**Diving into Block Tracing Initialization**

Alright, I need to understand how these tracepoints in `blktrace` are being registered and unregistered. I'll focus my attention on `kernel/trace/blktrace.c` specifically around the `blk_register_tracepoints` and `blk_unregister_tracepoints` functions, which, based on the file and function names, are likely the core of the initialization and cleanup routines. I'm going to quickly skim the lines 1320 to 1420 to refresh my memory of the context. I'll be looking for how the tracepoints are hooked into the kernel's tracing infrastructure and what mechanisms are used to cleanly remove them when the module unloads or the tracing session ends. I expect to see the usual suspects: calls to `register_trace_*` macros or functions, related data structures being populated, and the reverse for unregistration. I'm also curious about any potential error handling or synchronization aspects within those function regions, because those are often points of interest, especially in a tracing system that needs to be as non-intrusive as possible.



218/5 2026/08/31 21:56 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1320 LineCount:90]

Results:
map[Contents:1320:		__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0,
1321:					BLK_TA_DRV_DATA, 0, len, data,
1322:					blk_trace_request_get_cgid(rq));
1323:		rcu_read_unlock();
1324:	}
1325:	EXPORT_SYMBOL_GPL(blk_add_driver_data);
1326:	
1327:	static void blk_register_tracepoints(void)
1328:	{
1329:		int ret;
1330:	
1331:		ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1332:		WARN_ON(ret);
1333:		ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1334:		WARN_ON(ret);
1335:		ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1336:		WARN_ON(ret);
1337:		ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1338:		WARN_ON(ret);
1339:		ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1340:		WARN_ON(ret);
1341:		ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1342:		WARN_ON(ret);
1343:		ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1344:		WARN_ON(ret);
1345:		ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1346:		WARN_ON(ret);
1347:		ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1348:		WARN_ON(ret);
1349:		ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
1350:		WARN_ON(ret);
1351:		ret = register_trace_blk_zone_append_update_request_bio(
1352:			blk_add_trace_zone_update_request, NULL);
1353:		WARN_ON(ret);
1354:		ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
1355:							     NULL);
1356:		WARN_ON(ret);
1357:		ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
1358:							NULL);
1359:		WARN_ON(ret);
1360:		ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1361:		WARN_ON(ret);
1362:		ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1363:		WARN_ON(ret);
1364:		ret = register_trace_block_split(blk_add_trace_split, NULL);
1365:		WARN_ON(ret);
1366:		ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1367:		WARN_ON(ret);
1368:		ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1369:		WARN_ON(ret);
1370:	}
1371:	
1372:	static void blk_unregister_tracepoints(void)
1373:	{
1374:		unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1375:		unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1376:		unregister_trace_block_split(blk_add_trace_split, NULL);
1377:		unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
1378:		unregister_trace_block_plug(blk_add_trace_plug, NULL);
1379:		unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
1380:		unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
1381:		unregister_trace_blk_zone_append_update_request_bio(
1382:			blk_add_trace_zone_update_request, NULL);
1383:		unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
1384:		unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
1385:		unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
1386:		unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
1387:		unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
1388:		unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
1389:		unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
1390:		unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
1391:		unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
1392:		unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
1393:	
1394:		tracepoint_synchronize_unregister();
1395:	}
1396:	
1397:	/*
1398:	 * struct blk_io_tracer formatting routines
1399:	 */
1400:	
1401:	static void fill_rwbs(char *rwbs, const struct blk_io_trace2 *t)
1402:	{
1403:		int i = 0;
1404:		int tc = t->action >> BLK_TC_SHIFT;
1405:	
1406:		if ((t->action & ~__BLK_TN_CGROUP) == BLK_TN_MESSAGE) {
1407:			rwbs[i++] = 'N';
1408:			goto out;
1409:		}
]

219/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 22054
							output: 38
							thoughts: 39
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Analyzing blktrace.c's Queue Setup**

Okay, time to dive in. I need to refresh my memory on how `blktrace` sets up its tracing queue. Let's zero in on the relevant code. I'm going to jump into `kernel/trace/blktrace.c` – specifically, lines 1900 through 1950. That should put me right around the `blk_trace_setup_queue` function, which, if memory serves, handles the crucial initialization of the tracing infrastructure for a given block device queue. I'll need to re-familiarize myself with the data structures involved, the locking mechanisms they employ, and how the tracing points get attached. This section's where the magic happens, so I want a complete overview.



220/5 2026/08/31 21:56 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1900 LineCount:50]

Results:
map[Contents:1900:	static int blk_trace_setup_queue(struct request_queue *q,
1901:					 struct block_device *bdev)
1902:	{
1903:		struct blk_trace *bt = NULL;
1904:		int ret = -ENOMEM;
1905:	
1906:		bt = kzalloc_obj(*bt);
1907:		if (!bt)
1908:			return -ENOMEM;
1909:	
1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
1930:	 */
1931:	
1932:	static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
1933:						 struct device_attribute *attr,
1934:						 char *buf);
1935:	static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
1936:						  struct device_attribute *attr,
1937:						  const char *buf, size_t count);
1938:	#define BLK_TRACE_DEVICE_ATTR(_name) \
1939:		DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
1940:			    sysfs_blk_trace_attr_show, \
1941:			    sysfs_blk_trace_attr_store)
1942:	
1943:	static BLK_TRACE_DEVICE_ATTR(enable);
1944:	static BLK_TRACE_DEVICE_ATTR(act_mask);
1945:	static BLK_TRACE_DEVICE_ATTR(pid);
1946:	static BLK_TRACE_DEVICE_ATTR(start_lba);
1947:	static BLK_TRACE_DEVICE_ATTR(end_lba);
1948:	
1949:	static struct attribute *blk_trace_attrs[] = {
]

221/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 23080
							output: 54
							thoughts: 66
						

Thoughts:
Here's my summary, as though I'm thinking it:

**Digging into Trace Setup Functions**

Okay, so I need to get a handle on how this tracing setup is functioning. Let's start by doing a quick sweep of the codebase. I need to make sure I haven't missed any other calls to `get_probe_ref`, that's a key function I need to look out for. And then I should search for `blk_trace_setup_finalize` or `blk_trace_setup_prepare`. I should also cast a wide net and look for any other trace setup functions that might be relevant; it's easy to miss something when you're focusing on specific function names. I want to make sure I have a complete picture of the landscape. I'm going to start with those function names but I'm going to keep an open mind for other related calls.



222/5 2026/08/31 21:56 tool codesearch-find-references
0m Args:
map[ContextFile:kernel/trace/blktrace.c IncludeSnippetLines:10 Name:blk_trace_setup_finalize SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_setup SourceFile:kernel/trace/blktrace.c SourceLine:795 SourceSnippet: 785:			.pid = buts.pid,
 786:		};
 787:	
 788:		memflags = blk_debugfs_lock(q);
 789:		bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
 790:					     bdev);
 791:		if (IS_ERR(bt)) {
 792:			blk_debugfs_unlock(q, memflags);
 793:			return PTR_ERR(bt);
 794:		}
 795:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 796:		strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 797:		blk_debugfs_unlock(q, memflags);
 798:	
 799:		if (copy_to_user(arg, &buts, sizeof(buts))) {
 800:			blk_trace_remove(q);
 801:			return -EFAULT;
 802:		}
 803:		return 0;
 804:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:blk_trace_setup2 SourceFile:kernel/trace/blktrace.c SourceLine:830 SourceSnippet: 820:		if (buts2.flags != 0)
 821:			return -EINVAL;
 822:	
 823:		memflags = blk_debugfs_lock(q);
 824:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 825:					     bdev);
 826:		if (IS_ERR(bt)) {
 827:			blk_debugfs_unlock(q, memflags);
 828:			return PTR_ERR(bt);
 829:		}
 830:		blk_trace_setup_finalize(q, name, 2, bt, &buts2);
 831:		blk_debugfs_unlock(q, memflags);
 832:	
 833:		if (copy_to_user(arg, &buts2, sizeof(buts2))) {
 834:			blk_trace_remove(q);
 835:			return -EFAULT;
 836:		}
 837:		return 0;
 838:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:compat_blk_trace_setup SourceFile:kernel/trace/blktrace.c SourceLine:872 SourceSnippet: 862:			.pid = cbuts.pid,
 863:		};
 864:	
 865:		memflags = blk_debugfs_lock(q);
 866:		bt = blk_trace_setup_prepare(q, name, dev, buts2.buf_size, buts2.buf_nr,
 867:					     bdev);
 868:		if (IS_ERR(bt)) {
 869:			blk_debugfs_unlock(q, memflags);
 870:			return PTR_ERR(bt);
 871:		}
 872:		blk_trace_setup_finalize(q, name, 1, bt, &buts2);
 873:		blk_debugfs_unlock(q, memflags);
 874:	
 875:		if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
 876:			blk_trace_remove(q);
 877:			return -EFAULT;
 878:		}
 879:	
 880:		return 0;
 881:	}
]] TruncatedOutput:false]

223/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 24512
							output: 37
							thoughts: 123
						

Thoughts:
**Diving into Block Trace Initialization and Cleanup**

Okay, so I need to really understand the lifecycle management within blktrace. My focus is on the crucial points – specifically, what's going on during `blk_trace_setup_finalize`, `blk_trace_setup_prepare`, `blk_trace_free`, and `blk_trace_remove`. I know these are the functions that either set it up or take it down, so it's critical to understanding how to best operate and perhaps extend this code.

I'm particularly interested in the setup process, which probably means I need a good grasp of both `blk_trace_setup_prepare` and `blk_trace_free`, as well as how devices are subsequently removed, with `blk_trace_remove`. Time to dive into the code.

Alright, I'm going to start by getting a solid handle on the code. I'll read through `kernel/trace/blktrace.c`, specifically lines 650 to 730, then 460 to 505 and, finally, 1880 to 1910. That should give me a good overview of the important sections of the lifecycle management, including resource setup, allocation, teardown, and cleanup, and will set the stage for deeper analysis.



224/5 2026/08/31 21:56 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:650 LineCount:80]

Results:
map[Contents: 650:	 * Setup everything required to start tracing
 651:	 */
 652:	static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 653:							 char *name, dev_t dev,
 654:							 u32 buf_size, u32 buf_nr,
 655:							 struct block_device *bdev)
 656:	{
 657:		struct blk_trace *bt = NULL;
 658:		struct dentry *dir = NULL;
 659:		int ret;
 660:	
 661:		lockdep_assert_held(&q->debugfs_mutex);
 662:	
 663:		/*
 664:		 * bdev can be NULL, as with scsi-generic, this is a helpful as
 665:		 * we can be.
 666:		 */
 667:		if (rcu_dereference_protected(q->blk_trace,
 668:					      lockdep_is_held(&q->debugfs_mutex))) {
 669:			pr_warn("Concurrent blktraces are not allowed on %s\n", name);
 670:			return ERR_PTR(-EBUSY);
 671:		}
 672:	
 673:		bt = kzalloc_obj(*bt);
 674:		if (!bt)
 675:			return ERR_PTR(-ENOMEM);
 676:	
 677:		ret = -ENOMEM;
 678:		bt->sequence = alloc_percpu(unsigned long);
 679:		if (!bt->sequence)
 680:			goto err;
 681:	
 682:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
 683:		if (!bt->msg_data)
 684:			goto err;
 685:	
 686:		/*
 687:		 * When tracing the whole disk reuse the existing debugfs directory
 688:		 * created by the block layer on init. For partitions block devices,
 689:		 * and scsi-generic block devices we create a temporary new debugfs
 690:		 * directory that will be removed once the trace ends.
 691:		 */
 692:		if (bdev && !bdev_is_partition(bdev))
 693:			dir = q->debugfs_dir;
 694:		else
 695:			bt->dir = dir = debugfs_create_dir(name, blk_debugfs_root);
 696:	
 697:		/*
 698:		 * As blktrace relies on debugfs for its interface the debugfs directory
 699:		 * is required, contrary to the usual mantra of not checking for debugfs
 700:		 * files or directories.
 701:		 */
 702:		if (IS_ERR_OR_NULL(dir)) {
 703:			pr_warn("debugfs_dir not present for %s so skipping\n", name);
 704:			ret = -ENOENT;
 705:			goto err;
 706:		}
 707:	
 708:		bt->dev = dev;
 709:		INIT_LIST_HEAD(&bt->running_list);
 710:	
 711:		ret = -EIO;
 712:		debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 713:		debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 714:	
 715:		bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
 716:				       &blk_relay_callbacks, bt);
 717:		if (!bt->rchan)
 718:			goto err;
 719:	
 720:		blk_trace_setup_lba(bt, bdev);
 721:	
 722:		return bt;
 723:	
 724:	err:
 725:		blk_trace_free(q, bt);
 726:	
 727:		return ERR_PTR(ret);
 728:	}
 729:	
]

225/5 2026/08/31 21:56 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 26137
							output: 37
							thoughts: 21
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into `blk_trace_free`**

Alright, let's zero in on `blk_trace_free`, specifically lines 460 through 487. I'm focusing on this region because... well, I suspect there's something interesting happening there. My mental model suggests a particular interaction with the trace buffers or some potential contention point within the freeing logic. I'm probably looking for a specific data race or a subtle memory management issue that's causing intermittent performance degradation or a deadlock, or even just some inefficiencies. The fact that I've zoned in on this particular section means I probably have a nagging feeling about something related to how trace records are being handled during the deallocation process. Time to dig in and validate my hunch, line by line.



226/5 2026/08/31 21:57 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:460 LineCount:35]

Results:
map[Contents: 460:		 */
 461:		local_irq_save(flags);
 462:		sequence = per_cpu_ptr(bt->sequence, cpu);
 463:		(*sequence)++;
 464:		relay_blktrace_event(bt, *sequence, pid, cpu, sector, bytes,
 465:				     what, error, cgid, cgid_len, pdu_data, pdu_len);
 466:		local_irq_restore(flags);
 467:	}
 468:	
 469:	static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 470:	{
 471:		relay_close(bt->rchan);
 472:	
 473:		/*
 474:		 * If 'bt->dir' is not set, then both 'dropped' and 'msg' are created
 475:		 * under 'q->debugfs_dir', thus lookup and remove them.
 476:		 */
 477:		if (!bt->dir) {
 478:			debugfs_lookup_and_remove("dropped", q->debugfs_dir);
 479:			debugfs_lookup_and_remove("msg", q->debugfs_dir);
 480:		} else {
 481:			debugfs_remove(bt->dir);
 482:		}
 483:		free_percpu(bt->sequence);
 484:		free_percpu(bt->msg_data);
 485:		kfree(bt);
 486:	}
 487:	
 488:	static void get_probe_ref(void)
 489:	{
 490:		mutex_lock(&blk_probe_mutex);
 491:		if (++blk_probes_ref == 1)
 492:			blk_register_tracepoints();
 493:		mutex_unlock(&blk_probe_mutex);
 494:	}
]

227/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 26923
							output: 38
							thoughts: 16
						

Thoughts:
Here's a summary of my thought process:

**Diving into Block Trace Removal and the sysfs Interface**

Okay, so I need to refresh my memory on how block trace removal is handled. Let's start by digging into `blk_trace_remove`. I want to understand the mechanics of it, specifically how it interacts with the system. Then, I need to look at the sysfs interface. I know it's a critical component for managing and controlling tracing, so understanding how these two pieces work together will be key. I'll need to see how they're connected. Perhaps there's a dependency, or maybe it's completely separate. The `sysfs` interface is likely the user's window into the tracing subsystem, so I expect `blk_trace_remove` to interact with it, either directly or indirectly. Let's get to the code and see.



228/5 2026/08/31 21:57 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:1860 LineCount:80]

Results:
map[Contents:1860:	{
1861:		__init_blk_tracer();
1862:	}
1863:	
1864:	static int __init init_blk_tracer(void)
1865:	{
1866:		int ret = 0;
1867:	
1868:		if (trace_init_wq) {
1869:			INIT_WORK(&blktrace_works, blktrace_works_func);
1870:			queue_work(trace_init_wq, &blktrace_works);
1871:		} else {
1872:			ret = __init_blk_tracer();
1873:		}
1874:	
1875:		return ret;
1876:	}
1877:	
1878:	device_initcall(init_blk_tracer);
1879:	
1880:	static int blk_trace_remove_queue(struct request_queue *q)
1881:	{
1882:		struct blk_trace *bt;
1883:	
1884:		bt = rcu_replace_pointer(q->blk_trace, NULL,
1885:					 lockdep_is_held(&q->debugfs_mutex));
1886:		if (bt == NULL)
1887:			return -EINVAL;
1888:	
1889:		blk_trace_stop(bt);
1890:	
1891:		put_probe_ref();
1892:		synchronize_rcu();
1893:		blk_trace_free(q, bt);
1894:		return 0;
1895:	}
1896:	
1897:	/*
1898:	 * Setup everything required to start tracing
1899:	 */
1900:	static int blk_trace_setup_queue(struct request_queue *q,
1901:					 struct block_device *bdev)
1902:	{
1903:		struct blk_trace *bt = NULL;
1904:		int ret = -ENOMEM;
1905:	
1906:		bt = kzalloc_obj(*bt);
1907:		if (!bt)
1908:			return -ENOMEM;
1909:	
1910:		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
1911:		if (!bt->msg_data)
1912:			goto free_bt;
1913:	
1914:		bt->dev = bdev->bd_dev;
1915:		bt->act_mask = (u16)-1;
1916:	
1917:		blk_trace_setup_lba(bt, bdev);
1918:	
1919:		rcu_assign_pointer(q->blk_trace, bt);
1920:		get_probe_ref();
1921:		return 0;
1922:	
1923:	free_bt:
1924:		blk_trace_free(q, bt);
1925:		return ret;
1926:	}
1927:	
1928:	/*
1929:	 * sysfs interface to enable and configure tracing
1930:	 */
1931:	
1932:	static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
1933:						 struct device_attribute *attr,
1934:						 char *buf);
1935:	static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
1936:						  struct device_attribute *attr,
1937:						  const char *buf, size_t count);
1938:	#define BLK_TRACE_DEVICE_ATTR(_name) \
1939:		DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
]

229/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 28247
							output: 38
							thoughts: 126
						

Thoughts:
Okay, let's dive into this kernel crash. My initial thought is to pinpoint the exact location. The backtrace points directly to `sysfs_blk_trace_attr_store` and within it, to `kernel/trace/blktrace.c`.  Looks like the crash occurred during the setup of a block trace - interesting.

I'm zeroing in on that function, and I'll focus my attention on the code block around lines 2000-2200 within `sysfs_blk_trace_attr_store`. That's where the failure is most likely occurring, given the backtrace. It seems this region will contain the key to understanding this issue. Let's see what's happening there!



230/5 2026/08/31 21:57 tool read-file
0m Args:
map[File:kernel/trace/blktrace.c FirstLine:2080 LineCount:80]

Results:
map[Contents:2080:		ssize_t ret = -EINVAL;
2081:	
2082:		if (count == 0)
2083:			goto out;
2084:	
2085:		if (attr == &dev_attr_act_mask) {
2086:			if (kstrtoull(buf, 0, &value)) {
2087:				/* Assume it is a list of trace category names */
2088:				ret = blk_trace_str2mask(buf);
2089:				if (ret < 0)
2090:					goto out;
2091:				value = ret;
2092:			}
2093:		} else {
2094:			if (kstrtoull(buf, 0, &value))
2095:				goto out;
2096:		}
2097:	
2098:		memflags = blk_debugfs_lock(q);
2099:	
2100:		bt = rcu_dereference_protected(q->blk_trace,
2101:					       lockdep_is_held(&q->debugfs_mutex));
2102:		if (attr == &dev_attr_enable) {
2103:			if (!!value == !!bt) {
2104:				ret = 0;
2105:				goto out_unlock_bdev;
2106:			}
2107:			if (value)
2108:				ret = blk_trace_setup_queue(q, bdev);
2109:			else
2110:				ret = blk_trace_remove_queue(q);
2111:			goto out_unlock_bdev;
2112:		}
2113:	
2114:		ret = 0;
2115:		if (bt == NULL) {
2116:			ret = blk_trace_setup_queue(q, bdev);
2117:			bt = rcu_dereference_protected(q->blk_trace,
2118:					lockdep_is_held(&q->debugfs_mutex));
2119:		}
2120:	
2121:		if (ret == 0) {
2122:			if (attr == &dev_attr_act_mask)
2123:				bt->act_mask = value;
2124:			else if (attr == &dev_attr_pid)
2125:				bt->pid = value;
2126:			else if (attr == &dev_attr_start_lba)
2127:				bt->start_lba = value;
2128:			else if (attr == &dev_attr_end_lba)
2129:				bt->end_lba = value;
2130:		}
2131:	
2132:	out_unlock_bdev:
2133:		blk_debugfs_unlock(q, memflags);
2134:	out:
2135:		return ret ? ret : count;
2136:	}
2137:	#endif /* CONFIG_BLK_DEV_IO_TRACE */
2138:	
2139:	#ifdef CONFIG_EVENT_TRACING
2140:	
2141:	/**
2142:	 * blk_fill_rwbs - Fill the buffer rwbs by mapping op to character string.
2143:	 * @rwbs:	buffer to be filled
2144:	 * @opf:	request operation type (REQ_OP_XXX) and flags for the tracepoint
2145:	 *
2146:	 * Description:
2147:	 *     Maps each request operation and flag to a single character and fills the
2148:	 *     buffer provided by the caller with resulting string.
2149:	 *
2150:	 **/
2151:	void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
2152:	{
2153:		int i = 0;
2154:	
2155:		if (opf & REQ_PREFLUSH)
2156:			rwbs[i++] = 'F';
2157:	
2158:		switch (opf & REQ_OP_MASK) {
2159:		case REQ_OP_WRITE:
]

231/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 29735
							output: 32
							thoughts: 42
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Investigating Block Tracepoint Registration**

Alright, so I need to dig into the recent history or changes surrounding the block tracepoint registration in the kernel. My first instinct is to fire up `git log` and specifically target the `kernel/trace/blktrace.c` file. That should give me a good, focused view of commits that might have touched the area I'm interested in. Given the specifics of this situation, I should go ahead and broaden the search as much as possible.

However, just to be thorough and because it is a common pattern for the kernel, I'll also want to cast a wider net. I'm going to scan the commit messages for any mentions of `blk_register_tracepoints` or `register_trace_block`. Those are the usual suspects, and it’s possible a refactoring or related change might have affected registration indirectly, even if `blktrace.c` itself wasn't directly modified. It's about being comprehensive and considering the broader context of the changes made around the target functionality. With any luck, I'll find what I'm looking for quickly and efficiently.



232/5 2026/08/31 21:57 tool git-log
0m Args:
map[PathPrefix:kernel/trace/blktrace.c Since:3 years]

Results:
map[Output:da46b5dfef48 blktrace: fix __this_cpu_read/write in preemptible context
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
dfe48ea17973 blk-mq: use NOIO context to prevent deadlock during debugfs creation
0c2580a80946 blktrace: Make init_blk_tracer() asynchronous
ee4784a83fb2 block: don't use strcpy to copy blockdev name
bbec8e28cac5 tracing: Allow tracer to add more than 32 options
bc49af56eea8 blktrace: add support for REQ_OP_WRITE_ZEROES tracing
e48886b9d668 blktrace: for ftrace use correct trace format ver
4a0940bdcac2 blktrace: use debug print to report dropped events
]

233/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 30330
							output: 26
							thoughts: 44
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach this task, as if these were my internal thoughts:

**Analyzing Tracepoint Registration and Error Handling in the Kernel**

Alright, I need to get a better handle on how tracepoints are being registered within the kernel and, critically, how they deal with error scenarios. Specifically, I want to understand how different kernel subsystems might manage error unwinding in the context of `register_trace_*` functions. Are there any common patterns or unique approaches out there?

My initial plan is to leverage `grepper`. It’s the perfect tool for this type of kernel-wide code search. I'll use it to scour the entire kernel source tree, looking for instances where `register_trace_` is used. This should give me a good overview of how prevalent tracepoint registration is and where it's happening. From there, I can start diving into the surrounding code to understand the broader context and see how errors are handled in each case. This should lead me to a useful data set to study error handling around the registered tracepoints.



234/5 2026/08/31 21:57 tool grepper
0m Args:
map[Expression:register_trace_ PathPrefix:kernel/]

Results:
map[Output:
Full output is too long, showing 500 out of 612 lines.
Use more precise expression if possible.

kernel/kcsan/kcsan_test.c=1589=static void register_tracepoints(void)
kernel/kcsan/kcsan_test.c-1590-{
kernel/kcsan/kcsan_test.c:1591:	register_trace_console(probe_console, NULL);
kernel/kcsan/kcsan_test.c-1592-}
--
kernel/kcsan/kcsan_test.c=1595=static void unregister_tracepoints(void)
kernel/kcsan/kcsan_test.c-1596-{
kernel/kcsan/kcsan_test.c:1597:	unregister_trace_console(probe_console, NULL);
kernel/kcsan/kcsan_test.c-1598-}
--
kernel/trace/blktrace.c=1327=static void blk_register_tracepoints(void)
--
kernel/trace/blktrace.c-1330-
kernel/trace/blktrace.c:1331:	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1332-	WARN_ON(ret);
kernel/trace/blktrace.c:1333:	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c-1334-	WARN_ON(ret);
kernel/trace/blktrace.c:1335:	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c-1336-	WARN_ON(ret);
kernel/trace/blktrace.c:1337:	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c-1338-	WARN_ON(ret);
kernel/trace/blktrace.c:1339:	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c-1340-	WARN_ON(ret);
kernel/trace/blktrace.c:1341:	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c-1342-	WARN_ON(ret);
kernel/trace/blktrace.c:1343:	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c-1344-	WARN_ON(ret);
kernel/trace/blktrace.c:1345:	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c-1346-	WARN_ON(ret);
kernel/trace/blktrace.c:1347:	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c-1348-	WARN_ON(ret);
kernel/trace/blktrace.c:1349:	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c-1350-	WARN_ON(ret);
kernel/trace/blktrace.c:1351:	ret = register_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1352-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c-1353-	WARN_ON(ret);
kernel/trace/blktrace.c:1354:	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
kernel/trace/blktrace.c-1355-						     NULL);
kernel/trace/blktrace.c-1356-	WARN_ON(ret);
kernel/trace/blktrace.c:1357:	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
kernel/trace/blktrace.c-1358-						NULL);
kernel/trace/blktrace.c-1359-	WARN_ON(ret);
kernel/trace/blktrace.c:1360:	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c-1361-	WARN_ON(ret);
kernel/trace/blktrace.c:1362:	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c-1363-	WARN_ON(ret);
kernel/trace/blktrace.c:1364:	ret = register_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c-1365-	WARN_ON(ret);
kernel/trace/blktrace.c:1366:	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c-1367-	WARN_ON(ret);
kernel/trace/blktrace.c:1368:	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c-1369-	WARN_ON(ret);
--
kernel/trace/blktrace.c=1372=static void blk_unregister_tracepoints(void)
kernel/trace/blktrace.c-1373-{
kernel/trace/blktrace.c:1374:	unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
kernel/trace/blktrace.c:1375:	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
kernel/trace/blktrace.c:1376:	unregister_trace_block_split(blk_add_trace_split, NULL);
kernel/trace/blktrace.c:1377:	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
kernel/trace/blktrace.c:1378:	unregister_trace_block_plug(blk_add_trace_plug, NULL);
kernel/trace/blktrace.c:1379:	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
kernel/trace/blktrace.c:1380:	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
kernel/trace/blktrace.c:1381:	unregister_trace_blk_zone_append_update_request_bio(
kernel/trace/blktrace.c-1382-		blk_add_trace_zone_update_request, NULL);
kernel/trace/blktrace.c:1383:	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
kernel/trace/blktrace.c:1384:	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
kernel/trace/blktrace.c:1385:	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
kernel/trace/blktrace.c:1386:	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
kernel/trace/blktrace.c:1387:	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
kernel/trace/blktrace.c:1388:	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
kernel/trace/blktrace.c:1389:	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
kernel/trace/blktrace.c:1390:	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
kernel/trace/blktrace.c:1391:	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
kernel/trace/blktrace.c:1392:	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
kernel/trace/blktrace.c-1393-
--
kernel/trace/blktrace.c=1839=static int __init __init_blk_tracer(void)
kernel/trace/blktrace.c-1840-{
kernel/trace/blktrace.c:1841:	if (!register_trace_event(&trace_blk_event)) {
kernel/trace/blktrace.c-1842-		pr_warn("Warning: could not register block events\n");
--
kernel/trace/blktrace.c-1847-		pr_warn("Warning: could not register the block tracer\n");
kernel/trace/blktrace.c:1848:		unregister_trace_event(&trace_blk_event);
kernel/trace/blktrace.c-1849-		return 1;
--
kernel/trace/fgraph.c=1236=static int start_graph_tracing(void)
--
kernel/trace/fgraph.c-1257-	if (!ret) {
kernel/trace/fgraph.c:1258:		ret = register_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1259-		if (ret)
--
kernel/trace/fgraph.c=1426=void unregister_ftrace_graph(struct fgraph_ops *gops)
--
kernel/trace/fgraph.c-1463-		unregister_pm_notifier(&ftrace_suspend_notifier);
kernel/trace/fgraph.c:1464:		unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
kernel/trace/fgraph.c-1465-	}
--
kernel/trace/ftrace.c=8691=void ftrace_pid_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/ftrace.c-8693-	if (enable) {
kernel/trace/ftrace.c:8694:		register_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8695-						  tr);
kernel/trace/ftrace.c:8696:		register_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8697-						  tr);
kernel/trace/ftrace.c-8698-	} else {
kernel/trace/ftrace.c:8699:		unregister_trace_sched_process_fork(ftrace_pid_follow_sched_process_fork,
kernel/trace/ftrace.c-8700-						    tr);
kernel/trace/ftrace.c:8701:		unregister_trace_sched_process_free(ftrace_pid_follow_sched_process_exit,
kernel/trace/ftrace.c-8702-						    tr);
--
kernel/trace/ftrace.c=8706=static void clear_ftrace_pids(struct trace_array *tr, int type)
--
kernel/trace/ftrace.c-8722-	if (!still_need_pid_events(type, pid_list, no_pid_list)) {
kernel/trace/ftrace.c:8723:		unregister_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8724-		for_each_possible_cpu(cpu)
--
kernel/trace/ftrace.c=8932=pid_write(struct file *filp, const char __user *ubuf,
--
kernel/trace/ftrace.c-8983-		/* Register a probe to set whether to ignore the tracing of a task */
kernel/trace/ftrace.c:8984:		register_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr);
kernel/trace/ftrace.c-8985-	}
--
kernel/trace/trace_branch.c=178=__init static int init_branch_tracer(void)
--
kernel/trace/trace_branch.c-181-
kernel/trace/trace_branch.c:182:	ret = register_trace_event(&trace_branch_event);
kernel/trace/trace_branch.c-183-	if (!ret) {
--
kernel/trace/trace_eprobe.c=77=static int eprobe_dyn_event_show(struct seq_file *m, struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-94-
kernel/trace/trace_eprobe.c:95:static int unregister_trace_eprobe(struct trace_eprobe *ep)
kernel/trace/trace_eprobe.c-96-{
--
kernel/trace/trace_eprobe.c=116=static int eprobe_dyn_event_release(struct dyn_event *ev)
--
kernel/trace/trace_eprobe.c-118-	struct trace_eprobe *ep = to_trace_eprobe(ev);
kernel/trace/trace_eprobe.c:119:	int ret = unregister_trace_eprobe(ep);
kernel/trace/trace_eprobe.c-120-
--
kernel/trace/trace_events.c=645=int trace_event_raw_init(struct trace_event_call *call)
--
kernel/trace/trace_events.c-648-
kernel/trace/trace_events.c:649:	id = register_trace_event(&call->event);
kernel/trace/trace_events.c-650-	if (!id)
--
kernel/trace/trace_events.c=1093=void trace_event_follow_fork(struct trace_array *tr, bool enable)
--
kernel/trace/trace_events.c-1095-	if (enable) {
kernel/trace/trace_events.c:1096:		register_trace_prio_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1097-						       tr, INT_MIN);
kernel/trace/trace_events.c:1098:		register_trace_prio_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1099-						       tr, INT_MAX);
kernel/trace/trace_events.c-1100-	} else {
kernel/trace/trace_events.c:1101:		unregister_trace_sched_process_fork(event_filter_pid_sched_process_fork,
kernel/trace/trace_events.c-1102-						    tr);
kernel/trace/trace_events.c:1103:		unregister_trace_sched_process_free(event_filter_pid_sched_process_exit,
kernel/trace/trace_events.c-1104-						    tr);
--
kernel/trace/trace_events.c=1188=static void unregister_pid_events(struct trace_array *tr)
kernel/trace/trace_events.c-1189-{
kernel/trace/trace_events.c:1190:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_pre, tr);
kernel/trace/trace_events.c:1191:	unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_post, tr);
kernel/trace/trace_events.c-1192-
kernel/trace/trace_events.c:1193:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1194:	unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1195-
kernel/trace/trace_events.c:1196:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1197:	unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1198-
kernel/trace/trace_events.c:1199:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_pre, tr);
kernel/trace/trace_events.c:1200:	unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_post, tr);
kernel/trace/trace_events.c-1201-}
--
kernel/trace/trace_events.c=2562=static void register_pid_events(struct trace_array *tr)
--
kernel/trace/trace_events.c-2569-	 */
kernel/trace/trace_events.c:2570:	register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_pre,
kernel/trace/trace_events.c-2571-					 tr, INT_MAX);
kernel/trace/trace_events.c:2572:	register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_post,
kernel/trace/trace_events.c-2573-					 tr, 0);
kernel/trace/trace_events.c-2574-
kernel/trace/trace_events.c:2575:	register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2576-					 tr, INT_MAX);
kernel/trace/trace_events.c:2577:	register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2578-					 tr, 0);
kernel/trace/trace_events.c-2579-
kernel/trace/trace_events.c:2580:	register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2581-					     tr, INT_MAX);
kernel/trace/trace_events.c:2582:	register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2583-					     tr, 0);
kernel/trace/trace_events.c-2584-
kernel/trace/trace_events.c:2585:	register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_pre,
kernel/trace/trace_events.c-2586-					 tr, INT_MAX);
kernel/trace/trace_events.c:2587:	register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_post,
kernel/trace/trace_events.c-2588-					 tr, 0);
--
kernel/trace/trace_events.c=3350=static void event_remove(struct trace_event_call *call)
--
kernel/trace/trace_events.c-3372-	if (call->event.funcs)
kernel/trace/trace_events.c:3373:		__unregister_trace_event(&call->event);
kernel/trace/trace_events.c-3374-	remove_event_from_tracers(call);
--
kernel/trace/trace_events_synth.c=955=static int register_synth_event(struct synth_event *event)
--
kernel/trace/trace_events_synth.c-977-
kernel/trace/trace_events_synth.c:978:	ret = register_trace_event(&call->event);
kernel/trace/trace_events_synth.c-979-	if (!ret) {
--
kernel/trace/trace_events_synth.c-999-	ret = set_synth_event_print_fmt(call);
kernel/trace/trace_events_synth.c:1000:	/* unregister_trace_event() will be called inside */
kernel/trace/trace_events_synth.c-1001-	if (ret < 0)
--
kernel/trace/trace_events_synth.c-1005- err:
kernel/trace/trace_events_synth.c:1006:	unregister_trace_event(&call->event);
kernel/trace/trace_events_synth.c-1007-	goto out;
--
kernel/trace/trace_events_user.c=1966=static int user_event_trace_register(struct user_event *user)
--
kernel/trace/trace_events_user.c-1969-
kernel/trace/trace_events_user.c:1970:	ret = register_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1971-
--
kernel/trace/trace_events_user.c-1977-	if (ret)
kernel/trace/trace_events_user.c:1978:		unregister_trace_event(&user->call.event);
kernel/trace/trace_events_user.c-1979-
--
kernel/trace/trace_fprobe.c=797=static int trace_fprobe_verify_target(struct trace_fprobe *tf)
--
kernel/trace/trace_fprobe.c-813-/* Internal register function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:814:static int __register_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-815-{
--
kernel/trace/trace_fprobe.c-841-/* Internal unregister function - just handle fprobe and flags */
kernel/trace/trace_fprobe.c:842:static void __unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-843-{
--
kernel/trace/trace_fprobe.c-853-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_fprobe.c:854:static int unregister_trace_fprobe(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-855-{
--
kernel/trace/trace_fprobe.c-872-unreg:
kernel/trace/trace_fprobe.c:873:	__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-874-	dyn_event_remove(&tf->devent);
--
kernel/trace/trace_fprobe.c=908=static int append_trace_fprobe_event(struct trace_fprobe *tf, struct trace_fprobe *to)
--
kernel/trace/trace_fprobe.c-945-/* Register a trace_probe and probe_event, and check the fprobe is available. */
kernel/trace/trace_fprobe.c:946:static int register_trace_fprobe_event(struct trace_fprobe *tf)
kernel/trace/trace_fprobe.c-947-{
--
kernel/trace/trace_fprobe.c=1209=static int trace_fprobe_create_internal(int argc, const char *argv[],
--
kernel/trace/trace_fprobe.c-1378-
kernel/trace/trace_fprobe.c:1379:	ret = register_trace_fprobe_event(tf);
kernel/trace/trace_fprobe.c-1380-	if (ret) {
--
kernel/trace/trace_fprobe.c=1419=static int trace_fprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_fprobe.c-1421-	struct trace_fprobe *tf = to_trace_fprobe(ev);
kernel/trace/trace_fprobe.c:1422:	int ret = unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1423-
--
kernel/trace/trace_fprobe.c=1457=static int enable_trace_fprobe(struct trace_event_call *call,
--
kernel/trace/trace_fprobe.c-1479-		list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
kernel/trace/trace_fprobe.c:1480:			ret = __register_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1481-			if (ret < 0)
--
kernel/trace/trace_fprobe.c-1490-	list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list)
kernel/trace/trace_fprobe.c:1491:		__unregister_trace_fprobe(tf);
kernel/trace/trace_fprobe.c-1492-	if (file)
--
kernel/trace/trace_functions_graph.c=1814=static __init int init_graph_trace(void)
--
kernel/trace/trace_functions_graph.c-1817-
kernel/trace/trace_functions_graph.c:1818:	if (!register_trace_event(&graph_trace_entry_event)) {
kernel/trace/trace_functions_graph.c-1819-		pr_warn("Warning: could not register graph trace events\n");
--
kernel/trace/trace_functions_graph.c-1823-#ifdef CONFIG_FUNCTION_GRAPH_RETADDR
kernel/trace/trace_functions_graph.c:1824:	if (!register_trace_event(&graph_trace_retaddr_entry_event)) {
kernel/trace/trace_functions_graph.c-1825-		pr_warn("Warning: could not register graph trace retaddr events\n");
--
kernel/trace/trace_functions_graph.c-1829-
kernel/trace/trace_functions_graph.c:1830:	if (!register_trace_event(&graph_trace_ret_event)) {
kernel/trace/trace_functions_graph.c-1831-		pr_warn("Warning: could not register graph trace events\n");
--
kernel/trace/trace_kprobe.c=469=static bool within_notrace_func(struct trace_kprobe *tk)
--
kernel/trace/trace_kprobe.c-494-/* Internal register function - just handle k*probes and flags */
kernel/trace/trace_kprobe.c:495:static int __register_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-496-{
--
kernel/trace/trace_kprobe.c-532-/* Internal unregister function - just handle k*probes and flags */
kernel/trace/trace_kprobe.c:533:static void __unregister_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-534-{
--
kernel/trace/trace_kprobe.c-548-/* Unregister a trace_probe and probe_event */
kernel/trace/trace_kprobe.c:549:static int unregister_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-550-{
--
kernel/trace/trace_kprobe.c-567-unreg:
kernel/trace/trace_kprobe.c:568:	__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-569-	dyn_event_remove(&tk->devent);
--
kernel/trace/trace_kprobe.c=604=static int append_trace_kprobe(struct trace_kprobe *tk, struct trace_kprobe *to)
--
kernel/trace/trace_kprobe.c-626-	/* Register k*probe */
kernel/trace/trace_kprobe.c:627:	ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-628-	if (ret == -ENOENT && !trace_kprobe_module_exist(tk)) {
--
kernel/trace/trace_kprobe.c-641-/* Register a trace_probe and probe_event */
kernel/trace/trace_kprobe.c:642:static int register_trace_kprobe(struct trace_kprobe *tk)
kernel/trace/trace_kprobe.c-643-{
--
kernel/trace/trace_kprobe.c-671-	/* Register k*probe */
kernel/trace/trace_kprobe.c:672:	ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-673-	if (ret == -ENOENT && !trace_kprobe_module_exist(tk)) {
--
kernel/trace/trace_kprobe.c=689=static int register_module_trace_kprobe(struct module *mod, struct trace_kprobe *tk)
--
kernel/trace/trace_kprobe.c-697-	if (!ret)
kernel/trace/trace_kprobe.c:698:		ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-699-	return ret;
--
kernel/trace/trace_kprobe.c=703=static int trace_kprobe_module_callback(struct notifier_block *nb,
--
kernel/trace/trace_kprobe.c-718-			/* Don't need to check busy - this should have gone. */
kernel/trace/trace_kprobe.c:719:			__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-720-			ret = register_module_trace_kprobe(mod, tk);
--
kernel/trace/trace_kprobe.c=854=static int trace_kprobe_create_internal(int argc, const char *argv[],
--
kernel/trace/trace_kprobe.c-1076-
kernel/trace/trace_kprobe.c:1077:	ret = register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1078-	if (ret) {
--
kernel/trace/trace_kprobe.c=1298=static int trace_kprobe_release(struct dyn_event *ev)
--
kernel/trace/trace_kprobe.c-1300-	struct trace_kprobe *tk = to_trace_kprobe(ev);
kernel/trace/trace_kprobe.c:1301:	int ret = unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1302-
--
kernel/trace/trace_kprobe.c=1933=create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
--
kernel/trace/trace_kprobe.c-1970-
kernel/trace/trace_kprobe.c:1971:	ret = __register_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1972-	if (ret < 0)
--
kernel/trace/trace_kprobe.c=1978=void destroy_local_trace_kprobe(struct trace_event_call *event_call)
--
kernel/trace/trace_kprobe.c-1990-
kernel/trace/trace_kprobe.c:1991:	__unregister_trace_kprobe(tk);
kernel/trace/trace_kprobe.c-1992-
--
kernel/trace/trace_osnoise.c=1004=static int hook_irq_events(void)
--
kernel/trace/trace_osnoise.c-1007-
kernel/trace/trace_osnoise.c:1008:	ret = register_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1009-	if (ret)
--
kernel/trace/trace_osnoise.c-1011-
kernel/trace/trace_osnoise.c:1012:	ret = register_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c-1013-	if (ret)
--
kernel/trace/trace_osnoise.c-1022-out_irq_exit:
kernel/trace/trace_osnoise.c:1023:	unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c-1024-out_unregister_entry:
kernel/trace/trace_osnoise.c:1025:	unregister_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1026-out_err:
--
kernel/trace/trace_osnoise.c=1036=static void unhook_irq_events(void)
--
kernel/trace/trace_osnoise.c-1038-	osnoise_arch_unregister();
kernel/trace/trace_osnoise.c:1039:	unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL);
kernel/trace/trace_osnoise.c:1040:	unregister_trace_irq_handler_entry(trace_irqentry_callback, NULL);
kernel/trace/trace_osnoise.c-1041-}
--
kernel/trace/trace_osnoise.c=1100=static int hook_softirq_events(void)
--
kernel/trace/trace_osnoise.c-1103-
kernel/trace/trace_osnoise.c:1104:	ret = register_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c-1105-	if (ret)
--
kernel/trace/trace_osnoise.c-1107-
kernel/trace/trace_osnoise.c:1108:	ret = register_trace_softirq_exit(trace_softirq_exit_callback, NULL);
kernel/trace/trace_osnoise.c-1109-	if (ret)
--
kernel/trace/trace_osnoise.c-1114-out_unreg_entry:
kernel/trace/trace_osnoise.c:1115:	unregister_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c-1116-out_err:
--
kernel/trace/trace_osnoise.c=1126=static void unhook_softirq_events(void)
kernel/trace/trace_osnoise.c-1127-{
kernel/trace/trace_osnoise.c:1128:	unregister_trace_softirq_entry(trace_softirq_entry_callback, NULL);
kernel/trace/trace_osnoise.c:1129:	unregister_trace_softirq_exit(trace_softirq_exit_callback, NULL);
kernel/trace/trace_osnoise.c-1130-}
--
kernel/trace/trace_osnoise.c=1239=static int register_migration_monitor(void)
--
kernel/trace/trace_osnoise.c-1250-
kernel/trace/trace_osnoise.c:1251:		ret = register_trace_sched_migrate_task(trace_sched_migrate_callback, NULL);
kernel/trace/trace_osnoise.c-1252-		if (!ret)
--
kernel/trace/trace_osnoise.c=1259=static void unregister_migration_monitor(void)
--
kernel/trace/trace_osnoise.c-1263-
kernel/trace/trace_osnoise.c:1264:	unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL);
kernel/trace/trace_osnoise.c-1265-	monitor_enabled = false;
--
kernel/trace/trace_osnoise.c=1302=static int hook_thread_events(void)
--
kernel/trace/trace_osnoise.c-1305-
kernel/trace/trace_osnoise.c:1306:	ret = register_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1307-	if (ret)
--
kernel/trace/trace_osnoise.c-1316-out_unreg:
kernel/trace/trace_osnoise.c:1317:	unregister_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1318-	return -EINVAL;
--
kernel/trace/trace_osnoise.c=1327=static void unhook_thread_events(void)
kernel/trace/trace_osnoise.c-1328-{
kernel/trace/trace_osnoise.c:1329:	unregister_trace_sched_switch(trace_sched_switch_callback, NULL);
kernel/trace/trace_osnoise.c-1330-	unregister_migration_monitor();
--
kernel/trace/trace_output.c=862=void trace_event_read_unlock(void)
--
kernel/trace/trace_output.c-867-/**
kernel/trace/trace_output.c:868: * register_trace_event - register output for an event type
kernel/trace/trace_output.c-869- * @event: the event type to register
--
kernel/trace/trace_output.c-881- */
kernel/trace/trace_output.c:882:int register_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-883-{
--
kernel/trace/trace_output.c-923-}
kernel/trace/trace_output.c:924:EXPORT_SYMBOL_GPL(register_trace_event);
kernel/trace/trace_output.c-925-
--
kernel/trace/trace_output.c-928- */
kernel/trace/trace_output.c:929:int __unregister_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-930-{
--
kernel/trace/trace_output.c-936-/**
kernel/trace/trace_output.c:937: * unregister_trace_event - remove a no longer used event
kernel/trace/trace_output.c-938- * @event: the event to remove
kernel/trace/trace_output.c-939- */
kernel/trace/trace_output.c:940:int unregister_trace_event(struct trace_event *event)
kernel/trace/trace_output.c-941-{
kernel/trace/trace_output.c-942-	down_write(&trace_event_sem);
kernel/trace/trace_output.c:943:	__unregister_trace_event(event);
kernel/trace/trace_output.c-944-	up_write(&trace_event_sem);
--
kernel/trace/trace_output.c-947-}
kernel/trace/trace_output.c:948:EXPORT_SYMBOL_GPL(unregister_trace_event);
kernel/trace/trace_output.c-949-
--
kernel/trace/trace_output.c=1922=__init int init_events(void)
--
kernel/trace/trace_output.c-1928-		event = events[i];
kernel/trace/trace_output.c:1929:		ret = register_trace_event(event);
kernel/trace/trace_output.c-1930-		WARN_ONCE(!ret, "event %d failed to register", event->type);
--
kernel/trace/trace_output.h=43=trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry);
--
kernel/trace/trace_output.h-45-/* used by module unregistering */
kernel/trace/trace_output.h:46:extern int __unregister_trace_event(struct trace_event *event);
kernel/trace/trace_output.h-47-extern struct rw_semaphore trace_event_sem;
--
kernel/trace/trace_probe.c=2691=int trace_probe_register_event_call(struct trace_probe *tp)
--
kernel/trace/trace_probe.c-2701-
kernel/trace/trace_probe.c:2702:	ret = register_trace_event(&call->event);
kernel/trace/trace_probe.c-2703-	if (!ret)
--
kernel/trace/trace_probe.c-2707-	if (ret)
kernel/trace/trace_probe.c:2708:		unregister_trace_event(&call->event);
kernel/trace/trace_probe.c-2709-
--
kernel/trace/trace_sched_switch.c=52=static int tracing_sched_register(void)
--
kernel/trace/trace_sched_switch.c-55-
kernel/trace/trace_sched_switch.c:56:	ret = register_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-57-	if (ret) {
--
kernel/trace/trace_sched_switch.c-62-
kernel/trace/trace_sched_switch.c:63:	ret = register_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-64-	if (ret) {
--
kernel/trace/trace_sched_switch.c-69-
kernel/trace/trace_sched_switch.c:70:	ret = register_trace_sched_switch(probe_sched_switch, NULL);
kernel/trace/trace_sched_switch.c-71-	if (ret) {
--
kernel/trace/trace_sched_switch.c-78-fail_deprobe_wake_new:
kernel/trace/trace_sched_switch.c:79:	unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-80-fail_deprobe:
kernel/trace/trace_sched_switch.c:81:	unregister_trace_sched_wakeup(probe_sched_wakeup, NULL);
kernel/trace/trace_sched_switch.c-82-	return ret;
--
kernel/trace/trace_sched_switch.c=85=static void tracing_sched_unregister(void)

]

235/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 41771
							output: 20
							thoughts: 6884
						

Thoughts:
**Analyzing the Patch for Tracepoint Registration and Unregistration**

Okay, so I've been tasked with thoroughly reviewing this patch and I've started by focusing on how the tracepoints are registered and unregistered within the block layer. I'm seeing a change to the return type of `blk_register_tracepoints` from `static void` to `static int`, and I need to understand why. Looking at `kernel/trace/trace_sched_switch.c` and similar files, I am reminded that registration and unregistration often involve synchronization to prevent race conditions during module loading and unloading, so let's dig into the details to verify the changes maintain integrity.

I've examined the `blk_register_tracepoints` function itself and noticed that it now explicitly returns an integer value and uses a series of `register_trace_...` calls, each potentially leading to a `goto` statement to an unregistration sequence in case of failure. This pattern strongly suggests error handling is now integrated directly into the registration process. It’s an interesting design choice, as the code now unwinds the registration process systematically in case of failure. The patch also shows `tracepoint_synchronize_unregister()` being used for graceful unregistration, which is a good practice to avoid deadlocks. This matches the corresponding `blk_unregister_tracepoints()` perfectly, with the unwinding being a reverse LIFO ladder, which is what I would expect.

Now, I'm focusing on `get_probe_ref()` and `put_probe_ref()`, because these functions are clearly managing a reference count (`blk_probes_ref`) to ensure the tracepoints are only registered when needed. I’m satisfied that `blk_probes_ref` is correctly managed. If the registration fails initially, it's properly reset to 0, ensuring that subsequent calls will attempt registration again if needed. When it goes from 0 -> 1 the probe is registered and vice versa. It seems robust and avoids double registration or premature unregistration. `get_probe_ref()` increments and `put_probe_ref()` decrements, so the setup and teardown are safe. The changes seem sound in principle.

Next, I have to verify that all the callers of `get_probe_ref()` are handling the potential return error from `blk_register_tracepoints()` correctly. I've located and reviewed `blk_trace_setup_queue`, `blk_trace_setup_finalize`, `blk_trace_setup`, `blk_trace_setup2`, and `compat_blk_trace_setup`. I see that the new `get_probe_ref()` call is placed before the assignment of the `blk_trace` structure. Crucially, if `get_probe_ref()` returns an error, the code jumps to an error path that calls `blk_trace_free()`, which will free all the resources allocated so far and *importantly*, the `blk_trace` structure remains NULL, preventing any potential use-after-free or double-free issues. I verified that `blk_trace_free` properly closes `relay_close` which handles memory, calls debugfs_remove and unregisters all the traces from the system, and properly free percpu data.

I'm confident that these error handling mechanisms are sound and complete. The callers all check the return value of `get_probe_ref()`, and if the registration fails the code immediately calls the teardown logic to ensure all acquired resources are released. It prevents assigning `q->blk_trace` if the probe registration fails. The changes appear safe and avoid any introduction of new memory leaks or use-after-free bugs.

Finally, I've confirmed by searching the whole kernel code that the patch has addressed all use cases of `blk_register_tracepoints`.

So, from my expert perspective, this patch looks well-designed and the added error handling around the tracepoint registration process appears to be correctly implemented, adding robustness to the blktrace system. I'm comfortable with the changes.



236/5 2026/08/31 21:57 tool grepper
0m Args:
map[Expression:blk_probes_ref]

Results:
map[Output:kernel/trace/blktrace.c=60=static DEFINE_MUTEX(blk_probe_mutex);
kernel/trace/blktrace.c:61:static int blk_probes_ref;
kernel/trace/blktrace.c-62-
--
kernel/trace/blktrace.c=488=static void get_probe_ref(void)
--
kernel/trace/blktrace.c-490-	mutex_lock(&blk_probe_mutex);
kernel/trace/blktrace.c:491:	if (++blk_probes_ref == 1)
kernel/trace/blktrace.c-492-		blk_register_tracepoints();
--
kernel/trace/blktrace.c=496=static void put_probe_ref(void)
--
kernel/trace/blktrace.c-498-	mutex_lock(&blk_probe_mutex);
kernel/trace/blktrace.c:499:	if (!--blk_probes_ref)
kernel/trace/blktrace.c-500-		blk_unregister_tracepoints();
]

237/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 49810
							output: 20
							thoughts: 19
						

Thoughts:
Here's my take on those thoughts:

**Checking for Redundancy**

Okay, so I'm thinking, before I go any further down this rabbit hole, I should just make sure I'm not duplicating effort. The first thing that comes to mind is: has anyone else already implemented or partially implemented what I'm aiming for? Specifically, I need to know if `blk_register_tracepoints` (or something similar in functionality) has already been addressed elsewhere. A quick search seems prudent. I need to know if there is existing work.



238/5 2026/08/31 21:57 tool grepper
0m Args:
map[Expression:blk_register_tracepoints]

Results:
map[Output:kernel/trace/blktrace.c=61=static int blk_probes_ref;
kernel/trace/blktrace.c-62-
kernel/trace/blktrace.c:63:static void blk_register_tracepoints(void);
kernel/trace/blktrace.c-64-static void blk_unregister_tracepoints(void);
--
kernel/trace/blktrace.c=488=static void get_probe_ref(void)
--
kernel/trace/blktrace.c-491-	if (++blk_probes_ref == 1)
kernel/trace/blktrace.c:492:		blk_register_tracepoints();
kernel/trace/blktrace.c-493-	mutex_unlock(&blk_probe_mutex);
--
kernel/trace/blktrace.c=1325=EXPORT_SYMBOL_GPL(blk_add_driver_data);
kernel/trace/blktrace.c-1326-
kernel/trace/blktrace.c:1327:static void blk_register_tracepoints(void)
kernel/trace/blktrace.c-1328-{
]

239/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 50267
							output: 22
							thoughts: 26
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing Probe Reference Usage**

Alright, let's see. My initial hunch is to ensure we're accounting for every instance where `get_probe_ref` or `put_probe_ref` are being invoked. I need to make sure we're not missing any potential edge cases or subtly different implementations that could cause issues down the line. We want to be absolutely certain of the scope of these references. This calls for a thorough search of the codebase. I need to know where these functions are getting called to ensure there are no surprises with reference counts or unexpected sharing.



240/5 2026/08/31 21:57 tool grepper
0m Args:
map[Expression:(get|put)_probe_ref]

Results:
map[Output:kernel/trace/blktrace.c=469=static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
--
kernel/trace/blktrace.c-487-
kernel/trace/blktrace.c:488:static void get_probe_ref(void)
kernel/trace/blktrace.c-489-{
--
kernel/trace/blktrace.c-495-
kernel/trace/blktrace.c:496:static void put_probe_ref(void)
kernel/trace/blktrace.c-497-{
--
kernel/trace/blktrace.c=535=static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt)
--
kernel/trace/blktrace.c-539-	blk_trace_free(q, bt);
kernel/trace/blktrace.c:540:	put_probe_ref();
kernel/trace/blktrace.c-541-}
--
kernel/trace/blktrace.c=730=static void blk_trace_setup_finalize(struct request_queue *q,
--
kernel/trace/blktrace.c-758-	rcu_assign_pointer(q->blk_trace, bt);
kernel/trace/blktrace.c:759:	get_probe_ref();
kernel/trace/blktrace.c-760-}
--
kernel/trace/blktrace.c=1880=static int blk_trace_remove_queue(struct request_queue *q)
--
kernel/trace/blktrace.c-1890-
kernel/trace/blktrace.c:1891:	put_probe_ref();
kernel/trace/blktrace.c-1892-	synchronize_rcu();
--
kernel/trace/blktrace.c=1900=static int blk_trace_setup_queue(struct request_queue *q,
--
kernel/trace/blktrace.c-1919-	rcu_assign_pointer(q->blk_trace, bt);
kernel/trace/blktrace.c:1920:	get_probe_ref();
kernel/trace/blktrace.c-1921-	return 0;
]

241/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 51043
							output: 52
							thoughts: 29
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Investigating `blk_trace_cleanup`**

Right, time to dig into this. First, I need to make absolutely certain about the implications of `blk_trace_cleanup`. Just calling it isn't enough; I need to understand its context. Let's start by methodically searching for all references to `blk_trace_cleanup`. This isn't just a casual scan; I need to find all the call sites, all the potential uses. Only then can I be confident I understand how this function interacts with the rest of the block tracing infrastructure. I need to know *who* calls it, *when* they call it, and *why* they call it. That should be enough to start my analysis.



242/5 2026/08/31 21:57 tool codesearch-find-references
0m Args:
map[ContextFile:kernel/trace/blktrace.c IncludeSnippetLines:10 Name:blk_trace_cleanup SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__blk_trace_remove SourceFile:kernel/trace/blktrace.c SourceLine:552 SourceSnippet: 543:	static int __blk_trace_remove(struct request_queue *q)
 544:	{
 545:		struct blk_trace *bt;
 546:	
 547:		bt = rcu_replace_pointer(q->blk_trace, NULL,
 548:					 lockdep_is_held(&q->debugfs_mutex));
 549:		if (!bt)
 550:			return -EINVAL;
 551:	
 552:		blk_trace_cleanup(q, bt);
 553:	
 554:		return 0;
 555:	}
]] TruncatedOutput:false]

243/5 2026/08/31 21:57 llm patch-reviewer
0m Model:
gemini-3.7-flash

Tokens:
							input: 51542
							output: 19
							thoughts: 5260
						

Thoughts:
**Review of Blktrace Patch - Thorough Analysis**

Okay, let's dive into this patch. My initial impression is that it's a solid, careful piece of work. The main focus is on improving the robustness of the block tracing probe registration and unregistration process, particularly around concurrency and failure handling. I'm going to run through each diff part to confirm my initial thought.

*   **Diff Part 1:** The forward declaration change from `void` to `int` is correct. Standard practice. Nothing to see here.

*   **Diff Part 2:** This is the core of the patch. The introduction of the `get_probe_ref()` function and its associated mutex (`blk_probe_mutex`) is all about managing probe registration/unregistration. The use of a reference counter (`blk_probes_ref`) along with the conditional `blk_register_tracepoints()` call under the mutex lock is the correct way to handle this. The key is that the patch *correctly* now ensures that `blk_register_tracepoints()` is only called *once*, even in concurrent scenarios, when the reference count goes from 0 to 1. The introduction of the return value from `blk_register_tracepoints()` and the subsequent cleanup if registration fails is also a crucial improvement. Now, if the registration fails, we decrement the refcount, which is the correct cleanup. The patch elegantly handles the concurrency and the potential for a registration failure.

*   **Diff Parts 3, 4, 5, 6, 8:** The changes in `blk_trace_setup_finalize`, `blk_trace_setup`, `blk_trace_setup2`, `compat_blk_trace_setup` and `blk_trace_setup_queue` all focus on ensuring that the probe registration is done *before* the trace data structure (`bt`) is published to the `request_queue` (`q->blk_trace`). This addresses a fundamental lifecycle problem and ensures that callers of `get_probe_ref()` will *always* see a valid state. This is exactly what we want.

*   **Diff Part 7:** This is the most crucial part to check: the implementation of `blk_register_tracepoints()` and its associated unwinding. I'm going to review the full ladder and tracepoints to verify that there are no bugs. I see 18 tracepoints being registered and an equally long, carefully crafted unwind ladder on failures. This is *textbook* correct LIFO unwinding. The gotos all line up exactly with reverse registration order. I am also happy to see `tracepoint_synchronize_unregister()` called.

*   **Architectural Review Checklist:** I can definitively answer yes to all checklist items:
    1.  **The Sentinel Test:** The sentinel is not necessary because the caller handles any failures with the correct LIFO unwind ladder.
    2.  **LIFO Stack Unwinding Symmetry:** As shown in Diff part 7, the unwinding is spot-on.
    3.  **Ownership Decoupling:** Correct. `rcu_assign_pointer` is done *after* probes are registered.
    4.  **Codebase Idiom Alignment:** Standard LIFO ladder, error propagation and synchronization are used.

Therefore, `ReviewApproved` should be `true`, and `ReviewComments` should be `[]`. This is an excellent patch.



244/5 2026/08/31 21:58 tool set-results
0m Args:
map[ReviewApproved:true ReviewComments:[]]

Results:
map[ReviewApproved:true ReviewComments:[]]

245/4 2026/08/31 21:58 action evaluate-patch-review
0m Results:
map[NeedsIteration:false ReviewFeedback:]

246/1 2026/08/31 21:58 action apply-patch
0m Results:
map[]

247/1 2026/08/31 21:58 action init-style-items
0m Results:
map[StyleItems:<nil>]

248/1 2026/08/31 21:58 action run-checkpatch
0m Results:
map[CheckpatchOutput:total: 0 errors, 0 warnings, 252 lines checked

Your patch has no obvious style problems and is ready for submission.
]

249/1 2026/08/31 21:58 loop
0m
250/2 2026/08/31 21:58 iteration 0
0m
251/3 2026/08/31 21:58 agent checkpatch-arbiter
0m Model:
core

Results:
map[ActionableIssues:[]]

Instruction:
You are an expert Linux kernel maintainer acting as a code style arbiter.
Your task is to review scripts/checkpatch.pl output and reviewer style requests for a proposed patch.

Determine which reported issues are genuine, actionable formatting/style defects (e.g. indentation, whitespace,
naming, syntax style) and should be fixed. List them in ActionableIssues.

Ignore issues that are false positives, intentional constructs (e.g. BUG_ON/XA_BUG_ON in test files, macros,
subsystem conventions), or unfixable without breaking code logic or tests. If no issues should be changed,
leave ActionableIssues empty.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
The patch diff is:

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:



The checkpatch.pl output is:
total: 0 errors, 0 warnings, 252 lines checked

Your patch has no obvious style problems and is ready for submission.







Carefully evaluate each issue and populate ActionableIssues.

252/4 2026/08/31 21:58 llm checkpatch-arbiter
0m Model:
gemini-3.7-flash

Tokens:
							input: 3849
							output: 15
							thoughts: 519
						

Thoughts:
**Patch Evaluation: Style and Structure**

Okay, let's take a look at this patch. First, I need to check the `checkpatch` output. Alright, looks clean: "0 errors, 0 warnings, 252 lines checked." That's a good start, "Your patch has no obvious style problems and is ready for submission." Still, I should confirm there are no subtle, *actionable* style issues missed by the tool. I need to make sure I'm not overlooking anything. There aren't any reviewer comments to consider, so it's just me.

Let's do a quick visual scan of the diff. I see `static int blk_register_tracepoints(void);`. Looks fine. I see a `get_probe_ref` returning `int`, which is correct. Scanning down... Aha! `blk_trace_setup_finalize`. Wait... is that extra blank line before the opening brace supposed to be there? Let me double-check the context... Okay, yeah, it's there in the *original* code too (the context line shows this). Not an issue.

Now, let's look at the unwinding labels in `blk_register_tracepoints`. Labels and gotos... looks like they are correctly aligned to column 0, which is the standard kernel style.

Alright, so `checkpatch` is happy, and my quick review didn't turn up any actionable style issues. I'm going to set the results to `ActionableIssues: []`. Patch looks good from a style perspective.



253/4 2026/08/31 21:58 tool set-results
0m Args:
map[ActionableIssues:[]]

Results:
map[ActionableIssues:[]]

254/3 2026/08/31 21:58 action evaluate-checkpatch-arbiter
0m Results:
map[NeedRefinement:false]

255/3 2026/08/31 21:58 action If
0m Args:
map[NeedRefinement:false]

256/1 2026/08/31 21:58 agent fixes-finder
12m Model:
core

Results:
map[FixesHash:5f3ea37c7716db4e894a480e0c18b24399595b6b]

Instruction:
You are an experienced Linux kernel developer tasked with identifying the commit
that introduced the bug being fixed. Identifying the correct buggy commit is crucial
for proper kernel maintenance (backporting to stable trees, etc.).

Your investigation strategy:
1. Examine the patch that fixes the bug. Use git tools (like git-log or git-blame)
   to trace the history of the lines or functions modified by the patch.
2. Analyze the stack trace in the crash report. Identify the key files and functions
   involved in the crash and investigate their history to see when the problematic
   logic was introduced.
3. Compare the bug explanation with the commit history to find the point where
   the described logic error first appeared.

A bug is typically introduced when a piece of code is first written, or when
a refactoring changed its logic in a way that introduced the bug.
Trace the history of relevant symbols or find when specific code patterns were introduced/removed.

You must provide exactly one bug-introducing commit hash.
If you are unable to confidently determine the bug-introducing commit after investigation,
return an empty string rather than guessing.

Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
The crash is:

R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>



The explanation of the root cause is:

The root cause of the crash is that `blk_register_tracepoints()` uses `WARN_ON(ret)` to check the return values of `register_trace_block_*()` functions. These tracepoint registration functions allocate memory for the probe array and can fail with `-ENOMEM` (e.g., under memory pressure or fault injection, as seen in the syzbot report). When they fail, `WARN_ON()` triggers a kernel panic if `panic_on_warn` is set.

Furthermore, `blk_register_tracepoints()` currently ignores the error and continues, leaving the tracepoints in a partially registered state. Later, when tracing is stopped, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. Unregistering a tracepoint that was not successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers another `WARN_ON_ONCE` inside `tracepoint_remove_func()`.

To fix this, we need to properly handle the registration failures by returning the error, unregistering the successfully registered tracepoints, and propagating the error up the call stack to fail the blktrace setup.

### Fix Details

1. **Change `blk_register_tracepoints()` to return an `int` and handle errors:**
   Instead of `WARN_ON(ret)`, check the return value of each `register_trace_*()` call. If it fails, use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error.

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		return ret;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto err_issue;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto err_merge;
        // ... (do this for all 18 tracepoints) ...
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto err_rq_remap;
	return 0;

err_rq_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
// ... (unregister labels in reverse order) ...
err_merge:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
err_issue:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	return ret;
}
```

2. **Propagate the error through `get_probe_ref()`:**
```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

3. **Propagate the error through `blk_trace_setup_finalize()`:**
```c
static int blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)
{
	int ret;
        // ... existing code ...
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
}
```

4. **Handle the error in the callers of `blk_trace_setup_finalize()`:**
   In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, check the return value of `blk_trace_setup_finalize()`. If it fails, clean up the allocated `bt` and return the error:
```c
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
```

5. **Handle the error in `blk_trace_setup_queue()`:**
```c
static int blk_trace_setup_queue(struct request_queue *q,
				 struct block_device *bdev)
{
        // ... existing code ...
	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt:
	blk_trace_free(q, bt);
	return ret;
}
```


The patch that fixes the bug is:

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:


Search for the commit(s) that introduced this bug.

257/2 2026/08/31 21:58 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 10622
							output: 38
							thoughts: 191
						

Thoughts:
**Analyzing the Bug-Fixing Patch**

Okay, so the challenge is to pinpoint the commit that initially introduced the bug that this patch in `kernel/trace/blktrace.c` is fixing. Let's dig in. I see the patch's changes revolve around `blk_register_tracepoints()`. Specifically, it's transforming `blk_register_tracepoints()` from a `void` return type with a `WARN_ON` on failure of the `register_trace_block_*()` functions, into an `int`-returning function. Now, if `register_trace_block_*()` fails, it rolls back the registered tracepoints, and crucially, propagates the error up through `get_probe_ref()`, `blk_trace_setup_finalize()`, and `blk_trace_setup_queue()`. This is a significant improvement in error handling.

To find the source of the bug, my immediate thought is to use my favorite tools. I'll reach for `git-log` or `git-blame` on `kernel/trace/blktrace.c` itself. I need to focus on the history of changes related to `blk_register_tracepoints`, the calls to `get_probe_ref`, and any instances where `WARN_ON` was used *within* that function. The switch from void with a warning to an error code and cleanup is the key, so any change around those lines is what I need to see. Hopefully, that will give me enough information to pinpoint when and why the change occurred that ultimately allowed the bug to exist.



258/2 2026/08/31 21:58 tool git-log
0m Args:
map[CodeRegexp:blk_register_tracepoints PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:a6da0024ffc1 blktrace: fix unlocked registration of tracepoints
17ba97e347be blktrace: fix blk_probes_ref chaos
cbe28296eb1a blktrace: don't increase blk_probes_ref if failed to setup blk trace
3c289ba7c320 blktrace: remove blk_probe_mutex
2db270a80b8f tracing/blktrace: move the tracing file to kernel/trace
]

259/2 2026/08/31 21:58 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 11326
							output: 101
							thoughts: 23
						

Thoughts:
Here's a summary of my thinking process, delivered as though I'm the one having these thoughts:

**Analyzing the Git History**

Okay, so I've got a list of commits here. My immediate thought is, let's dive into the history. I need to understand the evolution of this code, the changes that were made, and the context around them.

To do this efficiently, I'm reaching for my trusty Git tools. `git-blame` will be the starting point to identify the author and the specific commit responsible for introducing particular lines of code. This is fantastic for understanding who wrote what and when they last touched it, which is especially handy for debugging or understanding the rationale behind a design choice.

Then, depending on what I find with blame, I'll likely use `git-show` to examine a specific commit in detail. `git-show` will let me see the exact diff introduced by that commit – the additions, deletions, and modifications. This will give me the low-level change data, and the commit message, which will provide context for the changes.

Finally, if I need a broader overview, a longer view of the whole process of changes, I'll turn to `git-log`. This command gives me the entire commit history in a more abstract form, which helps me see the big picture. I can trace the development timeline, visualize branches, and quickly identify potential areas of interest or important milestones.

In essence, I'm formulating a plan that uses a progressive level of detail, starting with identifying the immediate source of changes and then working backwards to understand the larger context. This gives me a comprehensive view of how we arrived at the current state of the code.



260/2 2026/08/31 21:58 tool git-show
0m Args:
map[Commit:a6da0024ffc1]

Results:
map[Output:commit a6da0024ffc19e0d47712bb5ca4fd083f76b07df
Author: Jens Axboe <axboe@kernel.dk>
Date:   Sun Nov 5 09:16:09 2017 -0700

    blktrace: fix unlocked registration of tracepoints
    
    We need to ensure that tracepoints are registered and unregistered
    with the users of them. The existing atomic count isn't enough for
    that. Add a lock around the tracepoints, so we serialize access
    to them.
    
    This fixes cases where we have multiple users setting up and
    tearing down tracepoints, like this:
    
    CPU: 0 PID: 2995 Comm: syzkaller857118 Not tainted
    4.14.0-rc5-next-20171018+ #36
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
    Google 01/01/2011
    Call Trace:
      __dump_stack lib/dump_stack.c:16 [inline]
      dump_stack+0x194/0x257 lib/dump_stack.c:52
      panic+0x1e4/0x41c kernel/panic.c:183
      __warn+0x1c4/0x1e0 kernel/panic.c:546
      report_bug+0x211/0x2d0 lib/bug.c:183
      fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:177
      do_trap_no_signal arch/x86/kernel/traps.c:211 [inline]
      do_trap+0x260/0x390 arch/x86/kernel/traps.c:260
      do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:297
      do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:310
      invalid_op+0x18/0x20 arch/x86/entry/entry_64.S:905
    RIP: 0010:tracepoint_add_func kernel/tracepoint.c:210 [inline]
    RIP: 0010:tracepoint_probe_register_prio+0x397/0x9a0 kernel/tracepoint.c:283
    RSP: 0018:ffff8801d1d1f6c0 EFLAGS: 00010293
    RAX: ffff8801d22e8540 RBX: 00000000ffffffef RCX: ffffffff81710f07
    RDX: 0000000000000000 RSI: ffffffff85b679c0 RDI: ffff8801d5f19818
    RBP: ffff8801d1d1f7c8 R08: ffffffff81710c10 R09: 0000000000000004
    R10: ffff8801d1d1f6b0 R11: 0000000000000003 R12: ffffffff817597f0
    R13: 0000000000000000 R14: 00000000ffffffff R15: ffff8801d1d1f7a0
      tracepoint_probe_register+0x2a/0x40 kernel/tracepoint.c:304
      register_trace_block_rq_insert include/trace/events/block.h:191 [inline]
      blk_register_tracepoints+0x1e/0x2f0 kernel/trace/blktrace.c:1043
      do_blk_trace_setup+0xa10/0xcf0 kernel/trace/blktrace.c:542
      blk_trace_setup+0xbd/0x180 kernel/trace/blktrace.c:564
      sg_ioctl+0xc71/0x2d90 drivers/scsi/sg.c:1089
      vfs_ioctl fs/ioctl.c:45 [inline]
      do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:685
      SYSC_ioctl fs/ioctl.c:700 [inline]
      SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
      entry_SYSCALL_64_fastpath+0x1f/0xbe
    RIP: 0033:0x444339
    RSP: 002b:00007ffe05bb5b18 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
    RAX: ffffffffffffffda RBX: 00000000006d66c0 RCX: 0000000000444339
    RDX: 000000002084cf90 RSI: 00000000c0481273 RDI: 0000000000000009
    RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000206 R12: ffffffffffffffff
    R13: 00000000c0481273 R14: 0000000000000000 R15: 0000000000000000
    
    since we can now run these in parallel. Ensure that the exported helpers
    for doing this are grabbing the queue trace mutex.
    
    Reported-by: Steven Rostedt <rostedt@goodmis.org>
    Tested-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index ea57dd94b2b2..206e0e2ace53 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -66,7 +66,8 @@ static struct tracer_flags blk_tracer_flags = {
 };
 
 /* Global reference count of probes */
-static atomic_t blk_probes_ref = ATOMIC_INIT(0);
+static DEFINE_MUTEX(blk_probe_mutex);
+static int blk_probes_ref;
 
 static void blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
@@ -329,11 +330,26 @@ static void blk_trace_free(struct blk_trace *bt)
 	kfree(bt);
 }
 
+static void get_probe_ref(void)
+{
+	mutex_lock(&blk_probe_mutex);
+	if (++blk_probes_ref == 1)
+		blk_register_tracepoints();
+	mutex_unlock(&blk_probe_mutex);
+}
+
+static void put_probe_ref(void)
+{
+	mutex_lock(&blk_probe_mutex);
+	if (!--blk_probes_ref)
+		blk_unregister_tracepoints();
+	mutex_unlock(&blk_probe_mutex);
+}
+
 static void blk_trace_cleanup(struct blk_trace *bt)
 {
 	blk_trace_free(bt);
-	if (atomic_dec_and_test(&blk_probes_ref))
-		blk_unregister_tracepoints();
+	put_probe_ref();
 }
 
 static int __blk_trace_remove(struct request_queue *q)
@@ -549,8 +565,7 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	if (cmpxchg(&q->blk_trace, NULL, bt))
 		goto err;
 
-	if (atomic_inc_return(&blk_probes_ref) == 1)
-		blk_register_tracepoints();
+	get_probe_ref();
 
 	ret = 0;
 err:
@@ -1596,9 +1611,7 @@ static int blk_trace_remove_queue(struct request_queue *q)
 	if (bt == NULL)
 		return -EINVAL;
 
-	if (atomic_dec_and_test(&blk_probes_ref))
-		blk_unregister_tracepoints();
-
+	put_probe_ref();
 	blk_trace_free(bt);
 	return 0;
 }
@@ -1629,8 +1642,7 @@ static int blk_trace_setup_queue(struct request_queue *q,
 	if (cmpxchg(&q->blk_trace, NULL, bt))
 		goto free_bt;
 
-	if (atomic_inc_return(&blk_probes_ref) == 1)
-		blk_register_tracepoints();
+	get_probe_ref();
 	return 0;
 
 free_bt:
]

261/2 2026/08/31 21:58 tool git-show
0m Args:
map[Commit:17ba97e347be]

Results:
map[Output:commit 17ba97e347bec9bbc47a0877c7a098708982129d
Author: Li Zefan <lizf@cn.fujitsu.com>
Date:   Fri Mar 27 10:20:09 2009 +0800

    blktrace: fix blk_probes_ref chaos
    
    Impact: fix mixed ioctl and ftrace-plugin blktrace use refcount bugs
    
    ioctl-based blktrace allocates bt and registers tracepoints when
    ioctl(BLKTRACESETUP), and do all cleanups when ioctl(BLKTRACETEARDOWN).
    
    while ftrace-based blktrace allocates/frees bt when:
      # echo 1/0 > /sys/block/sda/sda1/trace/enable
    
    and registers/unregisters tracepoints when:
      # echo blk/nop > /debugfs/tracing/current_tracer
    or
      # echo 1/0 > /debugfs/tracing/tracing_enable
    
    The separatation of allocation and registeration causes 2 problems:
    
      1. current user-space blktrace still calls ioctl(TEARDOWN) when
         ioctl(SETUP) failed:
           # echo 1 > /sys/block/sda/sda1/trace/enable
           # blktrace /dev/sda
             BLKTRACESETUP: Device or resource busy
             ^C
         and now blk_probes_ref == -1
    
      2. Another way to make blk_probes_ref == -1:
         # plugin sdb && mount sdb1
         # echo 1 > /sys/block/sdb/sdb1/trace/enable
         # remove sdb
    
    This patch does the allocation and registeration when writing
    sdaX/trace/enable.
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Acked-by: Jens Axboe <jens.axboe@oracle.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 5b28f0f119c5..8d6bd12aab10 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -478,7 +478,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		goto err;
 	}
 
-	if (atomic_add_return(1, &blk_probes_ref) == 1)
+	if (atomic_inc_return(&blk_probes_ref) == 1)
 		blk_register_tracepoints();
 
 	return 0;
@@ -1091,8 +1091,6 @@ static void blk_tracer_print_header(struct seq_file *m)
 
 static void blk_tracer_start(struct trace_array *tr)
 {
-	if (atomic_add_return(1, &blk_probes_ref) == 1)
-		blk_register_tracepoints();
 	trace_flags &= ~TRACE_ITER_CONTEXT_INFO;
 }
 
@@ -1107,15 +1105,10 @@ static int blk_tracer_init(struct trace_array *tr)
 static void blk_tracer_stop(struct trace_array *tr)
 {
 	trace_flags |= TRACE_ITER_CONTEXT_INFO;
-	if (atomic_dec_and_test(&blk_probes_ref))
-		blk_unregister_tracepoints();
 }
 
 static void blk_tracer_reset(struct trace_array *tr)
 {
-	if (!atomic_read(&blk_probes_ref))
-		return;
-
 	blk_tracer_enabled = false;
 	blk_tracer_stop(tr);
 }
@@ -1254,6 +1247,9 @@ static int blk_trace_remove_queue(struct request_queue *q)
 	if (bt == NULL)
 		return -EINVAL;
 
+	if (atomic_dec_and_test(&blk_probes_ref))
+		blk_unregister_tracepoints();
+
 	kfree(bt);
 	return 0;
 }
@@ -1280,6 +1276,9 @@ static int blk_trace_setup_queue(struct request_queue *q, dev_t dev)
 		return -EBUSY;
 	}
 
+	if (atomic_inc_return(&blk_probes_ref) == 1)
+		blk_register_tracepoints();
+
 	return 0;
 }
 
]

262/2 2026/08/31 21:58 tool git-show
0m Args:
map[Commit:cbe28296eb1a]

Results:
map[Output:commit cbe28296eb1ac441b35cf45804d0ae808add7dd1
Author: Li Zefan <lizf@cn.fujitsu.com>
Date:   Fri Mar 20 09:48:47 2009 +0800

    blktrace: don't increase blk_probes_ref if failed to setup blk trace
    
    do_blk_trace_setup() may return EBUSY, but the current code
    doesn't decrease blk_probes_ref in this case.
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
    Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jens Axboe <jens.axboe@oracle.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    LKML-Reference: <49C2F5FF.80002@cn.fujitsu.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 223b92e77b3f..11e7c8d9d222 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -468,9 +468,6 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
-	if (atomic_add_return(1, &blk_probes_ref) == 1)
-		blk_register_tracepoints();
-
 	ret = -EBUSY;
 	old_bt = xchg(&q->blk_trace, bt);
 	if (old_bt) {
@@ -478,6 +475,9 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		goto err;
 	}
 
+	if (atomic_add_return(1, &blk_probes_ref) == 1)
+		blk_register_tracepoints();
+
 	return 0;
 err:
 	if (bt) {
]

263/2 2026/08/31 21:58 tool git-show
0m Args:
map[Commit:3c289ba7c320]

Results:
map[Output:commit 3c289ba7c320560ee74979a8895141c829046a2d
Author: Li Zefan <lizf@cn.fujitsu.com>
Date:   Fri Mar 20 09:48:26 2009 +0800

    blktrace: remove blk_probe_mutex
    
    blk_register_tracepoints() always returns 0, so make it return void,
    thus we don't need to use blk_probe_mutex to protect blk_probes_ref.
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
    Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jens Axboe <jens.axboe@oracle.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    LKML-Reference: <49C2F5EA.8060606@cn.fujitsu.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 73845b7968bb..223b92e77b3f 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -47,10 +47,9 @@ static struct tracer_flags blk_tracer_flags = {
 };
 
 /* Global reference count of probes */
-static DEFINE_MUTEX(blk_probe_mutex);
 static atomic_t blk_probes_ref = ATOMIC_INIT(0);
 
-static int blk_register_tracepoints(void);
+static void blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 /*
@@ -256,10 +255,8 @@ static void blk_trace_cleanup(struct blk_trace *bt)
 	free_percpu(bt->sequence);
 	free_percpu(bt->msg_data);
 	kfree(bt);
-	mutex_lock(&blk_probe_mutex);
 	if (atomic_dec_and_test(&blk_probes_ref))
 		blk_unregister_tracepoints();
-	mutex_unlock(&blk_probe_mutex);
 }
 
 int blk_trace_remove(struct request_queue *q)
@@ -471,13 +468,8 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
-	mutex_lock(&blk_probe_mutex);
-	if (atomic_add_return(1, &blk_probes_ref) == 1) {
-		ret = blk_register_tracepoints();
-		if (ret)
-			goto probe_err;
-	}
-	mutex_unlock(&blk_probe_mutex);
+	if (atomic_add_return(1, &blk_probes_ref) == 1)
+		blk_register_tracepoints();
 
 	ret = -EBUSY;
 	old_bt = xchg(&q->blk_trace, bt);
@@ -487,9 +479,6 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	}
 
 	return 0;
-probe_err:
-	atomic_dec(&blk_probes_ref);
-	mutex_unlock(&blk_probe_mutex);
 err:
 	if (bt) {
 		if (bt->msg_file)
@@ -863,7 +852,7 @@ void blk_add_driver_data(struct request_queue *q,
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static int blk_register_tracepoints(void)
+static void blk_register_tracepoints(void)
 {
 	int ret;
 
@@ -901,7 +890,6 @@ static int blk_register_tracepoints(void)
 	WARN_ON(ret);
 	ret = register_trace_block_remap(blk_add_trace_remap);
 	WARN_ON(ret);
-	return 0;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1099,11 +1087,8 @@ static void blk_tracer_print_header(struct seq_file *m)
 
 static void blk_tracer_start(struct trace_array *tr)
 {
-	mutex_lock(&blk_probe_mutex);
 	if (atomic_add_return(1, &blk_probes_ref) == 1)
-		if (blk_register_tracepoints())
-			atomic_dec(&blk_probes_ref);
-	mutex_unlock(&blk_probe_mutex);
+		blk_register_tracepoints();
 	trace_flags &= ~TRACE_ITER_CONTEXT_INFO;
 }
 
@@ -1118,10 +1103,8 @@ static int blk_tracer_init(struct trace_array *tr)
 static void blk_tracer_stop(struct trace_array *tr)
 {
 	trace_flags |= TRACE_ITER_CONTEXT_INFO;
-	mutex_lock(&blk_probe_mutex);
 	if (atomic_dec_and_test(&blk_probes_ref))
 		blk_unregister_tracepoints();
-	mutex_unlock(&blk_probe_mutex);
 }
 
 static void blk_tracer_reset(struct trace_array *tr)
]

264/2 2026/08/31 21:58 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 17731
							output: 26
							thoughts: 136
						

Thoughts:
**Investigating the Origins of a Tracepoint Registration**

Okay, so I've got this commit, 3c289ba7c320560ee74979a8895141c829046a2d, that I need to understand better. Before diving into the specifics of *that* commit, my first thought is to contextualize it. What did the codebase look like *before* this point? I need a baseline.

My immediate next step is to figure out the introduction point of `blk_register_tracepoints` or `register_trace_block_*` with `WARN_ON`. I'm going to start by searching the Git history. It's the most efficient way to trace back the origin of these functions, especially since I'm trying to identify the introduction of `WARN_ON` alongside them. I'll search for occurrences of both `register_trace_block_` and `blk_register_tracepoints` *prior* to commit 3c289ba7c320. This should provide the information I'm looking for regarding the changes introduced, and ultimately point to the location of the cause.



265/2 2026/08/31 21:58 tool git-log
10m Error:
log-in to see details

Args:
map[CodeRegexp:register_trace_block_rq_insert]

Results:
map[Output:]

266/2 2026/08/31 22:08 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 18186
							output: 36
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm already deep in the weeds of Git and development practices:

**Adding PathPrefix to `git-log` - The Nuances**

Right, let's think this through. The first thing that pops into my head is, "Why?" Why am I considering adding `PathPrefix` to the `git-log` output? What specific problem am I trying to solve? Am I aiming for better file-level granularity in a large project? Perhaps I'm trying to filter commits related to a specific feature or subsystem without getting buried in irrelevant noise. Or, maybe I'm troubleshooting a recent change and want to see how a specific file has evolved over time?

Okay, so I understand the *purpose*. Now, how does `PathPrefix` actually accomplish that? It allows me to specify a directory or even a specific file, and then the `git-log` command will only show me commits that modified something *within* that specified path. This is huge for streamlining my investigation of complex codebases. I'm imagining it already: being able to quickly isolate the history of a critical module in a sprawling project.

I need to make sure I understand the potential pitfalls. Are there any caveats I should be aware of? Am I assuming the correct level of granularity? Is there a possibility that my use of `PathPrefix` will exclude important, tangential commits that touch on the file or directory, but aren't strictly contained within it? Let's check the man page and some online examples to ensure I'm using the command in the most effective way. I need to use it in a way that is accurate and useful.

So, okay, `PathPrefix` is a solid addition to my `git-log` workflow. Time to start incorporating it into my daily tasks.



267/2 2026/08/31 22:08 tool git-log
0m Args:
map[CodeRegexp:register_trace_block_rq_insert PathPrefix:kernel/trace/]

Results:
map[Output:38516ab59fbc tracing: Let tracepoints have data passed to tracepoint callbacks
2db270a80b8f tracing/blktrace: move the tracing file to kernel/trace
]

268/2 2026/08/31 22:08 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 18679
							output: 31
							thoughts: 62
						

Thoughts:
**Investigating the Tracepoint Registration in blktrace.c**

Okay, let's dive in. I need to figure out what happened in or before commit `2db270a80b8f` regarding `block/blktrace.c`. My hunch is, that's where the relevant changes are. To get a clear picture of what transpired, I'll leverage `git log` specifically targeting the `block/blktrace.c` file. I'm going to look for that file and search the history for occurrences of `blk_register_tracepoints`. That function call, or changes related to it, is probably the key to understanding the context of the change. This should quickly uncover the commit(s) responsible for introducing, modifying, or removing the tracepoint registration logic within that specific module.



269/2 2026/08/31 22:08 tool git-log
0m Args:
map[CodeRegexp:blk_register_tracepoints PathPrefix:block/]

Results:
map[Output:2db270a80b8f tracing/blktrace: move the tracing file to kernel/trace
c71a89615411 blktrace: add ftrace plugin
5f3ea37c7716 blktrace: port to tracepoints
]

270/2 2026/08/31 22:08 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 19027
							output: 53
							thoughts: 44
						

Thoughts:
Okay, here's my interpretation of those "thoughts," presented as a first-person summary, keeping in mind my presumed expertise:

**Examining Specific Commits**

Right, let's get down to brass tacks. I need to take a close look at a few specific commits. I want to see commit `5f3ea37c7716`. I know that identifier – it likely represents a significant change, perhaps a crucial bug fix, or maybe a key feature introduction. It's time to refresh my memory or perhaps review for the next analysis.

And let's pull up commit `c71a89615411` as well. I have a recollection of it, and I want to investigate the context, see the code modifications. I'm especially interested in this one, as I have some questions.

Finally, throw in commit `3c289ba7c320` to the queue. I might have tagged it for follow-up earlier, or perhaps it's related to the other two in some way that requires cross-referencing. I'm expecting to analyze the changes in their proper context.

Essentially, I need to see what's happening at those precise points in the history. This is how I'll understand the evolution, the impact, and the potential implications of these commits within this project, product, or research. Time to dig in.



271/2 2026/08/31 22:09 tool git-show
0m Args:
map[Commit:5f3ea37c7716]

Results:
map[Output:commit 5f3ea37c7716db4e894a480e0c18b24399595b6b
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date:   Thu Oct 30 08:34:33 2008 +0100

    blktrace: port to tracepoints
    
    This was a forward port of work done by Mathieu Desnoyers, I changed it to
    encode the 'what' parameter on the tracepoint name, so that one can register
    interest in specific events and not on classes of events to then check the
    'what' parameter.
    
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/block/Kconfig b/block/Kconfig
index 1ab7c15c8d7a..290b219fad9c 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -47,6 +47,7 @@ config BLK_DEV_IO_TRACE
 	depends on SYSFS
 	select RELAY
 	select DEBUG_FS
+	select TRACEPOINTS
 	help
 	  Say Y here if you want to be able to trace the block layer actions
 	  on a given queue. Tracing allows you to see any traffic happening
diff --git a/block/blk-core.c b/block/blk-core.c
index 10e8a64a5a5b..04267d66a2b9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -28,6 +28,7 @@
 #include <linux/task_io_accounting_ops.h>
 #include <linux/blktrace_api.h>
 #include <linux/fault-inject.h>
+#include <trace/block.h>
 
 #include "blk.h"
 
@@ -205,7 +206,7 @@ void blk_plug_device(struct request_queue *q)
 
 	if (!queue_flag_test_and_set(QUEUE_FLAG_PLUGGED, q)) {
 		mod_timer(&q->unplug_timer, jiffies + q->unplug_delay);
-		blk_add_trace_generic(q, NULL, 0, BLK_TA_PLUG);
+		trace_block_plug(q);
 	}
 }
 EXPORT_SYMBOL(blk_plug_device);
@@ -292,9 +293,7 @@ void blk_unplug_work(struct work_struct *work)
 	struct request_queue *q =
 		container_of(work, struct request_queue, unplug_work);
 
-	blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
-				q->rq.count[READ] + q->rq.count[WRITE]);
-
+	trace_block_unplug_io(q);
 	q->unplug_fn(q);
 }
 
@@ -302,9 +301,7 @@ void blk_unplug_timeout(unsigned long data)
 {
 	struct request_queue *q = (struct request_queue *)data;
 
-	blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_TIMER, NULL,
-				q->rq.count[READ] + q->rq.count[WRITE]);
-
+	trace_block_unplug_timer(q);
 	kblockd_schedule_work(q, &q->unplug_work);
 }
 
@@ -314,9 +311,7 @@ void blk_unplug(struct request_queue *q)
 	 * devices don't necessarily have an ->unplug_fn defined
 	 */
 	if (q->unplug_fn) {
-		blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
-					q->rq.count[READ] + q->rq.count[WRITE]);
-
+		trace_block_unplug_io(q);
 		q->unplug_fn(q);
 	}
 }
@@ -822,7 +817,7 @@ static struct request *get_request(struct request_queue *q, int rw_flags,
 	if (ioc_batching(q, ioc))
 		ioc->nr_batch_requests--;
 
-	blk_add_trace_generic(q, bio, rw, BLK_TA_GETRQ);
+	trace_block_getrq(q, bio, rw);
 out:
 	return rq;
 }
@@ -848,7 +843,7 @@ static struct request *get_request_wait(struct request_queue *q, int rw_flags,
 		prepare_to_wait_exclusive(&rl->wait[rw], &wait,
 				TASK_UNINTERRUPTIBLE);
 
-		blk_add_trace_generic(q, bio, rw, BLK_TA_SLEEPRQ);
+		trace_block_sleeprq(q, bio, rw);
 
 		__generic_unplug_device(q);
 		spin_unlock_irq(q->queue_lock);
@@ -928,7 +923,7 @@ void blk_requeue_request(struct request_queue *q, struct request *rq)
 {
 	blk_delete_timer(rq);
 	blk_clear_rq_complete(rq);
-	blk_add_trace_rq(q, rq, BLK_TA_REQUEUE);
+	trace_block_rq_requeue(q, rq);
 
 	if (blk_rq_tagged(rq))
 		blk_queue_end_tag(q, rq);
@@ -1167,7 +1162,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 		if (!ll_back_merge_fn(q, req, bio))
 			break;
 
-		blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
+		trace_block_bio_backmerge(q, bio);
 
 		req->biotail->bi_next = bio;
 		req->biotail = bio;
@@ -1186,7 +1181,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 		if (!ll_front_merge_fn(q, req, bio))
 			break;
 
-		blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
+		trace_block_bio_frontmerge(q, bio);
 
 		bio->bi_next = req->bio;
 		req->bio = bio;
@@ -1269,7 +1264,7 @@ static inline void blk_partition_remap(struct bio *bio)
 		bio->bi_sector += p->start_sect;
 		bio->bi_bdev = bdev->bd_contains;
 
-		blk_add_trace_remap(bdev_get_queue(bio->bi_bdev), bio,
+		trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
 				    bdev->bd_dev, bio->bi_sector,
 				    bio->bi_sector - p->start_sect);
 	}
@@ -1441,10 +1436,10 @@ static inline void __generic_make_request(struct bio *bio)
 			goto end_io;
 
 		if (old_sector != -1)
-			blk_add_trace_remap(q, bio, old_dev, bio->bi_sector,
+			trace_block_remap(q, bio, old_dev, bio->bi_sector,
 					    old_sector);
 
-		blk_add_trace_bio(q, bio, BLK_TA_QUEUE);
+		trace_block_bio_queue(q, bio);
 
 		old_sector = bio->bi_sector;
 		old_dev = bio->bi_bdev->bd_dev;
@@ -1656,7 +1651,7 @@ static int __end_that_request_first(struct request *req, int error,
 	int total_bytes, bio_nbytes, next_idx = 0;
 	struct bio *bio;
 
-	blk_add_trace_rq(req->q, req, BLK_TA_COMPLETE);
+	trace_block_rq_complete(req->q, req);
 
 	/*
 	 * for a REQ_TYPE_BLOCK_PC request, we want to carry any eventual
diff --git a/block/blktrace.c b/block/blktrace.c
index 85049a7e7a17..b0a2cae886db 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -23,10 +23,18 @@
 #include <linux/mutex.h>
 #include <linux/debugfs.h>
 #include <linux/time.h>
+#include <trace/block.h>
 #include <asm/uaccess.h>
 
 static unsigned int blktrace_seq __read_mostly = 1;
 
+/* Global reference count of probes */
+static DEFINE_MUTEX(blk_probe_mutex);
+static atomic_t blk_probes_ref = ATOMIC_INIT(0);
+
+static int blk_register_tracepoints(void);
+static void blk_unregister_tracepoints(void);
+
 /*
  * Send out a notify message.
  */
@@ -119,7 +127,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK
  * The worker for the various blk_add_trace*() types. Fills out a
  * blk_io_trace structure and places it in a per-cpu subbuffer.
  */
-void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
+static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 		     int rw, u32 what, int error, int pdu_len, void *pdu_data)
 {
 	struct task_struct *tsk = current;
@@ -177,8 +185,6 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 	local_irq_restore(flags);
 }
 
-EXPORT_SYMBOL_GPL(__blk_add_trace);
-
 static struct dentry *blk_tree_root;
 static DEFINE_MUTEX(blk_tree_mutex);
 static unsigned int root_users;
@@ -237,6 +243,10 @@ static void blk_trace_cleanup(struct blk_trace *bt)
 	free_percpu(bt->sequence);
 	free_percpu(bt->msg_data);
 	kfree(bt);
+	mutex_lock(&blk_probe_mutex);
+	if (atomic_dec_and_test(&blk_probes_ref))
+		blk_unregister_tracepoints();
+	mutex_unlock(&blk_probe_mutex);
 }
 
 int blk_trace_remove(struct request_queue *q)
@@ -428,6 +438,14 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	mutex_lock(&blk_probe_mutex);
+	if (atomic_add_return(1, &blk_probes_ref) == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			goto probe_err;
+	}
+	mutex_unlock(&blk_probe_mutex);
+
 	ret = -EBUSY;
 	old_bt = xchg(&q->blk_trace, bt);
 	if (old_bt) {
@@ -436,6 +454,9 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	}
 
 	return 0;
+probe_err:
+	atomic_dec(&blk_probes_ref);
+	mutex_unlock(&blk_probe_mutex);
 err:
 	if (dir)
 		blk_remove_tree(dir);
@@ -562,3 +583,308 @@ void blk_trace_shutdown(struct request_queue *q)
 		blk_trace_remove(q);
 	}
 }
+
+/*
+ * blktrace probes
+ */
+
+/**
+ * blk_add_trace_rq - Add a trace for a request oriented action
+ * @q:		queue the io is for
+ * @rq:		the source request
+ * @what:	the action
+ *
+ * Description:
+ *     Records an action against a request. Will log the bio offset + size.
+ *
+ **/
+static void blk_add_trace_rq(struct request_queue *q, struct request *rq,
+				    u32 what)
+{
+	struct blk_trace *bt = q->blk_trace;
+	int rw = rq->cmd_flags & 0x03;
+
+	if (likely(!bt))
+		return;
+
+	if (blk_discard_rq(rq))
+		rw |= (1 << BIO_RW_DISCARD);
+
+	if (blk_pc_request(rq)) {
+		what |= BLK_TC_ACT(BLK_TC_PC);
+		__blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors,
+				sizeof(rq->cmd), rq->cmd);
+	} else  {
+		what |= BLK_TC_ACT(BLK_TC_FS);
+		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
+				rw, what, rq->errors, 0, NULL);
+	}
+}
+
+static void blk_add_trace_rq_abort(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_ABORT);
+}
+
+static void blk_add_trace_rq_insert(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_INSERT);
+}
+
+static void blk_add_trace_rq_issue(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_ISSUE);
+}
+
+static void blk_add_trace_rq_requeue(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_REQUEUE);
+}
+
+static void blk_add_trace_rq_complete(struct request_queue *q, struct request *rq)
+{
+	blk_add_trace_rq(q, rq, BLK_TA_COMPLETE);
+}
+
+/**
+ * blk_add_trace_bio - Add a trace for a bio oriented action
+ * @q:		queue the io is for
+ * @bio:	the source bio
+ * @what:	the action
+ *
+ * Description:
+ *     Records an action against a bio. Will log the bio offset + size.
+ *
+ **/
+static void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
+				     u32 what)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (likely(!bt))
+		return;
+
+	__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what,
+			!bio_flagged(bio, BIO_UPTODATE), 0, NULL);
+}
+
+static void blk_add_trace_bio_bounce(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_BOUNCE);
+}
+
+static void blk_add_trace_bio_complete(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_COMPLETE);
+}
+
+static void blk_add_trace_bio_backmerge(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
+}
+
+static void blk_add_trace_bio_frontmerge(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
+}
+
+static void blk_add_trace_bio_queue(struct request_queue *q, struct bio *bio)
+{
+	blk_add_trace_bio(q, bio, BLK_TA_QUEUE);
+}
+
+static void blk_add_trace_getrq(struct request_queue *q, struct bio *bio, int rw)
+{
+	if (bio)
+		blk_add_trace_bio(q, bio, BLK_TA_GETRQ);
+	else {
+		struct blk_trace *bt = q->blk_trace;
+
+		if (bt)
+			__blk_add_trace(bt, 0, 0, rw, BLK_TA_GETRQ, 0, 0, NULL);
+	}
+}
+
+
+static void blk_add_trace_sleeprq(struct request_queue *q, struct bio *bio, int rw)
+{
+	if (bio)
+		blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ);
+	else {
+		struct blk_trace *bt = q->blk_trace;
+
+		if (bt)
+			__blk_add_trace(bt, 0, 0, rw, BLK_TA_SLEEPRQ, 0, 0, NULL);
+	}
+}
+
+static void blk_add_trace_plug(struct request_queue *q)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt)
+		__blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL);
+}
+
+static void blk_add_trace_unplug_io(struct request_queue *q)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt) {
+		unsigned int pdu = q->rq.count[READ] + q->rq.count[WRITE];
+		__be64 rpdu = cpu_to_be64(pdu);
+
+		__blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_IO, 0,
+				sizeof(rpdu), &rpdu);
+	}
+}
+
+static void blk_add_trace_unplug_timer(struct request_queue *q)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt) {
+		unsigned int pdu = q->rq.count[READ] + q->rq.count[WRITE];
+		__be64 rpdu = cpu_to_be64(pdu);
+
+		__blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_TIMER, 0,
+				sizeof(rpdu), &rpdu);
+	}
+}
+
+static void blk_add_trace_split(struct request_queue *q, struct bio *bio,
+				unsigned int pdu)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (bt) {
+		__be64 rpdu = cpu_to_be64(pdu);
+
+		__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw,
+				BLK_TA_SPLIT, !bio_flagged(bio, BIO_UPTODATE),
+				sizeof(rpdu), &rpdu);
+	}
+}
+
+/**
+ * blk_add_trace_remap - Add a trace for a remap operation
+ * @q:		queue the io is for
+ * @bio:	the source bio
+ * @dev:	target device
+ * @from:	source sector
+ * @to:		target sector
+ *
+ * Description:
+ *     Device mapper or raid target sometimes need to split a bio because
+ *     it spans a stripe (or similar). Add a trace for that action.
+ *
+ **/
+static void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
+				       dev_t dev, sector_t from, sector_t to)
+{
+	struct blk_trace *bt = q->blk_trace;
+	struct blk_io_trace_remap r;
+
+	if (likely(!bt))
+		return;
+
+	r.device = cpu_to_be32(dev);
+	r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
+	r.sector = cpu_to_be64(to);
+
+	__blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP,
+			!bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
+}
+
+/**
+ * blk_add_driver_data - Add binary message with driver-specific data
+ * @q:		queue the io is for
+ * @rq:		io request
+ * @data:	driver-specific data
+ * @len:	length of driver-specific data
+ *
+ * Description:
+ *     Some drivers might want to write driver-specific data per request.
+ *
+ **/
+void blk_add_driver_data(struct request_queue *q,
+			 struct request *rq,
+			 void *data, size_t len)
+{
+	struct blk_trace *bt = q->blk_trace;
+
+	if (likely(!bt))
+		return;
+
+	if (blk_pc_request(rq))
+		__blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA,
+				rq->errors, len, data);
+	else
+		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
+				0, BLK_TA_DRV_DATA, rq->errors, len, data);
+}
+EXPORT_SYMBOL_GPL(blk_add_driver_data);
+
+static int blk_register_tracepoints(void)
+{
+	int ret;
+
+	ret = register_trace_block_rq_abort(blk_add_trace_rq_abort);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue);
+	WARN_ON(ret);
+	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_bounce(blk_add_trace_bio_bounce);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge);
+	WARN_ON(ret);
+	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue);
+	WARN_ON(ret);
+	ret = register_trace_block_getrq(blk_add_trace_getrq);
+	WARN_ON(ret);
+	ret = register_trace_block_sleeprq(blk_add_trace_sleeprq);
+	WARN_ON(ret);
+	ret = register_trace_block_plug(blk_add_trace_plug);
+	WARN_ON(ret);
+	ret = register_trace_block_unplug_timer(blk_add_trace_unplug_timer);
+	WARN_ON(ret);
+	ret = register_trace_block_unplug_io(blk_add_trace_unplug_io);
+	WARN_ON(ret);
+	ret = register_trace_block_split(blk_add_trace_split);
+	WARN_ON(ret);
+	ret = register_trace_block_remap(blk_add_trace_remap);
+	WARN_ON(ret);
+	return 0;
+}
+
+static void blk_unregister_tracepoints(void)
+{
+	unregister_trace_block_remap(blk_add_trace_remap);
+	unregister_trace_block_split(blk_add_trace_split);
+	unregister_trace_block_unplug_io(blk_add_trace_unplug_io);
+	unregister_trace_block_unplug_timer(blk_add_trace_unplug_timer);
+	unregister_trace_block_plug(blk_add_trace_plug);
+	unregister_trace_block_sleeprq(blk_add_trace_sleeprq);
+	unregister_trace_block_getrq(blk_add_trace_getrq);
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue);
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge);
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge);
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete);
+	unregister_trace_block_bio_bounce(blk_add_trace_bio_bounce);
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete);
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue);
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue);
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert);
+	unregister_trace_block_rq_abort(blk_add_trace_rq_abort);
+
+	tracepoint_synchronize_unregister();
+}
diff --git a/block/elevator.c b/block/elevator.c
index 9ac82dde99dd..530fcfe2ef07 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -33,6 +33,7 @@
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 #include <linux/hash.h>
 #include <linux/uaccess.h>
 
@@ -586,7 +587,7 @@ void elv_insert(struct request_queue *q, struct request *rq, int where)
 	unsigned ordseq;
 	int unplug_it = 1;
 
-	blk_add_trace_rq(q, rq, BLK_TA_INSERT);
+	trace_block_rq_insert(q, rq);
 
 	rq->q = q;
 
@@ -772,7 +773,7 @@ struct request *elv_next_request(struct request_queue *q)
 			 * not be passed by new incoming requests
 			 */
 			rq->cmd_flags |= REQ_STARTED;
-			blk_add_trace_rq(q, rq, BLK_TA_ISSUE);
+			trace_block_rq_issue(q, rq);
 		}
 
 		if (!q->boundary_rq || q->boundary_rq == rq) {
@@ -921,7 +922,7 @@ void elv_abort_queue(struct request_queue *q)
 	while (!list_empty(&q->queue_head)) {
 		rq = list_entry_rq(q->queue_head.next);
 		rq->cmd_flags |= REQ_QUIET;
-		blk_add_trace_rq(q, rq, BLK_TA_ABORT);
+		trace_block_rq_abort(q, rq);
 		__blk_end_request(rq, -EIO, blk_rq_bytes(rq));
 	}
 }
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index c99e4728ff41..d23fda178163 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -21,6 +21,7 @@
 #include <linux/idr.h>
 #include <linux/hdreg.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 
 #define DM_MSG_PREFIX "core"
 
@@ -504,8 +505,7 @@ static void dec_pending(struct dm_io *io, int error)
 		end_io_acct(io);
 
 		if (io->error != DM_ENDIO_REQUEUE) {
-			blk_add_trace_bio(io->md->queue, io->bio,
-					  BLK_TA_COMPLETE);
+			trace_block_bio_complete(io->md->queue, io->bio);
 
 			bio_endio(io->bio, io->error);
 		}
@@ -598,7 +598,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
 	if (r == DM_MAPIO_REMAPPED) {
 		/* the bio has been remapped so dispatch it */
 
-		blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone,
+		trace_block_remap(bdev_get_queue(clone->bi_bdev), clone,
 				    tio->io->bio->bi_bdev->bd_dev,
 				    clone->bi_sector, sector);
 
diff --git a/fs/bio.c b/fs/bio.c
index 77a55bcceedb..060859c69092 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -26,6 +26,7 @@
 #include <linux/mempool.h>
 #include <linux/workqueue.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 #include <scsi/sg.h>		/* for struct sg_iovec */
 
 static struct kmem_cache *bio_slab __read_mostly;
@@ -1263,7 +1264,7 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors)
 	if (!bp)
 		return bp;
 
-	blk_add_trace_pdu_int(bdev_get_queue(bi->bi_bdev), BLK_TA_SPLIT, bi,
+	trace_block_split(bdev_get_queue(bi->bi_bdev), bi,
 				bi->bi_sector + first_sectors);
 
 	BUG_ON(bi->bi_vcnt != 1);
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index bdf505d33e77..1dba3493d520 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -160,7 +160,6 @@ struct blk_trace {
 
 extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
 extern void blk_trace_shutdown(struct request_queue *);
-extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
 extern int do_blk_trace_setup(struct request_queue *q,
 	char *name, dev_t dev, struct blk_user_trace_setup *buts);
 extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
@@ -186,168 +185,8 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
 	} while (0)
 #define BLK_TN_MAX_MSG		128
 
-/**
- * blk_add_trace_rq - Add a trace for a request oriented action
- * @q:		queue the io is for
- * @rq:		the source request
- * @what:	the action
- *
- * Description:
- *     Records an action against a request. Will log the bio offset + size.
- *
- **/
-static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
-				    u32 what)
-{
-	struct blk_trace *bt = q->blk_trace;
-	int rw = rq->cmd_flags & 0x03;
-
-	if (likely(!bt))
-		return;
-
-	if (blk_discard_rq(rq))
-		rw |= (1 << BIO_RW_DISCARD);
-
-	if (blk_pc_request(rq)) {
-		what |= BLK_TC_ACT(BLK_TC_PC);
-		__blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd);
-	} else  {
-		what |= BLK_TC_ACT(BLK_TC_FS);
-		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL);
-	}
-}
-
-/**
- * blk_add_trace_bio - Add a trace for a bio oriented action
- * @q:		queue the io is for
- * @bio:	the source bio
- * @what:	the action
- *
- * Description:
- *     Records an action against a bio. Will log the bio offset + size.
- *
- **/
-static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
-				     u32 what)
-{
-	struct blk_trace *bt = q->blk_trace;
-
-	if (likely(!bt))
-		return;
-
-	__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL);
-}
-
-/**
- * blk_add_trace_generic - Add a trace for a generic action
- * @q:		queue the io is for
- * @bio:	the source bio
- * @rw:		the data direction
- * @what:	the action
- *
- * Description:
- *     Records a simple trace
- *
- **/
-static inline void blk_add_trace_generic(struct request_queue *q,
-					 struct bio *bio, int rw, u32 what)
-{
-	struct blk_trace *bt = q->blk_trace;
-
-	if (likely(!bt))
-		return;
-
-	if (bio)
-		blk_add_trace_bio(q, bio, what);
-	else
-		__blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL);
-}
-
-/**
- * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload
- * @q:		queue the io is for
- * @what:	the action
- * @bio:	the source bio
- * @pdu:	the integer payload
- *
- * Description:
- *     Adds a trace with some integer payload. This might be an unplug
- *     option given as the action, with the depth at unplug time given
- *     as the payload
- *
- **/
-static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
-					 struct bio *bio, unsigned int pdu)
-{
-	struct blk_trace *bt = q->blk_trace;
-	__be64 rpdu = cpu_to_be64(pdu);
-
-	if (likely(!bt))
-		return;
-
-	if (bio)
-		__blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu);
-	else
-		__blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
-}
-
-/**
- * blk_add_trace_remap - Add a trace for a remap operation
- * @q:		queue the io is for
- * @bio:	the source bio
- * @dev:	target device
- * @from:	source sector
- * @to:		target sector
- *
- * Description:
- *     Device mapper or raid target sometimes need to split a bio because
- *     it spans a stripe (or similar). Add a trace for that action.
- *
- **/
-static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
-				       dev_t dev, sector_t from, sector_t to)
-{
-	struct blk_trace *bt = q->blk_trace;
-	struct blk_io_trace_remap r;
-
-	if (likely(!bt))
-		return;
-
-	r.device = cpu_to_be32(dev);
-	r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
-	r.sector = cpu_to_be64(to);
-
-	__blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
-}
-
-/**
- * blk_add_driver_data - Add binary message with driver-specific data
- * @q:		queue the io is for
- * @rq:		io request
- * @data:	driver-specific data
- * @len:	length of driver-specific data
- *
- * Description:
- *     Some drivers might want to write driver-specific data per request.
- *
- **/
-static inline void blk_add_driver_data(struct request_queue *q,
-				       struct request *rq,
-				       void *data, size_t len)
-{
-	struct blk_trace *bt = q->blk_trace;
-
-	if (likely(!bt))
-		return;
-
-	if (blk_pc_request(rq))
-		__blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA,
-				rq->errors, len, data);
-	else
-		__blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
-				0, BLK_TA_DRV_DATA, rq->errors, len, data);
-}
-
+extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
+				void *data, size_t len);
 extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 			   char __user *arg);
 extern int blk_trace_startstop(struct request_queue *q, int start);
@@ -356,13 +195,8 @@ extern int blk_trace_remove(struct request_queue *q);
 #else /* !CONFIG_BLK_DEV_IO_TRACE */
 #define blk_trace_ioctl(bdev, cmd, arg)		(-ENOTTY)
 #define blk_trace_shutdown(q)			do { } while (0)
-#define blk_add_trace_rq(q, rq, what)		do { } while (0)
-#define blk_add_trace_bio(q, rq, what)		do { } while (0)
-#define blk_add_trace_generic(q, rq, rw, what)	do { } while (0)
-#define blk_add_trace_pdu_int(q, what, bio, pdu)	do { } while (0)
-#define blk_add_trace_remap(q, bio, dev, f, t)	do {} while (0)
-#define blk_add_driver_data(q, rq, data, len)	do {} while (0)
 #define do_blk_trace_setup(q, name, dev, buts)	(-ENOTTY)
+#define blk_add_driver_data(q, rq, data, len)	do {} while (0)
 #define blk_trace_setup(q, name, dev, arg)	(-ENOTTY)
 #define blk_trace_startstop(q, start)		(-ENOTTY)
 #define blk_trace_remove(q)			(-ENOTTY)
diff --git a/include/trace/block.h b/include/trace/block.h
new file mode 100644
index 000000000000..3cc2675ebf01
--- /dev/null
+++ b/include/trace/block.h
@@ -0,0 +1,60 @@
+#ifndef _TRACE_BLOCK_H
+#define _TRACE_BLOCK_H
+
+#include <linux/blkdev.h>
+#include <linux/tracepoint.h>
+
+DEFINE_TRACE(block_rq_abort,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_insert,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_issue,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_requeue,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_rq_complete,
+	TPPROTO(struct request_queue *q, struct request *rq),
+	TPARGS(q, rq));
+DEFINE_TRACE(block_bio_bounce,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_complete,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_backmerge,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_frontmerge,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_bio_queue,
+	TPPROTO(struct request_queue *q, struct bio *bio),
+	TPARGS(q, bio));
+DEFINE_TRACE(block_getrq,
+	TPPROTO(struct request_queue *q, struct bio *bio, int rw),
+	TPARGS(q, bio, rw));
+DEFINE_TRACE(block_sleeprq,
+	TPPROTO(struct request_queue *q, struct bio *bio, int rw),
+	TPARGS(q, bio, rw));
+DEFINE_TRACE(block_plug,
+	TPPROTO(struct request_queue *q),
+	TPARGS(q));
+DEFINE_TRACE(block_unplug_timer,
+	TPPROTO(struct request_queue *q),
+	TPARGS(q));
+DEFINE_TRACE(block_unplug_io,
+	TPPROTO(struct request_queue *q),
+	TPARGS(q));
+DEFINE_TRACE(block_split,
+	TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu),
+	TPARGS(q, bio, pdu));
+DEFINE_TRACE(block_remap,
+	TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev,
+		sector_t from, sector_t to),
+	TPARGS(q, bio, dev, from, to));
+
+#endif
diff --git a/mm/bounce.c b/mm/bounce.c
index 06722c403058..bd1caaa582b8 100644
--- a/mm/bounce.c
+++ b/mm/bounce.c
@@ -14,6 +14,7 @@
 #include <linux/hash.h>
 #include <linux/highmem.h>
 #include <linux/blktrace_api.h>
+#include <trace/block.h>
 #include <asm/tlbflush.h>
 
 #define POOL_SIZE	64
@@ -222,7 +223,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
 	if (!bio)
 		return;
 
-	blk_add_trace_bio(q, *bio_orig, BLK_TA_BOUNCE);
+	trace_block_bio_bounce(q, *bio_orig);
 
 	/*
 	 * at least one page was bounced, fill in possible non-highmem
]

272/2 2026/08/31 22:09 tool git-show
0m Args:
map[Commit:c71a89615411]

Results:
map[Output:commit c71a896154119f4ca9e89d6078f5f63ad60ef199
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date:   Fri Jan 23 12:06:27 2009 -0200

    blktrace: add ftrace plugin
    
    Impact: New way of using the blktrace infrastructure
    
    This drops the requirement of userspace utilities to use the blktrace
    facility.
    
    Configuration is done thru sysfs, adding a "trace" directory to the
    partition directory where blktrace can be enabled for the associated
    request_queue.
    
    The same filters present in the IOCTL interface are present as sysfs
    device attributes.
    
    The /sys/block/sdX/sdXN/trace/enable file allows tracing without any
    filters.
    
    The other files in this directory: pid, act_mask, start_lba and end_lba
    can be used with the same meaning as with the IOCTL interface.
    
    Using the sysfs interface will only setup the request_queue->blk_trace
    fields, tracing will only take place when the "blk" tracer is selected
    via the ftrace interface, as in the following example:
    
    To see the trace, one can use the /d/tracing/trace file or the
    /d/tracign/trace_pipe file, with semantics defined in the ftrace
    documentation in Documentation/ftrace.txt.
    
    [root@f10-1 ~]# cat /t/trace
           kjournald-305   [000]  3046.491224:   8,1    A WBS 6367 + 8 <- (8,1) 6304
           kjournald-305   [000]  3046.491227:   8,1    Q   R 6367 + 8 [kjournald]
           kjournald-305   [000]  3046.491236:   8,1    G  RB 6367 + 8 [kjournald]
           kjournald-305   [000]  3046.491239:   8,1    P  NS [kjournald]
           kjournald-305   [000]  3046.491242:   8,1    I RBS 6367 + 8 [kjournald]
           kjournald-305   [000]  3046.491251:   8,1    D  WB 6367 + 8 [kjournald]
           kjournald-305   [000]  3046.491610:   8,1    U  WS [kjournald] 1
              <idle>-0     [000]  3046.511914:   8,1    C  RS 6367 + 8 [6367]
    [root@f10-1 ~]#
    
    The default line context (prefix) format is the one described in the ftrace
    documentation, with the blktrace specific bits using its existing format,
    described in blkparse(8).
    
    If one wants to have the classic blktrace formatting, this is possible by
    using:
    
    [root@f10-1 ~]# echo blk_classic > /t/trace_options
    [root@f10-1 ~]# cat /t/trace
      8,1    0  3046.491224   305  A WBS 6367 + 8 <- (8,1) 6304
      8,1    0  3046.491227   305  Q   R 6367 + 8 [kjournald]
      8,1    0  3046.491236   305  G  RB 6367 + 8 [kjournald]
      8,1    0  3046.491239   305  P  NS [kjournald]
      8,1    0  3046.491242   305  I RBS 6367 + 8 [kjournald]
      8,1    0  3046.491251   305  D  WB 6367 + 8 [kjournald]
      8,1    0  3046.491610   305  U  WS [kjournald] 1
      8,1    0  3046.511914     0  C  RS 6367 + 8 [6367]
    [root@f10-1 ~]#
    
    Using the ftrace standard format allows more flexibility, such
    as the ability of asking for backtraces via trace_options:
    
    [root@f10-1 ~]# echo noblk_classic > /t/trace_options
    [root@f10-1 ~]# echo stacktrace > /t/trace_options
    
    [root@f10-1 ~]# cat /t/trace
           kjournald-305   [000]  3318.826779:   8,1    A WBS 6375 + 8 <- (8,1) 6312
           kjournald-305   [000]  3318.826782:
     <= submit_bio
     <= submit_bh
     <= sync_dirty_buffer
     <= journal_commit_transaction
     <= kjournald
     <= kthread
     <= child_rip
           kjournald-305   [000]  3318.826836:   8,1    Q   R 6375 + 8 [kjournald]
           kjournald-305   [000]  3318.826837:
     <= generic_make_request
     <= submit_bio
     <= submit_bh
     <= sync_dirty_buffer
     <= journal_commit_transaction
     <= kjournald
     <= kthread
    
    Please read the ftrace documentation to use aditional, standardized
    tracing filters such as /d/tracing/trace_cpumask, etc.
    
    See also /d/tracing/trace_mark to add comments in the trace stream,
    that is equivalent to the /d/block/sdaN/msg interface.
    
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/block/blktrace.c b/block/blktrace.c
index b0a2cae886db..630f167f8240 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -25,9 +25,27 @@
 #include <linux/time.h>
 #include <trace/block.h>
 #include <asm/uaccess.h>
+#include <../kernel/trace/trace_output.h>
 
 static unsigned int blktrace_seq __read_mostly = 1;
 
+static struct trace_array *blk_tr;
+static int __read_mostly  blk_tracer_enabled;
+
+/* Select an alternative, minimalistic output than the original one */
+#define TRACE_BLK_OPT_CLASSIC 	0x1
+
+static struct tracer_opt blk_tracer_opts[] = {
+	/* Default disable the minimalistic output */
+	{ TRACER_OPT(blk_classic, TRACE_BLK_OPT_CLASSIC ) },
+	{ }
+};
+
+static struct tracer_flags blk_tracer_flags = {
+	.val  = 0,
+	.opts = blk_tracer_opts,
+};
+
 /* Global reference count of probes */
 static DEFINE_MUTEX(blk_probe_mutex);
 static atomic_t blk_probes_ref = ATOMIC_INIT(0);
@@ -43,6 +61,9 @@ static void trace_note(struct blk_trace *bt, pid_t pid, int action,
 {
 	struct blk_io_trace *t;
 
+	if (!bt->rchan)
+		return;
+
 	t = relay_reserve(bt->rchan, sizeof(*t) + len);
 	if (t) {
 		const int cpu = smp_processor_id();
@@ -90,6 +111,16 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...)
 	unsigned long flags;
 	char *buf;
 
+	if (blk_tr) {
+		va_start(args, fmt);
+		ftrace_vprintk(fmt, args);
+		va_end(args);
+		return;
+	}
+
+	if (!bt->msg_data)
+		return;
+
 	local_irq_save(flags);
 	buf = per_cpu_ptr(bt->msg_data, smp_processor_id());
 	va_start(args, fmt);
@@ -131,13 +162,14 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 		     int rw, u32 what, int error, int pdu_len, void *pdu_data)
 {
 	struct task_struct *tsk = current;
+	struct ring_buffer_event *event = NULL;
 	struct blk_io_trace *t;
 	unsigned long flags;
 	unsigned long *sequence;
 	pid_t pid;
-	int cpu;
+	int cpu, pc = 0;
 
-	if (unlikely(bt->trace_state != Blktrace_running))
+	if (unlikely(bt->trace_state != Blktrace_running || !blk_tracer_enabled))
 		return;
 
 	what |= ddir_act[rw & WRITE];
@@ -150,6 +182,24 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 	pid = tsk->pid;
 	if (unlikely(act_log_check(bt, what, sector, pid)))
 		return;
+	cpu = raw_smp_processor_id();
+
+	if (blk_tr) {
+		struct trace_entry *ent;
+		tracing_record_cmdline(current);
+
+		event = ring_buffer_lock_reserve(blk_tr->buffer,
+						 sizeof(*t) + pdu_len, &flags);
+		if (!event)
+			return;
+		
+		ent = ring_buffer_event_data(event);
+		t = (struct blk_io_trace *)ent;
+		pc = preempt_count();
+		tracing_generic_entry_update(ent, 0, pc);
+		ent->type = TRACE_BLK;
+		goto record_it;
+	}
 
 	/*
 	 * A word about the locking here - we disable interrupts to reserve
@@ -163,23 +213,33 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 
 	t = relay_reserve(bt->rchan, sizeof(*t) + pdu_len);
 	if (t) {
-		cpu = smp_processor_id();
 		sequence = per_cpu_ptr(bt->sequence, cpu);
 
 		t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
 		t->sequence = ++(*sequence);
 		t->time = ktime_to_ns(ktime_get());
+		t->cpu = cpu;
+		t->pid = pid;
+record_it:
 		t->sector = sector;
 		t->bytes = bytes;
 		t->action = what;
-		t->pid = pid;
 		t->device = bt->dev;
-		t->cpu = cpu;
 		t->error = error;
 		t->pdu_len = pdu_len;
 
 		if (pdu_len)
 			memcpy((void *) t + sizeof(*t), pdu_data, pdu_len);
+
+		if (blk_tr) {
+			ring_buffer_unlock_commit(blk_tr->buffer, event, flags);
+			if (pid != 0 &&
+			    (blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC) == 0 &&
+			    (trace_flags & TRACE_ITER_STACKTRACE) != 0)
+				__trace_stack(blk_tr, NULL, flags, 5, pc);
+			trace_wake_up();
+			return;
+		}
 	}
 
 	local_irq_restore(flags);
@@ -888,3 +948,584 @@ static void blk_unregister_tracepoints(void)
 
 	tracepoint_synchronize_unregister();
 }
+
+/*
+ * struct blk_io_tracer formatting routines
+ */
+
+static void fill_rwbs(char *rwbs, const struct blk_io_trace *t)
+{
+        int i = 0;
+
+        if (t->action & BLK_TC_DISCARD)	   rwbs[i++] = 'D';
+        else if (t->action & BLK_TC_WRITE) rwbs[i++] = 'W';
+        else if (t->bytes)		   rwbs[i++] = 'R';
+        else				   rwbs[i++] = 'N';
+
+        if (t->action & BLK_TC_AHEAD)	   rwbs[i++] = 'A';
+        if (t->action & BLK_TC_BARRIER)	   rwbs[i++] = 'B';
+        if (t->action & BLK_TC_SYNC)	   rwbs[i++] = 'S';
+        if (t->action & BLK_TC_META)	   rwbs[i++] = 'M';
+
+        rwbs[i] = '\0';
+}
+
+static inline
+const struct blk_io_trace *te_blk_io_trace(const struct trace_entry *ent)
+{
+	return (const struct blk_io_trace *)ent;
+}
+
+static inline const void *pdu_start(const struct trace_entry *ent)
+{
+	return te_blk_io_trace(ent) + 1;
+}
+
+static inline u32 t_sec(const struct trace_entry *ent)
+{
+	return te_blk_io_trace(ent)->bytes >> 9;
+}
+
+static inline unsigned long long t_sector(const struct trace_entry *ent)
+{
+	return te_blk_io_trace(ent)->sector;
+}
+
+static inline __u16 t_error(const struct trace_entry *ent)
+{
+	return te_blk_io_trace(ent)->sector;
+}
+
+static __u64 get_pdu_int(const struct trace_entry *ent)
+{
+	const __u64 *val = pdu_start(ent);
+	return be64_to_cpu(*val);
+}
+
+static void get_pdu_remap(const struct trace_entry *ent,
+			  struct blk_io_trace_remap *r)
+{
+	const struct blk_io_trace_remap *__r = pdu_start(ent);
+	__u64 sector = __r->sector;
+
+	r->device = be32_to_cpu(__r->device);
+	r->device_from = be32_to_cpu(__r->device_from);
+	r->sector = be64_to_cpu(sector);
+}
+
+static int blk_log_action_iter(struct trace_iterator *iter, const char *act)
+{
+	char rwbs[6];
+	unsigned long long ts  = ns2usecs(iter->ts);
+	unsigned long usec_rem = do_div(ts, USEC_PER_SEC);
+	unsigned secs	       = (unsigned long)ts;
+	const struct trace_entry *ent = iter->ent;
+	const struct blk_io_trace *t = (const struct blk_io_trace *)ent;
+
+	fill_rwbs(rwbs, t);
+
+	return trace_seq_printf(&iter->seq,
+				"%3d,%-3d %2d %5d.%06lu %5u %2s %3s ",
+				MAJOR(t->device), MINOR(t->device), iter->cpu,
+				secs, usec_rem, ent->pid, act, rwbs);
+}
+
+static int blk_log_action_seq(struct trace_seq *s, const struct blk_io_trace *t,
+			      const char *act)
+{
+	char rwbs[6];
+	fill_rwbs(rwbs, t);
+	return trace_seq_printf(s, "%3d,%-3d %2s %3s ",
+				MAJOR(t->device), MINOR(t->device), act, rwbs);
+}
+
+static int blk_log_generic(struct trace_seq *s, const struct trace_entry *ent)
+{
+	const char *cmd = trace_find_cmdline(ent->pid);
+
+	if (t_sec(ent))
+		return trace_seq_printf(s, "%llu + %u [%s]\n",
+					t_sector(ent), t_sec(ent), cmd);
+	return trace_seq_printf(s, "[%s]\n", cmd);
+}
+
+static int blk_log_with_error(struct trace_seq *s, const struct trace_entry *ent)
+{
+	if (t_sec(ent))
+		return trace_seq_printf(s, "%llu + %u [%d]\n", t_sector(ent),
+					t_sec(ent), t_error(ent));
+	return trace_seq_printf(s, "%llu [%d]\n", t_sector(ent), t_error(ent));
+}
+
+static int blk_log_remap(struct trace_seq *s, const struct trace_entry *ent)
+{
+	struct blk_io_trace_remap r = { .device = 0, };
+
+	get_pdu_remap(ent, &r);
+	return trace_seq_printf(s, "%llu + %u <- (%d,%d) %llu\n",
+			       t_sector(ent),
+			       t_sec(ent), MAJOR(r.device), MINOR(r.device),
+			       (unsigned long long)r.sector);
+}
+
+static int blk_log_plug(struct trace_seq *s, const struct trace_entry *ent)
+{
+	return trace_seq_printf(s, "[%s]\n", trace_find_cmdline(ent->pid));
+}
+
+static int blk_log_unplug(struct trace_seq *s, const struct trace_entry *ent)
+{
+	return trace_seq_printf(s, "[%s] %llu\n", trace_find_cmdline(ent->pid),
+				get_pdu_int(ent));
+}
+
+static int blk_log_split(struct trace_seq *s, const struct trace_entry *ent)
+{
+	return trace_seq_printf(s, "%llu / %llu [%s]\n", t_sector(ent),
+				get_pdu_int(ent), trace_find_cmdline(ent->pid));
+}
+
+/*
+ * struct tracer operations
+ */
+
+static void blk_tracer_print_header(struct seq_file *m)
+{
+	if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
+		return;
+	seq_puts(m, "# DEV   CPU TIMESTAMP     PID ACT FLG\n"
+		    "#  |     |     |           |   |   |\n");
+}
+
+static void blk_tracer_start(struct trace_array *tr)
+{
+	int cpu;
+
+	tr->time_start = ftrace_now(tr->cpu);
+
+	for_each_online_cpu(cpu)
+		tracing_reset(tr, cpu);
+
+	mutex_lock(&blk_probe_mutex);
+	if (atomic_add_return(1, &blk_probes_ref) == 1)
+		if (blk_register_tracepoints())
+			atomic_dec(&blk_probes_ref);
+	mutex_unlock(&blk_probe_mutex);
+}
+
+static int blk_tracer_init(struct trace_array *tr)
+{
+	blk_tr = tr;
+	blk_tracer_start(tr);
+	mutex_lock(&blk_probe_mutex);
+	blk_tracer_enabled++;
+	mutex_unlock(&blk_probe_mutex);
+	return 0;
+}
+
+static void blk_tracer_stop(struct trace_array *tr)
+{
+	mutex_lock(&blk_probe_mutex);
+	if (atomic_dec_and_test(&blk_probes_ref))
+		blk_unregister_tracepoints();
+	mutex_unlock(&blk_probe_mutex);
+}
+
+static void blk_tracer_reset(struct trace_array *tr)
+{
+	if (!atomic_read(&blk_probes_ref))
+		return;
+
+	mutex_lock(&blk_probe_mutex);
+	blk_tracer_enabled--;
+	WARN_ON(blk_tracer_enabled < 0);
+	mutex_unlock(&blk_probe_mutex);
+
+	blk_tracer_stop(tr);
+}
+
+static struct {
+	const char *act[2];
+	int 	   (*print)(struct trace_seq *s, const struct trace_entry *ent);
+} what2act[] __read_mostly = {
+	[__BLK_TA_QUEUE]	= {{  "Q", "queue" }, 	   blk_log_generic },
+	[__BLK_TA_BACKMERGE]	= {{  "M", "backmerge" },  blk_log_generic },
+	[__BLK_TA_FRONTMERGE]	= {{  "F", "frontmerge" }, blk_log_generic },
+	[__BLK_TA_GETRQ]	= {{  "G", "getrq" },	   blk_log_generic },
+	[__BLK_TA_SLEEPRQ]	= {{  "S", "sleeprq" },	   blk_log_generic },
+	[__BLK_TA_REQUEUE]	= {{  "R", "requeue" },	   blk_log_with_error },
+	[__BLK_TA_ISSUE]	= {{  "D", "issue" },	   blk_log_generic },
+	[__BLK_TA_COMPLETE]	= {{  "C", "complete" },   blk_log_with_error },
+	[__BLK_TA_PLUG]		= {{  "P", "plug" },	   blk_log_plug },
+	[__BLK_TA_UNPLUG_IO]	= {{  "U", "unplug_io" },  blk_log_unplug },
+	[__BLK_TA_UNPLUG_TIMER]	= {{ "UT", "unplug_timer" }, blk_log_unplug },
+	[__BLK_TA_INSERT]	= {{  "I", "insert" },	   blk_log_generic },
+	[__BLK_TA_SPLIT]	= {{  "X", "split" },	   blk_log_split },
+	[__BLK_TA_BOUNCE]	= {{  "B", "bounce" },	   blk_log_generic },
+	[__BLK_TA_REMAP]	= {{  "A", "remap" },	   blk_log_remap },
+};
+
+static int blk_trace_event_print(struct trace_seq *s, struct trace_entry *ent,
+				 int flags)
+{
+	const struct blk_io_trace *t = (struct blk_io_trace *)ent;
+	const u16 what = t->action & ((1 << BLK_TC_SHIFT) - 1);
+	int ret;
+
+	if (unlikely(what == 0 || what > ARRAY_SIZE(what2act)))
+		ret = trace_seq_printf(s, "Bad pc action %x\n", what);
+	else {
+		const bool long_act = !!(trace_flags & TRACE_ITER_VERBOSE);
+		ret = blk_log_action_seq(s, t, what2act[what].act[long_act]);
+		if (ret)
+			ret = what2act[what].print(s, ent);
+	}
+
+	return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
+}
+
+static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
+{
+	const struct blk_io_trace *t;
+	u16 what;
+	int ret;
+
+	if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
+		return TRACE_TYPE_UNHANDLED;
+
+	t = (const struct blk_io_trace *)iter->ent;
+	what = t->action & ((1 << BLK_TC_SHIFT) - 1);
+
+	if (unlikely(what == 0 || what > ARRAY_SIZE(what2act)))
+		ret = trace_seq_printf(&iter->seq, "Bad pc action %x\n", what);
+	else {
+		const bool long_act = !!(trace_flags & TRACE_ITER_VERBOSE);
+		ret = blk_log_action_iter(iter, what2act[what].act[long_act]);
+		if (ret)
+			ret = what2act[what].print(&iter->seq, iter->ent);
+	}
+
+	return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
+}
+
+static struct tracer blk_tracer __read_mostly = {
+	.name		= "blk",
+	.init		= blk_tracer_init,
+	.reset		= blk_tracer_reset,
+	.start		= blk_tracer_start,
+	.stop		= blk_tracer_stop,
+	.print_header	= blk_tracer_print_header,
+	.print_line	= blk_tracer_print_line,
+	.flags		= &blk_tracer_flags,
+};
+
+static struct trace_event trace_blk_event = {
+	.type	 	= TRACE_BLK,
+	.trace		= blk_trace_event_print,
+	.latency_trace	= blk_trace_event_print,
+	.raw		= trace_nop_print,
+	.hex		= trace_nop_print,
+	.binary		= trace_nop_print,
+};
+
+static int __init init_blk_tracer(void)
+{
+	if (!register_ftrace_event(&trace_blk_event)) {
+		pr_warning("Warning: could not register block events\n");
+		return 1;
+	}
+
+	if (register_tracer(&blk_tracer) != 0) {
+		pr_warning("Warning: could not register the block tracer\n");
+		unregister_ftrace_event(&trace_blk_event);
+		return 1;
+	}
+
+	return 0;
+}
+
+device_initcall(init_blk_tracer);
+
+static int blk_trace_remove_queue(struct request_queue *q)
+{
+	struct blk_trace *bt;
+
+	bt = xchg(&q->blk_trace, NULL);
+	if (bt == NULL)
+		return -EINVAL;
+
+	kfree(bt);
+	return 0;
+}
+
+/*
+ * Setup everything required to start tracing
+ */
+static int blk_trace_setup_queue(struct request_queue *q, dev_t dev)
+{
+	struct blk_trace *old_bt, *bt = NULL;
+	int ret;
+
+	ret = -ENOMEM;
+	bt = kzalloc(sizeof(*bt), GFP_KERNEL);
+	if (!bt)
+		goto err;
+
+	bt->dev = dev;
+	bt->act_mask = (u16)-1;
+	bt->end_lba = -1ULL;
+	bt->trace_state = Blktrace_running;
+
+	old_bt = xchg(&q->blk_trace, bt);
+	if (old_bt != NULL) {
+		(void)xchg(&q->blk_trace, old_bt);
+		kfree(bt);
+		ret = -EBUSY;
+	}
+	return 0;
+err:
+	return ret;
+}
+
+/*
+ * sysfs interface to enable and configure tracing
+ */
+
+static ssize_t sysfs_blk_trace_enable_show(struct device *dev,
+					   struct device_attribute *attr,
+					   char *buf)
+{
+	struct hd_struct *p = dev_to_part(dev);
+	struct block_device *bdev;
+	ssize_t ret = -ENXIO;
+
+	lock_kernel();
+	bdev = bdget(part_devt(p));
+	if (bdev != NULL) {
+		struct request_queue *q = bdev_get_queue(bdev);
+
+		if (q != NULL) {
+			mutex_lock(&bdev->bd_mutex);
+			ret = sprintf(buf, "%u\n", !!q->blk_trace);
+			mutex_unlock(&bdev->bd_mutex);
+		}
+
+		bdput(bdev);
+	}
+
+	unlock_kernel();
+	return ret;
+}
+
+static ssize_t sysfs_blk_trace_enable_store(struct device *dev,
+					    struct device_attribute *attr,
+					    const char *buf, size_t count)
+{
+	struct block_device *bdev;
+	struct request_queue *q;
+	struct hd_struct *p;
+	int value;
+	ssize_t ret = -ENXIO;
+
+	if (count == 0 || sscanf(buf, "%d", &value) != 1)
+		goto out;
+
+	lock_kernel();
+	p = dev_to_part(dev);
+	bdev = bdget(part_devt(p));
+	if (bdev == NULL)
+		goto out_unlock_kernel;
+
+	q = bdev_get_queue(bdev);
+	if (q == NULL)
+		goto out_bdput;
+
+	mutex_lock(&bdev->bd_mutex);
+	if (value)
+		ret = blk_trace_setup_queue(q, bdev->bd_dev);
+	else
+		ret = blk_trace_remove_queue(q);
+	mutex_unlock(&bdev->bd_mutex);
+
+	if (ret == 0)
+		ret = count;
+out_bdput:
+	bdput(bdev);
+out_unlock_kernel:
+	unlock_kernel();
+out:
+	return ret;
+}
+
+static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buf);
+static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
+					  struct device_attribute *attr,
+					  const char *buf, size_t count);
+#define BLK_TRACE_DEVICE_ATTR(_name) \
+	DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
+		    sysfs_blk_trace_attr_show, \
+		    sysfs_blk_trace_attr_store)
+
+static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR,
+		   sysfs_blk_trace_enable_show, sysfs_blk_trace_enable_store);
+static BLK_TRACE_DEVICE_ATTR(act_mask);
+static BLK_TRACE_DEVICE_ATTR(pid);
+static BLK_TRACE_DEVICE_ATTR(start_lba);
+static BLK_TRACE_DEVICE_ATTR(end_lba);
+
+static struct attribute *blk_trace_attrs[] = {
+	&dev_attr_enable.attr,
+	&dev_attr_act_mask.attr,
+	&dev_attr_pid.attr,
+	&dev_attr_start_lba.attr,
+	&dev_attr_end_lba.attr,
+	NULL
+};
+
+struct attribute_group blk_trace_attr_group = {
+	.name  = "trace",
+	.attrs = blk_trace_attrs,
+};
+
+static int blk_str2act_mask(const char *str)
+{
+	int mask = 0;
+	char *copy = kstrdup(str, GFP_KERNEL), *s;
+
+	if (copy == NULL)
+		return -ENOMEM;
+
+	s = strstrip(copy);
+
+	while (1) {
+		char *sep = strchr(s, ',');
+
+		if (sep != NULL)
+			*sep = '\0';
+
+		if (strcasecmp(s, "barrier") == 0)
+			mask |= BLK_TC_BARRIER;
+		else if (strcasecmp(s, "complete") == 0)
+			mask |= BLK_TC_COMPLETE;
+		else if (strcasecmp(s, "fs") == 0)
+			mask |= BLK_TC_FS;
+		else if (strcasecmp(s, "issue") == 0)
+			mask |= BLK_TC_ISSUE;
+		else if (strcasecmp(s, "pc") == 0)
+			mask |= BLK_TC_PC;
+		else if (strcasecmp(s, "queue") == 0)
+			mask |= BLK_TC_QUEUE;
+		else if (strcasecmp(s, "read") == 0)
+			mask |= BLK_TC_READ;
+		else if (strcasecmp(s, "requeue") == 0)
+			mask |= BLK_TC_REQUEUE;
+		else if (strcasecmp(s, "sync") == 0)
+			mask |= BLK_TC_SYNC;
+		else if (strcasecmp(s, "write") == 0)
+			mask |= BLK_TC_WRITE;
+
+		if (sep == NULL)
+			break;
+
+		s = sep + 1;
+	}
+	kfree(copy);
+
+	return mask;
+}
+
+static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buf)
+{
+	struct hd_struct *p = dev_to_part(dev);
+	struct request_queue *q;
+	struct block_device *bdev;
+	ssize_t ret = -ENXIO;
+
+	lock_kernel();
+	bdev = bdget(part_devt(p));
+	if (bdev == NULL)
+		goto out_unlock_kernel;
+
+	q = bdev_get_queue(bdev);
+	if (q == NULL)
+		goto out_bdput;
+	mutex_lock(&bdev->bd_mutex);
+	if (q->blk_trace == NULL)
+		ret = sprintf(buf, "disabled\n");
+	else if (attr == &dev_attr_act_mask)
+		ret = sprintf(buf, "%#x\n", q->blk_trace->act_mask);
+	else if (attr == &dev_attr_pid)
+		ret = sprintf(buf, "%u\n", q->blk_trace->pid);
+	else if (attr == &dev_attr_start_lba)
+		ret = sprintf(buf, "%llu\n", q->blk_trace->start_lba);
+	else if (attr == &dev_attr_end_lba)
+		ret = sprintf(buf, "%llu\n", q->blk_trace->end_lba);
+	mutex_unlock(&bdev->bd_mutex);
+out_bdput:
+	bdput(bdev);
+out_unlock_kernel:
+	unlock_kernel();
+	return ret;
+}
+
+static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
+					  struct device_attribute *attr,
+					  const char *buf, size_t count)
+{
+	struct block_device *bdev;
+	struct request_queue *q;
+	struct hd_struct *p;
+	u64 value;
+	ssize_t ret = -ENXIO;
+
+	if (count == 0)
+		goto out;
+
+	if (attr == &dev_attr_act_mask) {
+		if (sscanf(buf, "%llx", &value) != 1) {
+			/* Assume it is a list of trace category names */
+			value = blk_str2act_mask(buf);
+			if (value < 0)
+				goto out;
+		}
+	} else if (sscanf(buf, "%llu", &value) != 1)
+		goto out;
+
+	lock_kernel();
+	p = dev_to_part(dev);
+	bdev = bdget(part_devt(p));
+	if (bdev == NULL)
+		goto out_unlock_kernel;
+
+	q = bdev_get_queue(bdev);
+	if (q == NULL)
+		goto out_bdput;
+
+	mutex_lock(&bdev->bd_mutex);
+	ret = 0;
+	if (q->blk_trace == NULL)
+		ret = blk_trace_setup_queue(q, bdev->bd_dev);
+
+	if (ret == 0) {
+		if (attr == &dev_attr_act_mask)
+			q->blk_trace->act_mask = value;
+		else if (attr == &dev_attr_pid)
+			q->blk_trace->pid = value;
+		else if (attr == &dev_attr_start_lba)
+			q->blk_trace->start_lba = value;
+		else if (attr == &dev_attr_end_lba)
+			q->blk_trace->end_lba = value;
+		ret = count;
+	}
+	mutex_unlock(&bdev->bd_mutex);
+out_bdput:
+	bdput(bdev);
+out_unlock_kernel:
+	unlock_kernel();
+out:
+	return ret;
+}
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 6d720243f5f4..01714efdc65a 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -268,6 +268,10 @@ ssize_t part_fail_store(struct device *dev,
 }
 #endif
 
+#ifdef CONFIG_BLK_DEV_IO_TRACE
+extern struct attribute_group blk_trace_attr_group;
+#endif
+
 static DEVICE_ATTR(partition, S_IRUGO, part_partition_show, NULL);
 static DEVICE_ATTR(start, S_IRUGO, part_start_show, NULL);
 static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL);
@@ -294,6 +298,9 @@ static struct attribute_group part_attr_group = {
 
 static struct attribute_group *part_attr_groups[] = {
 	&part_attr_group,
+#ifdef CONFIG_BLK_DEV_IO_TRACE
+	&blk_trace_attr_group,
+#endif
 	NULL
 };
 
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index b96037d970df..e603a291134b 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -32,6 +32,7 @@ enum trace_type {
 	TRACE_KMEM_ALLOC,
 	TRACE_KMEM_FREE,
 	TRACE_POWER,
+	TRACE_BLK,
 
 	__TRACE_LAST_TYPE,
 };
]

273/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 41733
							output: 37
							thoughts: 396
						

Thoughts:
**Analyzing Tracepoint Registration in blktrace**

Okay, let's break this down. I'm looking at commit `5f3ea37c7716db4e894a480e0c18b24399595b6b`, specifically the "blktrace: port to tracepoints" change. The key thing here is the introduction of `blk_register_tracepoints()`.  I see the code, and it's calling `register_trace_block_*` functions, each followed by `WARN_ON(ret)`. 

Now, here's where my expert intuition kicks in. My immediate question is whether those `register_trace_block_*` calls *always* behaved this way. Did they always potentially return an error, and did this commit introduce that behavior? Or was that error checking – and the `WARN_ON` – added later? I need to understand when `tracepoint_probe_register` started allocating memory or returning `ENOMEM` or other error codes. This might have been present in `5f3ea37c7716`, or added later.

To clarify, I need to investigate the history of `tracepoint_probe_register` itself.  I need to check the Git log. I need to search for occurrences of `tracepoint_probe_register`, as well as `register_trace_` and possibly the source file, `tracepoint.c`, to figure out when error handling and memory allocation became relevant in the context of these tracepoint registrations. The goal is to isolate the point at which this error handling became an issue.



274/2 2026/08/31 22:09 tool git-log
0m Args:
map[CodeRegexp:register_trace_block PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:eeadd68e2a5f block: remove bounce buffering support
b81b8f40c5b4 block: remove the unused block_sleeprq tracepoint
f3bdc62fd82e blktrace: Provide event for request merging
cee4b7ce3f91 blktrace: remove the unused block_rq_abort tracepoint
49cac01e1fa7 block: make unplug timer trace event correspond to the schedule() unplug
d9c978331790 block: remove block_unplug_timer() trace point
d07335e51df0 block: Rename "block_remap" tracepoint to "block_bio_remap" to clarify the event.
38516ab59fbc tracing: Let tracepoints have data passed to tracepoint callbacks
b0da3f0dada7 Add a tracepoint for block request remapping
2db270a80b8f tracing/blktrace: move the tracing file to kernel/trace
]

275/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 42768
							output: 26
							thoughts: 66
						

Thoughts:
Here's my thinking process:

**Diving into Tracepoint History**

Okay, so I'm trying to figure out something about the tracepoint implementation, probably debugging a potential issue. My first instinct is to go right to the source: `tracepoint.c` and how it handles registration. I need to understand how the `register_trace_` function works – its history, its evolution.

I'm thinking commit 5f3ea37c7716 might be a key point. I want to see when that landed, and then I'll likely need to check the commits immediately before and after it to understand any context or related changes. That usually gives me a good sense of the scope of any changes.

Hold on, I also need to consider the environment I'm working with. Different kernel versions can change how features work. It's important to understand this because there could have been significant changes to the code. I know there were changes to tracepoints around the 2.6.28 kernel, so let's start there. I'll need to check the tracepoint implementation in that version to establish a baseline for comparison.



276/2 2026/08/31 22:09 tool git-log
0m Args:
map[Count:5 PathPrefix:kernel/tracepoint.c]

Results:
map[Output:fad217e16fde tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()
323bbfcf1ef8 Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
a46023d5616e tracing: Guard __DECLARE_TRACE() use of __DO_TRACE_CALL() with SRCU-fast
]

277/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 43267
							output: 34
							thoughts: 19
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience and written in the first person:

**Initial Dive into Tracepoint.c**

Okay, let's get down to brass tacks. I'm starting at the very beginning, the initial commit for tracepoints in `kernel/tracepoint.c`. I want to understand the foundational architecture, the core data structures, and the basic mechanisms implemented before things get layered on top. I'm looking for the elegance (or lack thereof) in the early design choices. What's the fundamental model of interaction? Are we talking about a simple registration and callback system, or is there something more elaborate even from the start? I'm anticipating some potentially naive implementations that were later refined, but that's what I want to see. This starting point will tell me everything about where the code came from. I am looking for the essential groundwork, the assumptions made, and any obvious constraints they had to work within. Understanding this initial implementation will provide the necessary context to appreciate any later complexities or performance optimizations that were added. Let's see what we've got.



278/2 2026/08/31 22:09 tool git-log
0m Args:
map[Count:5 PathPrefix:kernel/tracepoint.c Since:20 years]

Results:
map[Output:fad217e16fde tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()
323bbfcf1ef8 Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
a46023d5616e tracing: Guard __DECLARE_TRACE() use of __DO_TRACE_CALL() with SRCU-fast
]

279/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 43717
							output: 33
							thoughts: 120
						

Thoughts:
**Investigating the Introduction of Tracepoints**

Okay, so I need to quickly grab the five most recent commits using `git log`, right? I'll probably want to specify a count to limit the output. Wait a minute, that's right, `git log --count=5` just gets me the *last* five commits! I need to be more precise in my approach.

Alright, let's say I want to examine commit *5f3ea37c7716*. I need to focus on what happened around the introduction of `tracepoint_probe_register`. My aim is to check when the tracepoint functionality itself was introduced.

Okay, I seem to recall that this was around the 2.6.28 kernel version, so commit *7b453719cbf8* sounds like a good place to start, or something similar from that timeframe.

I'll check the `git log` history for `kernel/tracepoint.c` – specifically, I'll focus on the commits around 2008. That should provide a clearer picture of the initial implementation.



280/2 2026/08/31 22:09 tool git-log
0m Args:
map[CodeRegexp:allocate_probes PathPrefix:kernel/tracepoint.c]

Results:
map[Output:7211f0a25781 tracepoints: Code clean up
befe6d946551 tracepoint: Do not fail unregistering a probe due to memory failure
19dba33c43a2 tracepoint: simplification for tracepoints using RCU
]

281/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 44189
							output: 24
							thoughts: 28
						

Thoughts:
Here's my summary, as if I were the one thinking these thoughts:

**Analyzing Mathieu Desnoyers' Tracepoint Commit**

Okay, let's dive into commit `7b453719cbf8`. I recognize that hash, it should be Mathieu Desnoyers' initial tracepoint implementation, if memory serves. I'm especially interested in this, as it's the genesis of a significant piece of observability infrastructure. This should shed light on the original design choices, the architectural considerations, and hopefully, some of the reasoning behind the early decisions. I need to refresh my understanding of how he approached this initially, which will give me a better understanding of how the code evolved, and what trade-offs were made from the outset. I'll focus on the data structures and control flow, and think about the design implications in terms of performance and extensibility. There are often subtleties in the initial commits that provide valuable context. Let's dig in.



282/2 2026/08/31 22:09 tool git-log
0m Args:
map[MessageRegexps:[tracepoint: infrastructure]]

Results:
map[Output:8e677a466145 trace: tcp: Add tracepoint for tcp_cwnd_reduction()
54a59aed395c net, sched: Make tc-related drop reason more flexible
ff40e51043af bpf, lockdown, audit: Fix buggy SELinux lockdown permission checks
]

283/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 44534
							output: 39
							thoughts: 14
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert:

**Tracing the Tracepoint Timeline**

Alright, before I dive too deep into this performance issue I'm looking at, I need a solid timeline. My immediate instinct is to pinpoint when the tracepoint infrastructure was actually introduced into the kernel. Knowing the introduction date will give me a valuable context, especially if I'm troubleshooting problems with earlier versions. It sets the stage for any changes, bugs, or limitations I might encounter relative to its initial implementation, so I can immediately dismiss potential areas of conflict. Time to start digging through the changelogs!



284/2 2026/08/31 22:09 tool git-log
0m Args:
map[CodeRegexp:struct tracepoint Count:10 PathPrefix:include/linux/tracepoint.h]

Results:
map[Output:a46023d5616e tracing: Guard __DECLARE_TRACE() use of __DO_TRACE_CALL() with SRCU-fast
654ced4a1377 tracing: Introduce tracepoint_is_faultable()
a9cfb8778c43 tracing: Introduce tracepoint extended structure
e53244e2c893 tracepoint: Remove SRCU protection
d4df54f338e4 tracepoint: Support iterating tracepoints in a loading module
d5dbf8b48a46 tracepoint: Support iterating over tracepoints on modules
9913d5745bd7 tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing
d9a1be1be331 tracepoints: Do not punish non static call users
d25e37d89dd2 tracepoint: Optimize using static_call()
1c39d761ff5c tracepoint: Use __used attribute definitions from compiler_attributes.h
]

285/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 44979
							output: 30
							thoughts: 1001
						

Thoughts:
**Analyzing the blktrace Tracepoint Registration**

Okay, let's dive back into this blktrace issue. First, I'm reviewing commit 5f3ea37c7716db4e894a480e0c18b24399595b6b. Arnaldo's commit introduced `blk_register_tracepoints()` and the initial setup. I see that it explicitly checks the return values of `register_trace_block_*()` functions with `WARN_ON(ret)`. That's interesting; it suggests there was an expectation of potential failure during tracepoint registration, likely due to memory allocation within those registration functions. However, the function *always* returns 0, and the `WARN_ON` macros seem a bit out of place, given this.

Then, there's commit 3c289ba7c320560ee74979a8895141c829046a2d, which removes `blk_probe_mutex`. The justification here is that since `blk_register_tracepoints()` *always* returns 0, the mutex protecting `blk_probes_ref` isn't needed. The return type gets changed to `void`. Ah, the lightbulb moment: it seems the original `WARN_ON(ret)` was never actually triggered because `blk_register_tracepoints` *always* returned zero!

Now, the root cause explanation brings it all together: those tracepoint registration functions *can* fail, especially under memory pressure or with fault injection, because of allocations. A failure should return -ENOMEM. The `WARN_ON()` was set to catch these, *but* the errors were ignored and the function continued. This leaves the tracepoints in a partially registered state. Unregistering that state later leads to an `-ENOENT` return from `tracepoint_remove_func()` and *another* `WARN_ON_ONCE`! That's a classic example of an incomplete error handling.

Therefore, the fix is going to involve proper error handling: returning the error from `blk_register_tracepoints`, unregistering successfully registered tracepoints on error, and propagating the error up the call stack.

Time to look at the history of `blktrace.c` using `git log`, focusing on commits touching `blk_register_tracepoints`, `blk_trace_setup_queue`, or `blk_trace_setup_finalize`. This should give a clearer picture of the code's evolution and any relevant refactorings.



286/2 2026/08/31 22:09 tool git-log
0m Args:
map[Count:30 PathPrefix:kernel/trace/blktrace.c]

Results:
map[Output:da46b5dfef48 blktrace: fix __this_cpu_read/write in preemptible context
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
dfe48ea17973 blk-mq: use NOIO context to prevent deadlock during debugfs creation
0c2580a80946 blktrace: Make init_blk_tracer() asynchronous
ee4784a83fb2 block: don't use strcpy to copy blockdev name
bbec8e28cac5 tracing: Allow tracer to add more than 32 options
bc49af56eea8 blktrace: add support for REQ_OP_WRITE_ZEROES tracing
e48886b9d668 blktrace: for ftrace use correct trace format ver
4a0940bdcac2 blktrace: use debug print to report dropped events
4ae8efb4f907 blktrace: handle BLKTRACESETUP2 ioctl
3f6722816a73 blktrace: trace zone write plugging operations
1c164fcc1b08 blktrace: expose ZONE APPEND completions to blktrace
f9ee38bbf70f blktrace: add block trace commands for zone operations
4d8bc7bd4f73 blktrace: move ftrace blk_io_tracer to blk_io_trace2
67bfa74d81ba blktrace: move trace_note to blk_io_trace2
915bb53860c3 blktrace: differentiate between blk_io_trace versions
c44347d60626 blktrace: add definitions for struct blk_io_trace2
113cbd62824a blktrace: pass blk_user_trace2 to setup functions
0d8627cc936d blktrace: add definitions for blk_user_trace_setup2
42da88a724d8 blktrace: split do_blk_trace_setup into two functions
370cd70a402f blktrace: change the internal action to 64bit
70e3c62b8912 blktrace: untangle if/else sequence in __blk_add_trace
04678e72e95f blktrace: split out relaying a blktrace event
472eca538358 blktrace: factor out recording a blktrace event
a65988a0ad04 blktrace: only calculate trace length once
bd116214d53c blktrace: add zoned block commands to blk_fill_rwbs
7f2173894f7b blktrace: use rbuf->stats.full as a drop indicator in relayfs
2489e958129f relayfs: abolish prev_padding
927244f6efff traceevent/block: Add REQ_ATOMIC flag to block trace events
]

287/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 47349
							output: 26
							thoughts: 34
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing blktrace.c Commits**

Right, let's dive into this. The initial thought is to examine commit `42da88a724d8` and then widen the scope to include related commits to understand the recent modifications within `blktrace.c`. This isn't just a casual glance; I'm expecting to dissect the *why* behind the code changes, not just the *what*. My goal is a full understanding of the changes' implications – potential performance impacts, bug fixes, new features implemented, or perhaps architectural shifts. I'll need to assess the context of these modifications within the larger framework of `blktrace`. I want to see how these changes interact with the existing codebase and, if I'm lucky, I may be able to piece together the reasoning behind this commit.



288/2 2026/08/31 22:09 tool git-show
0m Args:
map[Commit:42da88a724d8]

Results:
map[Output:commit 42da88a724d8a3b92ade35ae2ef4d5e5a491df2d
Author: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Date:   Wed Oct 22 13:41:05 2025 +0200

    blktrace: split do_blk_trace_setup into two functions
    
    Split do_blk_trace_setup into two functions, this is done to prepare for
    an incoming new BLKTRACESETUP2 ioctl(2) which can receive extended
    parameters from user-space.
    
    Also move the size verification logic to the callers in preparation for
    using a new internal structure later.
    
    Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 15d6788700ca..df90422ae613 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -518,9 +518,10 @@ static void blk_trace_setup_lba(struct blk_trace *bt,
 /*
  * Setup everything required to start tracing
  */
-static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
-			      struct block_device *bdev,
-			      struct blk_user_trace_setup *buts)
+static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
+						 char *name, dev_t dev,
+						 u32 buf_size, u32 buf_nr,
+						 struct block_device *bdev)
 {
 	struct blk_trace *bt = NULL;
 	struct dentry *dir = NULL;
@@ -528,31 +529,19 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 
 	lockdep_assert_held(&q->debugfs_mutex);
 
-	if (!buts->buf_size || !buts->buf_nr)
-		return -EINVAL;
-
-	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE);
-
-	/*
-	 * some device names have larger paths - convert the slashes
-	 * to underscores for this to work as expected
-	 */
-	strreplace(buts->name, '/', '_');
-
 	/*
 	 * bdev can be NULL, as with scsi-generic, this is a helpful as
 	 * we can be.
 	 */
 	if (rcu_dereference_protected(q->blk_trace,
 				      lockdep_is_held(&q->debugfs_mutex))) {
-		pr_warn("Concurrent blktraces are not allowed on %s\n",
-			buts->name);
-		return -EBUSY;
+		pr_warn("Concurrent blktraces are not allowed on %s\n", name);
+		return ERR_PTR(-EBUSY);
 	}
 
 	bt = kzalloc(sizeof(*bt), GFP_KERNEL);
 	if (!bt)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 
 	ret = -ENOMEM;
 	bt->sequence = alloc_percpu(unsigned long);
@@ -572,7 +561,7 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	if (bdev && !bdev_is_partition(bdev))
 		dir = q->debugfs_dir;
 	else
-		bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root);
+		bt->dir = dir = debugfs_create_dir(name, blk_debugfs_root);
 
 	/*
 	 * As blktrace relies on debugfs for its interface the debugfs directory
@@ -580,8 +569,7 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	 * files or directories.
 	 */
 	if (IS_ERR_OR_NULL(dir)) {
-		pr_warn("debugfs_dir not present for %s so skipping\n",
-			buts->name);
+		pr_warn("debugfs_dir not present for %s so skipping\n", name);
 		ret = -ENOENT;
 		goto err;
 	}
@@ -593,17 +581,38 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 	debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 
-	bt->rchan = relay_open("trace", dir, buts->buf_size,
-				buts->buf_nr, &blk_relay_callbacks, bt);
+	bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
+			       &blk_relay_callbacks, bt);
 	if (!bt->rchan)
 		goto err;
 
+	blk_trace_setup_lba(bt, bdev);
+
+	return bt;
+
+err:
+	blk_trace_free(q, bt);
+
+	return ERR_PTR(ret);
+}
+
+static void blk_trace_setup_finalize(struct request_queue *q,
+				     char *name, struct blk_trace *bt,
+				     struct blk_user_trace_setup *buts)
+
+{
+	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE);
+
+	/*
+	 * some device names have larger paths - convert the slashes
+	 * to underscores for this to work as expected
+	 */
+	strreplace(buts->name, '/', '_');
+
 	bt->act_mask = buts->act_mask;
 	if (!bt->act_mask)
 		bt->act_mask = (u16) -1;
 
-	blk_trace_setup_lba(bt, bdev);
-
 	/* overwrite with user settings */
 	if (buts->start_lba)
 		bt->start_lba = buts->start_lba;
@@ -615,12 +624,6 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 
 	rcu_assign_pointer(q->blk_trace, bt);
 	get_probe_ref();
-
-	ret = 0;
-err:
-	if (ret)
-		blk_trace_free(q, bt);
-	return ret;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -628,17 +631,25 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		    char __user *arg)
 {
 	struct blk_user_trace_setup buts;
+	struct blk_trace *bt;
 	int ret;
 
 	ret = copy_from_user(&buts, arg, sizeof(buts));
 	if (ret)
 		return -EFAULT;
 
+	if (!buts.buf_size || !buts.buf_nr)
+		return -EINVAL;
+
 	mutex_lock(&q->debugfs_mutex);
-	ret = do_blk_trace_setup(q, name, dev, bdev, &buts);
+	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
+				     bdev);
+	if (IS_ERR(bt)) {
+		mutex_unlock(&q->debugfs_mutex);
+		return PTR_ERR(bt);
+	}
+	blk_trace_setup_finalize(q, name, bt, &buts);
 	mutex_unlock(&q->debugfs_mutex);
-	if (ret)
-		return ret;
 
 	if (copy_to_user(arg, &buts, sizeof(buts))) {
 		blk_trace_remove(q);
@@ -655,11 +666,14 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 {
 	struct blk_user_trace_setup buts;
 	struct compat_blk_user_trace_setup cbuts;
-	int ret;
+	struct blk_trace *bt;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
 
+	if (!cbuts.buf_size || !cbuts.buf_nr)
+		return -EINVAL;
+
 	buts = (struct blk_user_trace_setup) {
 		.act_mask = cbuts.act_mask,
 		.buf_size = cbuts.buf_size,
@@ -670,10 +684,14 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	};
 
 	mutex_lock(&q->debugfs_mutex);
-	ret = do_blk_trace_setup(q, name, dev, bdev, &buts);
+	bt = blk_trace_setup_prepare(q, name, dev, buts.buf_size, buts.buf_nr,
+				     bdev);
+	if (IS_ERR(bt)) {
+		mutex_unlock(&q->debugfs_mutex);
+		return PTR_ERR(bt);
+	}
+	blk_trace_setup_finalize(q, name, bt, &buts);
 	mutex_unlock(&q->debugfs_mutex);
-	if (ret)
-		return ret;
 
 	if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
 		blk_trace_remove(q);
]

289/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 50333
							output: 39
							thoughts: 662
						

Thoughts:
**Analyzing a Kernel Crash Related to Block Tracing**

Okay, let's dive into this. First, I'm going to look at the stack trace and the relevant code snippets from the crash report. It looks like the kernel is complaining about an issue within `kernel/trace/blktrace.c`, specifically around line 1332, and this is happening in `get_probe_ref` at line 492 as well. The CPU context is `syz.0.17/6119`, which implies syzkaller is involved.

Alright, let's take a look at what's going on at those lines. Line 1332 within `blk_register_tracepoints` has a `WARN_ON` call after registering a tracepoint:

```c
ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
WARN_ON(ret);
```

So it looks like the crash involves the `register_trace_block_rq_insert` call, or the immediate `WARN_ON` check after it.

Then, line 492 which is a call into `get_probe_ref`. That's important. It appears that `get_probe_ref` is responsible for registering tracepoints, guarded by a mutex to ensure thread safety.

```c
mutex_lock(&blk_probe_mutex);
if (++blk_probes_ref == 1)
		blk_register_tracepoints();
mutex_unlock(&blk_probe_mutex);
```

Now let's examine the call trace: The issue is linked to `sysfs_blk_trace_attr_store`, which calls `blk_trace_setup_queue` from `kernel/trace/blktrace.c`. Then, it's called through kernfs write operations. So, it's triggered from the sysfs interface when setting up tracing for a block device.

My next step is to examine the `git blame` history for `blk_register_tracepoints` in `kernel/trace/blktrace.c`. This will give me context on recent changes, who touched this code, and potentially any related bug fixes or recent modifications that might have introduced this issue. The goal is to understand what might be causing the return value `ret` from `register_trace_block_rq_insert` to be non-zero (indicating an error). It could be a race condition, a resource limit, or a conflict in the initialization. I have a hunch it might be related to how the trace points are registered, maybe an issue when multiple threads try to do it simultaneously or related to how syzkaller is triggering it.



290/2 2026/08/31 22:09 tool git-blame
0m Args:
map[End:1360 File:kernel/trace/blktrace.c Start:1320]

Results:
map[Output:919dbca8670d0 kernel/trace/blktrace.c 1320) 	__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0,
ca1136c99b66b kernel/trace/blktrace.c 1321) 				BLK_TA_DRV_DATA, 0, len, data,
a54895fa057c6 kernel/trace/blktrace.c 1322) 				blk_trace_request_get_cgid(rq));
c780e86dd48ef kernel/trace/blktrace.c 1323) 	rcu_read_unlock();
5f3ea37c7716d block/blktrace.c        1324) }
5f3ea37c7716d block/blktrace.c        1325) EXPORT_SYMBOL_GPL(blk_add_driver_data);
5f3ea37c7716d block/blktrace.c        1326) 
3c289ba7c3205 kernel/trace/blktrace.c 1327) static void blk_register_tracepoints(void)
5f3ea37c7716d block/blktrace.c        1328) {
5f3ea37c7716d block/blktrace.c        1329) 	int ret;
5f3ea37c7716d block/blktrace.c        1330) 
38516ab59fbc5 kernel/trace/blktrace.c 1331) 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
5f3ea37c7716d block/blktrace.c        1332) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1333) 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
5f3ea37c7716d block/blktrace.c        1334) 	WARN_ON(ret);
f3bdc62fd82ed kernel/trace/blktrace.c 1335) 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
f3bdc62fd82ed kernel/trace/blktrace.c 1336) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1337) 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
5f3ea37c7716d block/blktrace.c        1338) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1339) 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
5f3ea37c7716d block/blktrace.c        1340) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1341) 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
5f3ea37c7716d block/blktrace.c        1342) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1343) 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
5f3ea37c7716d block/blktrace.c        1344) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1345) 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
5f3ea37c7716d block/blktrace.c        1346) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1347) 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
5f3ea37c7716d block/blktrace.c        1348) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1349) 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
5f3ea37c7716d block/blktrace.c        1350) 	WARN_ON(ret);
1c164fcc1b08e kernel/trace/blktrace.c 1351) 	ret = register_trace_blk_zone_append_update_request_bio(
1c164fcc1b08e kernel/trace/blktrace.c 1352) 		blk_add_trace_zone_update_request, NULL);
1c164fcc1b08e kernel/trace/blktrace.c 1353) 	WARN_ON(ret);
3f6722816a73e kernel/trace/blktrace.c 1354) 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
3f6722816a73e kernel/trace/blktrace.c 1355) 						     NULL);
3f6722816a73e kernel/trace/blktrace.c 1356) 	WARN_ON(ret);
3f6722816a73e kernel/trace/blktrace.c 1357) 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
3f6722816a73e kernel/trace/blktrace.c 1358) 						NULL);
3f6722816a73e kernel/trace/blktrace.c 1359) 	WARN_ON(ret);
38516ab59fbc5 kernel/trace/blktrace.c 1360) 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
]

291/2 2026/08/31 22:09 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 53341
							output: 23
							thoughts: 2302
						

Thoughts:
**Analysis of the Blktrace Tracepoint Registration Bug**

Okay, let's break this down systematically. My initial thought process is to understand the chronology of events and pinpoint where the error handling was introduced or, more accurately, where it *wasn't* handled correctly. My first instinct is to zero in on the commit that introduced `blk_register_tracepoints`.

So, the first place I'm going to look is commit `5f3ea37c7716`. Aha! This "blktrace: port to tracepoints" commit introduces `blk_register_tracepoints`, and immediately I see the problem: `WARN_ON(ret)` after *every* call to a `register_trace_*` function. This *immediately* raises a red flag. The code checks for an error with `WARN_ON(ret)`, which triggers a kernel panic if `panic_on_warn` is set, but it *doesn't* actually stop if it fails! It just keeps going, and then it *always* returns 0. I remember the description of the problem specifically mentions `-ENOMEM` from allocation failures, which makes sense in the context of the tracepoint registration process.

I'm starting to think this is the source of the issue.

Next, I need to check the surrounding commits to see how this function evolved. I see commit `3c289ba7c320` ("blktrace: remove blk_probe_mutex"). This commit modifies the return type of `blk_register_tracepoints` to `void` because the function *always* returns 0. That confirms what I was thinking. The author (Li Zefan) realized the return value was meaningless because it was being ignored. They were not the ones who introduced the bug, they simply adapted to what was there. The initial code, in commit `5f3ea37c7716`, made the `int` return type of the function superfluous.

Then, commit `a6da0024ffc1` ("blktrace: fix unlocked registration of tracepoints") comes along and reintroduces the mutex with `get_probe_ref()` / `put_probe_ref()`, re-introducing the conditional call to `blk_register_tracepoints()`.

Now, the bug description. The description states that `blk_register_tracepoints()` uses `WARN_ON(ret)` and that `blk_register_tracepoints()` ignores the error and continues, leaving tracepoints in a partially registered state, and that later, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. The description is correct in the fact that any failures during tracepoint registration, particularly when the tracepoint is later unregistered, could lead to issues.

So, let's go back and examine `5f3ea37c7716` and the commit history. The core of the problem is in `5f3ea37c7716`, where the code calls `register_trace_*()` and uses `WARN_ON(ret)`. No proper error handling is performed, and the return value is ignored.

I'm now confident that the root cause lies in `5f3ea37c7716`. The original implementation did not handle failures to register tracepoints, instead, merely warning via `WARN_ON(ret)`. The crash happens because the unregistration of the tracepoints does not account for their potentially being partially registered, or not registered at all.



292/2 2026/08/31 22:10 tool git-log
0m Args:
map[MessageRegexps:[blk_register_tracepoints]]

Results:
map[Output:a6da0024ffc1 blktrace: fix unlocked registration of tracepoints
3c289ba7c320 blktrace: remove blk_probe_mutex
]

293/2 2026/08/31 22:10 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 56473
							output: 37
							thoughts: 48
						

Thoughts:
**Investigating Recent Changes to the Block Tracepoint Registration**

Okay, so I need to quickly get a lay of the land regarding any recent modifications to `blk_register_tracepoints`. My first step is to see if any other commits have touched that specific function. I'll execute a `git log -L` command, targeting that function specifically within the `kernel/trace/blktrace.c` file. This should give me a concise list of any relevant commits, allowing me to quickly understand the history and potential impact of those changes. I'm looking for a quick overview – anything significant that might require further inspection.



294/2 2026/08/31 22:10 tool git-log
0m Args:
map[SourcePath:kernel/trace/blktrace.c SymbolName:blk_register_tracepoints]

Results:
map[Output:3c289ba7c320 blktrace: remove blk_probe_mutex
5f3ea37c7716 blktrace: port to tracepoints
]

295/2 2026/08/31 22:10 llm fixes-finder
0m Model:
gemini-3.7-flash

Tokens:
							input: 56745
							output: 55
							thoughts: 616
						

Thoughts:
**Analyzing the blktrace Tracepoint Registration Issue**

Okay, so I've been digging into this `blktrace` issue. My first move was to use `git log -L :blk_register_tracepoints:kernel/trace/blktrace.c` to pinpoint relevant commits. It gave me two: `3c289ba7c320` which removes a mutex, and, more importantly, `5f3ea37c7716` "blktrace: port to tracepoints."

Let's dive into that second commit, `5f3ea37c7716db4e894a480e0c18b24399595b6b`. It's Arnaldo Carvalho de Melo's commit from October 2008, titled "blktrace: port to tracepoints." Time to verify the details.

Now, let's break this down systematically. I looked at the stack trace from the crash, which clearly points to `blk_register_tracepoints` in `kernel/trace/blktrace.c:1332`. It seems the crash happens when `register_trace_block_*` calls fail, for example, due to an out-of-memory condition under fault injection, and the code uses `WARN_ON(ret)`.

The root cause here is evident. The `blk_register_tracepoints()` function was poorly written. It registered individual tracepoints and used `WARN_ON(ret)` for error reporting. It completely ignored potential registration errors.

The fix is straightforward, and the solution is to change `blk_register_tracepoints()` to return an integer error code. Proper error handling, including unwinding and propagating the error through its callers like `get_probe_ref()` and `blk_trace_setup_finalize()` is needed.

I'm confident in my diagnosis. The "blktrace: port to tracepoints" commit (`5f3ea37c7716`) is the culprit. That's where they introduced `blk_register_tracepoints` with the problematic `WARN_ON(ret)` and ignored registration errors.

So, let's call `set-results` with commit `5f3ea37c7716db4e894a480e0c18b24399595b6b`.



296/2 2026/08/31 22:10 tool set-results
0m Args:
map[FixesHash:5f3ea37c7716db4e894a480e0c18b24399595b6b]

Results:
map[FixesHash:5f3ea37c7716db4e894a480e0c18b24399595b6b]

297/1 2026/08/31 22:10 action format-fixes
0m Results:
map[Fixes:map[AuthorEmail:acme@redhat.com AuthorName:Arnaldo Carvalho de Melo Hash:5f3ea37c7716db4e894a480e0c18b24399595b6b Title:blktrace: port to tracepoints]]

298/1 2026/08/31 22:10 action get-maintainers
0m Results:
map[Recipients:[map[Email:axboe@kernel.dk Name:Jens Axboe To:true] map[Email:linux-block@vger.kernel.org Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:linux-trace-kernel@vger.kernel.org Name: To:true] map[Email:mathieu.desnoyers@efficios.com Name:Mathieu Desnoyers To:false] map[Email:mhiramat@kernel.org Name:Masami Hiramatsu To:true] map[Email:rostedt@goodmis.org Name:Steven Rostedt To:true] map[Email:acme@redhat.com Name:Arnaldo Carvalho de Melo To:true]]]

299/1 2026/08/31 22:10 action get-recent-commits
0m Results:
map[RecentCommits:blktrace: fix __this_cpu_read/write in preemptible context
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
blk-mq: use NOIO context to prevent deadlock during debugfs creation
blktrace: Make init_blk_tracer() asynchronous
block: don't use strcpy to copy blockdev name
tracing: Allow tracer to add more than 32 options
blktrace: add support for REQ_OP_WRITE_ZEROES tracing
blktrace: for ftrace use correct trace format ver
blktrace: use debug print to report dropped events
blktrace: handle BLKTRACESETUP2 ioctl
blktrace: trace zone write plugging operations
blktrace: expose ZONE APPEND completions to blktrace
blktrace: add block trace commands for zone operations
blktrace: move ftrace blk_io_tracer to blk_io_trace2
blktrace: move trace_note to blk_io_trace2
blktrace: differentiate between blk_io_trace versions
blktrace: add definitions for struct blk_io_trace2
blktrace: pass blk_user_trace2 to setup functions
blktrace: add definitions for blk_user_trace_setup2
]

300/1 2026/08/31 22:10 agent description-generator
0m Model:
core

Instruction:
You are an experienced Linux kernel developer tasked with writing a commit description for
a kernel bug fixing commit. The description should start with a one-line summary,
and then include description of the bug being fixed, and how it's fixed by the provided patch.
The one-line summary should describe the change being made, rather than mention the tool that
detected the bug.

The description must not contain lines starting with '#' because they will dropped by git as comments.
The description must not contain lines starting with '--' or '---' (including inline code diffs)
because they may confuse git/patch utilities.

Your final reply should contain only the text of the commit description.


The one-line summary must be not longer than 72 characters.

IMPORTANT: Do not wrap lines manually (e.g., at 80 characters); we will reformat the text
automatically, so keep paragraphs as single lines without newlines.

Generally try to phrase the description without mentioning syzkaller
(avoid phrases like "the bug was triggered by syzkaller" or "the bug was triggered by fuzzer", etc).
How the bug was triggered is generally an irrelevant detail.
Any bug triggered by a fuzzer can also be triggered by a malicious user, or a buggy program.

If the crash is reported by a sanitizer (e.g., KASAN, KMSAN, lockdep), include the relevant
parts of the sanitizer output to illustrate the problem. Exclude less relevant sections,
as the stack trace can be very long. Describe the execution path that leads to the manifestation
of the kernel bug.


If the patch removes the WARN_ON macro, refer to the fact that WARN_ON
must not be used for conditions that can legitimately happen, and that pr_err
should be used instead if necessary.

Don't assume that panic_on_warn is set, and that WARNINGs are fatal.
While panic_on_warn may be set when the bug was reproduced, it's generally not set on production systems.


Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash that corresponds to the bug is:

R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>
------------[ cut here ]------------
ret
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline], CPU#1: syz.0.17/6119
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492, CPU#1: syz.0.17/6119
Modules linked in:
CPU: 1 UID: 0 PID: 6119 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Code: c3 31 ff 89 c6 e8 39 42 f7 ff 85 db 0f 85 00 01 00 00 e8 2c 3d f7 ff 48 c7 c7 00 7f bd 8e 5b e9 af 77 db 09 e8 1a 3d f7 ff 90 <0f> 0b 90 e9 e8 fc ff ff e8 0c 3d f7 ff 90 0f 0b 90 e9 07 fd ff ff
RSP: 0018:ffffc9000355fb10 EFLAGS: 00010293
RAX: ffffffff81ce06d6 RBX: 00000000fffffff4 RCX: ffff888114150000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000355fc40 R08: ffffc9000355fa47 R09: 1ffff920006abf48
R10: dffffc0000000000 R11: fffff520006abf49 R12: ffff88810888c508
R13: dffffc0000000000 R14: ffff888103f8c638 R15: 0000000000002000
FS:  00007fc861b426c0(0000) GS:ffff8882e873e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2ed24008 CR3: 00000001fdd32000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc860b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc861b42028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc860e25fa0 RCX: 00007fc860b9e159
RDX: 0000000000000081 RSI: 00002000000002c0 RDI: 0000000000000003
RBP: 00007fc861b42090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fc860e26038 R14: 00007fc860e25fa0 R15: 00007ffd54a588d8
 </TASK>




The explanation of the root cause of the bug is:

The root cause of the crash is that `blk_register_tracepoints()` uses `WARN_ON(ret)` to check the return values of `register_trace_block_*()` functions. These tracepoint registration functions allocate memory for the probe array and can fail with `-ENOMEM` (e.g., under memory pressure or fault injection, as seen in the syzbot report). When they fail, `WARN_ON()` triggers a kernel panic if `panic_on_warn` is set.

Furthermore, `blk_register_tracepoints()` currently ignores the error and continues, leaving the tracepoints in a partially registered state. Later, when tracing is stopped, `blk_unregister_tracepoints()` unconditionally unregisters all tracepoints. Unregistering a tracepoint that was not successfully registered causes `tracepoint_remove_func()` to return `-ENOENT`, which triggers another `WARN_ON_ONCE` inside `tracepoint_remove_func()`.

To fix this, we need to properly handle the registration failures by returning the error, unregistering the successfully registered tracepoints, and propagating the error up the call stack to fail the blktrace setup.

### Fix Details

1. **Change `blk_register_tracepoints()` to return an `int` and handle errors:**
   Instead of `WARN_ON(ret)`, check the return value of each `register_trace_*()` call. If it fails, use `goto` labels to unregister the successfully registered tracepoints in reverse order, and return the error.

```c
static int blk_register_tracepoints(void)
{
	int ret;

	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	if (ret)
		return ret;
	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
	if (ret)
		goto err_issue;
	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
	if (ret)
		goto err_merge;
        // ... (do this for all 18 tracepoints) ...
	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
	if (ret)
		goto err_rq_remap;
	return 0;

err_rq_remap:
	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
// ... (unregister labels in reverse order) ...
err_merge:
	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
err_issue:
	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
	return ret;
}
```

2. **Propagate the error through `get_probe_ref()`:**
```c
static int get_probe_ref(void)
{
	int ret = 0;

	mutex_lock(&blk_probe_mutex);
	if (++blk_probes_ref == 1) {
		ret = blk_register_tracepoints();
		if (ret)
			blk_probes_ref--;
	}
	mutex_unlock(&blk_probe_mutex);
	return ret;
}
```

3. **Propagate the error through `blk_trace_setup_finalize()`:**
```c
static int blk_trace_setup_finalize(struct request_queue *q,
				     char *name, int version,
				     struct blk_trace *bt,
				     struct blk_user_trace_setup2 *buts)
{
	int ret;
        // ... existing code ...
	bt->trace_state = Blktrace_setup;

	ret = get_probe_ref();
	if (ret)
		return ret;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;
}
```

4. **Handle the error in the callers of `blk_trace_setup_finalize()`:**
   In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, check the return value of `blk_trace_setup_finalize()`. If it fails, clean up the allocated `bt` and return the error:
```c
	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
	if (ret) {
		blk_trace_free(q, bt);
		blk_debugfs_unlock(q, memflags);
		return ret;
	}
```

5. **Handle the error in `blk_trace_setup_queue()`:**
```c
static int blk_trace_setup_queue(struct request_queue *q,
				 struct block_device *bdev)
{
        // ... existing code ...
	blk_trace_setup_lba(bt, bdev);

	ret = get_probe_ref();
	if (ret)
		goto free_bt;

	rcu_assign_pointer(q->blk_trace, bt);
	return 0;

free_bt:
	blk_trace_free(q, bt);
	return ret;
}
```

The diff of the bug fix is:

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8cd2520b4..c2324298c 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -60,7 +60,7 @@ static struct tracer_flags blk_tracer_flags = {
 static DEFINE_MUTEX(blk_probe_mutex);
 static int blk_probes_ref;
 
-static void blk_register_tracepoints(void);
+static int blk_register_tracepoints(void);
 static void blk_unregister_tracepoints(void);
 
 static void record_blktrace_event(struct blk_io_trace *t, pid_t pid, int cpu,
@@ -485,12 +485,18 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
 	kfree(bt);
 }
 
-static void get_probe_ref(void)
+static int get_probe_ref(void)
 {
+	int ret = 0;
+
 	mutex_lock(&blk_probe_mutex);
-	if (++blk_probes_ref == 1)
-		blk_register_tracepoints();
+	if (++blk_probes_ref == 1) {
+		ret = blk_register_tracepoints();
+		if (ret)
+			blk_probes_ref--;
+	}
 	mutex_unlock(&blk_probe_mutex);
+	return ret;
 }
 
 static void put_probe_ref(void)
@@ -727,12 +733,14 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
 	return ERR_PTR(ret);
 }
 
-static void blk_trace_setup_finalize(struct request_queue *q,
-				     char *name, int version,
-				     struct blk_trace *bt,
-				     struct blk_user_trace_setup2 *buts)
+static int blk_trace_setup_finalize(struct request_queue *q,
+				    char *name, int version,
+				    struct blk_trace *bt,
+				    struct blk_user_trace_setup2 *buts)
 
 {
+	int ret;
+
 	strscpy_pad(buts->name, name, BLKTRACE_BDEV_SIZE2);
 
 	/*
@@ -755,8 +763,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	bt->pid = buts->pid;
 	bt->trace_state = Blktrace_setup;
 
+	ret = get_probe_ref();
+	if (ret)
+		return ret;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
+	return 0;
 }
 
 int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
@@ -792,7 +804,12 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	strscpy(buts.name, buts2.name, BLKTRACE_BDEV_SIZE);
 	blk_debugfs_unlock(q, memflags);
 
@@ -810,6 +827,7 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 	struct blk_user_trace_setup2 buts2;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&buts2, arg, sizeof(buts2)))
 		return -EFAULT;
@@ -827,7 +845,12 @@ static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 2, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2, sizeof(buts2))) {
@@ -846,6 +869,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 	struct compat_blk_user_trace_setup cbuts;
 	struct blk_trace *bt;
 	unsigned int memflags;
+	int ret;
 
 	if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
 		return -EFAULT;
@@ -869,7 +893,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
 		blk_debugfs_unlock(q, memflags);
 		return PTR_ERR(bt);
 	}
-	blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	ret = blk_trace_setup_finalize(q, name, 1, bt, &buts2);
+	if (ret) {
+		blk_trace_free(q, bt);
+		blk_debugfs_unlock(q, memflags);
+		return ret;
+	}
 	blk_debugfs_unlock(q, memflags);
 
 	if (copy_to_user(arg, &buts2.name, ARRAY_SIZE(buts2.name))) {
@@ -1324,49 +1353,108 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
-static void blk_register_tracepoints(void)
+static int blk_register_tracepoints(void)
 {
 	int ret;
 
 	ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out;
 	ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_insert;
 	ret = register_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_issue;
 	ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_merge;
 	ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_requeue;
 	ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_rq_complete;
 	ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_complete;
 	ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_backmerge;
 	ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_frontmerge;
 	ret = register_trace_block_getrq(blk_add_trace_getrq, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_queue;
 	ret = register_trace_blk_zone_append_update_request_bio(
 		blk_add_trace_zone_update_request, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_getrq;
 	ret = register_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug,
 						     NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_update_request;
 	ret = register_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug,
 						NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_plug;
 	ret = register_trace_block_plug(blk_add_trace_plug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_zone_unplug;
 	ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_plug;
 	ret = register_trace_block_split(blk_add_trace_split, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_unplug;
 	ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_split;
 	ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
-	WARN_ON(ret);
+	if (ret)
+		goto out_bio_remap;
+
+	return 0;
+
+out_bio_remap:
+	unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
+out_split:
+	unregister_trace_block_split(blk_add_trace_split, NULL);
+out_unplug:
+	unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
+out_plug:
+	unregister_trace_block_plug(blk_add_trace_plug, NULL);
+out_zone_unplug:
+	unregister_trace_blk_zone_wplug_bio(blk_add_trace_zone_unplug, NULL);
+out_zone_plug:
+	unregister_trace_disk_zone_wplug_add_bio(blk_add_trace_zone_plug, NULL);
+out_zone_update_request:
+	unregister_trace_blk_zone_append_update_request_bio(
+		blk_add_trace_zone_update_request, NULL);
+out_getrq:
+	unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
+out_bio_queue:
+	unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL);
+out_bio_frontmerge:
+	unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL);
+out_bio_backmerge:
+	unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL);
+out_bio_complete:
+	unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
+out_rq_complete:
+	unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
+out_rq_requeue:
+	unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL);
+out_rq_merge:
+	unregister_trace_block_rq_merge(blk_add_trace_rq_merge, NULL);
+out_rq_issue:
+	unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
+out_rq_insert:
+	unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
+	tracepoint_synchronize_unregister();
+out:
+	return ret;
 }
 
 static void blk_unregister_tracepoints(void)
@@ -1916,8 +2004,11 @@ static int blk_trace_setup_queue(struct request_queue *q,
 
 	blk_trace_setup_lba(bt, bdev);
 
+	ret = get_probe_ref();
+	if (ret)
+		goto free_bt;
+
 	rcu_assign_pointer(q->blk_trace, bt);
-	get_probe_ref();
 	return 0;
 
 free_bt:


Additional description of the patch:

The crash occurred because `blk_register_tracepoints()` used `WARN_ON(ret)` on `register_trace_*()` calls. Tracepoint registration functions allocate memory for probe arrays and can legitimately fail with `-ENOMEM` (e.g. under memory pressure or fault injection). Using `WARN_ON()` in this situation triggered kernel panics when `panic_on_warn` was set. Furthermore, ignoring the return value left tracepoints in a partially registered state, leading to subsequent warnings or errors during unregistration.

### Changes Made
1. **Error handling and rollback in `blk_register_tracepoints()`**:
   - Changed `blk_register_tracepoints()` to return an `int`.
   - Removed `WARN_ON(ret)` for all 18 tracepoints.
   - Added sequential error checks and a symmetric `goto` rollback path that unregisters previously registered tracepoints in reverse order and invokes `tracepoint_synchronize_unregister()` before returning the error code.

2. **Reference counter handling in `get_probe_ref()`**:
   - Changed `get_probe_ref()` to return an `int`.
   - If `blk_register_tracepoints()` fails when initializing the first probe reference (`blk_probes_ref == 1`), `blk_probes_ref` is decremented back to 0 before releasing `blk_probe_mutex` and propagating the error.

3. **Error propagation in `blk_trace_setup_finalize()`**:
   - Changed `blk_trace_setup_finalize()` to return an `int`.
   - Called `get_probe_ref()` before assigning `rcu_assign_pointer(q->blk_trace, bt)`.
   - Propagated the error code to the caller.

4. **Resource cleanup in setup callers**:
   - In `blk_trace_setup()`, `blk_trace_setup2()`, and `compat_blk_trace_setup()`, checked the return value of `blk_trace_setup_finalize()`. If setup fails, freed the allocated `blk_trace` structure using `blk_trace_free(q, bt)` and released debugfs locks before returning the error.
   - In `blk_trace_setup_queue()`, checked `get_probe_ref()` before assigning `q->blk_trace`, jumping to `free_bt` on failure.

Here are summaries of recent commits that touched the same files.
Format the summary line consistently with these, look how prefixes
are specified, letter capitalization, style, etc. 

blktrace: fix __this_cpu_read/write in preemptible context
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
blk-mq: use NOIO context to prevent deadlock during debugfs creation
blktrace: Make init_blk_tracer() asynchronous
block: don't use strcpy to copy blockdev name
tracing: Allow tracer to add more than 32 options
blktrace: add support for REQ_OP_WRITE_ZEROES tracing
blktrace: for ftrace use correct trace format ver
blktrace: use debug print to report dropped events
blktrace: handle BLKTRACESETUP2 ioctl
blktrace: trace zone write plugging operations
blktrace: expose ZONE APPEND completions to blktrace
blktrace: add block trace commands for zone operations
blktrace: move ftrace blk_io_tracer to blk_io_trace2
blktrace: move trace_note to blk_io_trace2
blktrace: differentiate between blk_io_trace versions
blktrace: add definitions for struct blk_io_trace2
blktrace: pass blk_user_trace2 to setup functions
blktrace: add definitions for blk_user_trace_setup2


Reply:
blktrace: handle tracepoint registration failures

In blk_register_tracepoints(), register_trace_*() functions are called with
WARN_ON(ret). Tracepoint registration allocates memory for probe arrays and
can legitimately fail with -ENOMEM under memory pressure. WARN_ON() must
not be used for conditions that can legitimately happen.

WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints
kernel/trace/blktrace.c:1332 [inline]
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470
kernel/trace/blktrace.c:492
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>

Furthermore, blk_register_tracepoints() ignores registration errors and
continues, leaving tracepoints in a partially registered state. When
blktrace is later stopped, blk_unregister_tracepoints() unconditionally
attempts to unregister all tracepoints, which fails with -ENOENT and
triggers an additional warning in tracepoint_remove_func().

Fix this by removing WARN_ON() and properly handling registration failures
in blk_register_tracepoints(). If any registration fails, unwinding is
performed by unregistering previously registered tracepoints in reverse
order, synchronizing tracepoint unregistration, and returning the error
code. In addition, propagate the error through get_probe_ref(),
blk_trace_setup_finalize(), and the setup entry points (blk_trace_setup(),
blk_trace_setup2(), compat_blk_trace_setup(), and blk_trace_setup_queue()),
properly cleaning up allocated resources on failure.

301/2 2026/08/31 22:10 llm description-generator
0m Model:
gemini-3.7-flash

Tokens:
							input: 11537
							output: 653
							thoughts: 3055
						

Thoughts:
**blktrace: handle tracepoint registration failures**

In `blk_register_tracepoints()`, `register_trace_*()` functions are called with `WARN_ON(ret)`. Tracepoint registration functions allocate memory for probe arrays and can legitimately fail with `-ENOMEM` under memory pressure. `WARN_ON()` must not be used for conditions that can legitimately happen.

```
WARNING: kernel/trace/blktrace.c:1332 at blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
WARNING: kernel/trace/blktrace.c:1332 at get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
RIP: 0010:blk_register_tracepoints kernel/trace/blktrace.c:1332 [inline]
RIP: 0010:get_probe_ref+0x377/0x470 kernel/trace/blktrace.c:492
Call Trace:
 <TASK>
 blk_trace_setup_queue kernel/trace/blktrace.c:1920 [inline]
 sysfs_blk_trace_attr_store+0xb1d/0x11e0 kernel/trace/blktrace.c:2116
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_64+0x155/0x510 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>
```

Furthermore, `blk_register_tracepoints()` ignores registration errors and continues, leaving tracepoints in a partially registered state. When blktrace is later stopped, `blk_unregister_tracepoints()` unconditionally attempts to unregister all tracepoints, which fails with `-ENOENT` and triggers an additional `WARN_ON_ONCE()` in `tracepoint_remove_func()`.

Fix this by removing `WARN_ON()` and properly handling registration failures in `blk_register_tracepoints()`. If any registration fails, previously registered tracepoints are unregistered in reverse order and the error code is returned. `get_probe_ref()`, `blk_trace_setup_finalize()`, and the blktrace setup entry points (`blk_trace_setup()`, `blk_trace_setup2()`, `compat_blk_trace_setup()`, and `blk_trace_setup_queue()`) are updated to propagate the error and clean up allocated resources.



LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)