linux/kernel/trace
Joel Granados 1751f872cc treewide: const qualify ctl_tables where applicable
Add the const qualifier to all the ctl_tables in the tree except for
watchdog_hardlockup_sysctl, memory_allocation_profiling_sysctls,
loadpin_sysctl_table and the ones calling register_net_sysctl (./net,
drivers/inifiniband dirs). These are special cases as they use a
registration function with a non-const qualified ctl_table argument or
modify the arrays before passing them on to the registration function.

Constifying ctl_table structs will prevent the modification of
proc_handler function pointers as the arrays would reside in .rodata.
This is made possible after commit 78eb4ea25c ("sysctl: treewide:
constify the ctl_table argument of proc_handlers") constified all the
proc_handlers.

Created this by running an spatch followed by a sed command:
Spatch:
    virtual patch

    @
    depends on !(file in "net")
    disable optional_qualifier
    @

    identifier table_name != {
      watchdog_hardlockup_sysctl,
      iwcm_ctl_table,
      ucma_ctl_table,
      memory_allocation_profiling_sysctls,
      loadpin_sysctl_table
    };
    @@

    + const
    struct ctl_table table_name [] = { ... };

sed:
    sed --in-place \
      -e "s/struct ctl_table .table = &uts_kern/const struct ctl_table *table = \&uts_kern/" \
      kernel/utsname_sysctl.c

Reviewed-by: Song Liu <song@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> # for kernel/trace/
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI
Reviewed-by: Darrick J. Wong <djwong@kernel.org> # xfs
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
2025-01-28 13:48:37 +01:00
..
rv verification/dot2k: Auto patch current kernel source 2024-12-27 14:39:35 -05:00
blktrace.c blktrace: remove redundant return at end of function 2024-12-23 08:17:23 -07:00
bpf_trace.c bpf-next-6.14 2025-01-23 08:04:07 -08:00
bpf_trace.h
error_report-traces.c
fgraph.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
fprobe.c fprobe: Add fprobe_header encoding feature 2024-12-26 10:50:05 -05:00
ftrace.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ftrace_internal.h
Kconfig fprobe: Rewrite fprobe on function-graph tracer 2024-12-26 10:50:05 -05:00
kprobe_event_gen_test.c
Makefile
pid_list.c pid: allow pid_max to be set per pid namespace 2024-12-02 11:25:25 +01:00
pid_list.h
power-traces.c
preemptirq_delay_test.c
rethook.c
ring_buffer.c ring-buffer: Do not allow events in NMI with generic atomic64 cmpxchg() 2025-01-21 15:19:00 -05:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c tracing updates for v6.14: 2025-01-23 17:51:16 -08:00
trace.h Remove calltime and rettime from fgraph infrastructure 2025-01-23 17:59:25 -08:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c
trace_branch.c
trace_btf.c
trace_btf.h
trace_clock.c
trace_dynevent.c tracing/string: Create and use __free(argv_free) in trace_dynevent.c 2024-12-26 10:38:37 -05:00
trace_dynevent.h
trace_entries.h fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_eprobe.c tracing/eprobe: Adopt guard() and scoped_guard() 2025-01-10 09:00:12 +09:00
trace_event_perf.c
trace_events.c tracing updates for v6.14: 2025-01-23 17:51:16 -08:00
trace_events_filter.c tracing: Switch trace_events_filter.c code over to use guard() 2024-12-26 10:38:37 -05:00
trace_events_filter_test.h
trace_events_hist.c tracing/hist: Support POLLPRI event for poll on histogram 2025-01-07 11:46:32 -05:00
trace_events_inject.c
trace_events_synth.c tracing: Switch trace_events_synth.c code over to use guard() 2024-12-26 10:38:37 -05:00
trace_events_trigger.c tracing: Switch trace_events_trigger.c code over to use guard() 2024-12-26 10:38:37 -05:00
trace_events_user.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
trace_export.c
trace_fprobe.c tracing: Adopt __free() and guard() for trace_fprobe.c 2025-01-16 21:27:07 -05:00
trace_functions.c ftrace: Do not find "true_parent" if HAVE_DYNAMIC_FTRACE_WITH_ARGS is not set 2024-12-16 17:22:26 -05:00
trace_functions_graph.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_hwlat.c
trace_irqsoff.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_kdb.c trace: kdb: Replace simple_strtoul with kstrtoul in kdb_ftdump 2024-11-02 08:33:13 +00:00
trace_kprobe.c tracing/kprobes: Simplify __trace_kprobe_create() by removing gotos 2025-01-10 09:01:14 +09:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c Runtime verifier and osnoise fixes for 6.14: 2025-01-26 14:19:45 -08:00
trace_output.c tracing: Check "%s" dereference via the field and not the TP_printk format 2024-12-17 11:40:11 -05:00
trace_output.h
trace_preemptirq.c tracing: Fix archs that still call tracepoints without RCU watching 2024-12-05 09:28:58 -05:00
trace_printk.c
trace_probe.c tracing: Use __free() in trace_probe for cleanup 2025-01-10 09:00:13 +09:00
trace_probe.h
trace_probe_kernel.h
trace_probe_tmpl.h tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS 2024-12-26 10:50:04 -05:00
trace_recursion_record.c
trace_sched_switch.c pid: allow pid_max to be set per pid namespace 2024-12-02 11:25:25 +01:00
trace_sched_wakeup.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_selftest.c fgraph: Pass ftrace_regs to retfunc 2024-12-26 10:50:03 -05:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing: Switch trace_stack.c code over to use guard() 2024-12-26 10:38:37 -05:00
trace_stat.c tracing: Switch trace_stat.c code over to use guard() 2024-12-26 10:38:37 -05:00
trace_stat.h
trace_synth.h
trace_syscalls.c
trace_uprobe.c tracing/uprobe: Adopt guard() and scoped_guard() 2025-01-10 09:00:12 +09:00
tracing_map.c tracing: Fix cmp_entries_dup() to respect sort() comparison rules 2024-12-04 10:38:24 -05:00
tracing_map.h