linux-stable/kernel/trace
Delyan Kratunov 9c2136be08 sched/tracing: Append prev_state to tp args instead
Commit fa2c3254d7 (sched/tracing: Don't re-read p->state when emitting
sched_switch event, 2022-01-20) added a new prev_state argument to the
sched_switch tracepoint, before the prev task_struct pointer.

This reordering of arguments broke BPF programs that use the raw
tracepoint (e.g. tp_btf programs). The type of the second argument has
changed and existing programs that assume a task_struct* argument
(e.g. for bpf_task_storage access) will now fail to verify.

If we instead append the new argument to the end, all existing programs
would continue to work and can conditionally extract the prev_state
argument on supported kernel versions.

Fixes: fa2c3254d7 (sched/tracing: Don't re-read p->state when emitting sched_switch event, 2022-01-20)
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lkml.kernel.org/r/c8a6930dfdd58a4a5755fc01732675472979732b.camel@fb.com
2022-05-12 00:37:11 +02:00
..
blktrace.c SCSI misc on 20220324 2022-03-24 19:37:53 -07:00
bpf_trace.c bpf: Fix sparse warnings in kprobe_multi_resolve_syms 2022-03-30 14:10:06 +02:00
bpf_trace.h
error_report-traces.c
fgraph.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
fprobe.c fprobe: Fix sparse warning for acccessing __rcu ftrace_hash 2022-03-28 19:05:40 -07:00
ftrace.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
ftrace_internal.h
Kconfig tracing: mark user_events as BROKEN 2022-04-02 10:32:14 -07:00
kprobe_event_gen_test.c
Makefile Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
pid_list.c tracing: Initialize upper and lower vars in pid_list_refill_irq() 2021-10-07 09:56:38 -04:00
pid_list.h tracing: Create a sparse bitmask for pid filtering 2021-10-05 17:38:45 -04:00
power-traces.c
preemptirq_delay_test.c
rethook.c rethook: Fix to use WRITE_ONCE() for rethook:: Handler 2022-03-30 19:28:17 -07:00
ring_buffer.c ring-buffer: make use of the helper function kthread_run_on_cpu() 2022-01-15 16:30:23 +02:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c Trace event fix of string verifier 2022-03-26 14:54:41 -07:00
trace.h Tracing updates for 5.18: 2022-03-23 11:40:25 -07:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c tracing: Fix missing trace_boot_init_histograms kstrdup NULL checks 2021-10-26 09:18:10 -04:00
trace_branch.c
trace_clock.c
trace_dynevent.c tracing: Disable "other" permission bits in the tracefs files 2021-10-08 18:08:43 -04:00
trace_dynevent.h tracing: Add DYNAMIC flag for dynamic events 2021-08-18 18:10:32 -04:00
trace_entries.h
trace_eprobe.c eprobes: Remove redundant event type information 2022-02-25 12:07:01 -05:00
trace_event_perf.c tracing: Show size of requested perf buffer 2021-10-27 12:25:09 -04:00
trace_events.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
trace_events_filter.c tracing: Add ustring operation to filtering string pointers 2022-01-14 03:42:24 -05:00
trace_events_filter_test.h
trace_events_hist.c Tracing updates for 5.18: 2022-03-23 11:40:25 -07:00
trace_events_inject.c tracing: Support __rel_loc relative dynamic data location attribute 2021-12-06 15:37:21 -05:00
trace_events_synth.c tracing: Fix strncpy warning in trace_events_synth.c 2022-03-11 11:49:24 -05:00
trace_events_trigger.c tracing: Uninline trace_trigger_soft_disabled() partly 2022-02-25 12:07:01 -05:00
trace_events_user.c tracing: mark user_events as BROKEN 2022-04-02 10:32:14 -07:00
trace_export.c
trace_functions.c ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
trace_functions_graph.c tracing: in_irq() cleanup 2021-10-13 18:19:41 -04:00
trace_hwlat.c trace/hwlat: make use of the helper function kthread_run_on_cpu() 2022-01-15 16:30:24 +02:00
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c kprobes: Use rethook for kretprobe if possible 2022-03-28 19:38:09 -07:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
trace_output.c tracing: Account bottom half disabled sections. 2022-01-13 16:23:04 -05:00
trace_output.h
trace_preemptirq.c
trace_printk.c tracing: Disable "other" permission bits in the tracefs files 2021-10-08 18:08:43 -04:00
trace_probe.c eprobes: Remove redundant event type information 2022-02-25 12:07:01 -05:00
trace_probe.h eprobes: Remove redundant event type information 2022-02-25 12:07:01 -05:00
trace_probe_tmpl.h tracing/probes: Have process_fetch_insn() take a void * instead of pt_regs 2021-08-19 09:09:03 -04:00
trace_recursion_record.c tracing: Disable "other" permission bits in the tracefs files 2021-10-08 18:08:43 -04:00
trace_sched_switch.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
trace_sched_wakeup.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
trace_selftest.c tracing: Fix selftest config check for function graph start up test 2022-02-25 21:05:29 -05:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing: Disable "other" permission bits in the tracefs files 2021-10-08 18:08:43 -04:00
trace_stat.c tracing: Disable "other" permission bits in the tracefs files 2021-10-08 18:08:43 -04:00
trace_stat.h
trace_synth.h tracing: synth events: increase max fields count 2021-09-08 15:29:16 -04:00
trace_syscalls.c tracing: Have syscall trace events use trace_event_buffer_lock_reserve() 2022-01-13 16:23:05 -05:00
trace_uprobe.c Tracing updates for 5.17: 2022-01-16 10:15:32 +02:00
tracing_map.c tracing: Fix a kmemleak false positive in tracing_map 2021-12-01 21:04:34 -05:00
tracing_map.h