acrn-kernel/kernel/trace
Jiri Olsa f3e9758286 bpf: Remove trace_printk_lock
commit e2bb9e01d5 upstream.

Both bpf_trace_printk and bpf_trace_vprintk helpers use static buffer guarded
with trace_printk_lock spin lock.

The spin lock contention causes issues with bpf programs attached to
contention_begin tracepoint [1][2].

Andrii suggested we could get rid of the contention by using trylock, but we
could actually get rid of the spinlock completely by using percpu buffers the
same way as for bin_args in bpf_bprintf_prepare function.

Adding new return 'buf' argument to struct bpf_bprintf_data and making
bpf_bprintf_prepare to return also the buffer for printk helpers.

  [1] https://lore.kernel.org/bpf/CACkBjsakT_yWxnSWr4r-0TpPvbKm9-OBmVUhJb7hV3hY8fdCkw@mail.gmail.com/
  [2] https://lore.kernel.org/bpf/CACkBjsaCsTovQHFfkqJKto6S4Z8d02ud1D7MPESrHa1cVNNTrw@mail.gmail.com/

Reported-by: Hao Sun <sunhao.th@gmail.com>
Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20221215214430.1336195-4-jolsa@kernel.org
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:12:51 +01:00
..
rv
Kconfig
Makefile
blktrace.c
bpf_trace.c bpf: Remove trace_printk_lock 2024-02-23 09:12:51 +01:00
bpf_trace.h
error_report-traces.c
fgraph.c
fprobe.c fprobe: Fix to ensure the number of active retprobes is not zero 2023-10-25 12:03:12 +02:00
ftrace.c
ftrace_internal.h
kprobe_event_gen_test.c
pid_list.c
pid_list.h
power-traces.c
preemptirq_delay_test.c
rethook.c rethook: Use __rcu pointer for rethook::handler 2023-12-13 18:39:17 +01:00
ring_buffer.c ring-buffer: Clean ring_buffer_poll_wait() error return 2024-02-23 09:12:42 +01:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c tracing / synthetic: Disable events after testing in synth_event_gen_test_init() 2024-01-01 12:39:07 +00:00
trace.c tracing: Inform kmemleak of saved_cmdlines allocation 2024-02-23 09:12:47 +01:00
trace.h tracing: Fix uaf issue when open the hist or hist_debug file 2024-01-20 11:50:07 +01:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c
trace_branch.c
trace_clock.c
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_eprobe.c
trace_event_perf.c
trace_events.c tracing: Have trace_event_file have ref counters 2023-11-28 17:07:23 +00:00
trace_events_filter.c tracing: Have trace_event_file have ref counters 2023-11-28 17:07:23 +00:00
trace_events_filter_test.h
trace_events_hist.c tracing: Fix uaf issue when open the hist or hist_debug file 2024-01-20 11:50:07 +01:00
trace_events_inject.c tracing: Have event inject files inc the trace array ref count 2023-09-23 11:11:11 +02:00
trace_events_synth.c tracing: Have the user copy of synthetic event address use correct context 2023-11-28 17:07:13 +00:00
trace_events_trigger.c tracing/trigger: Fix to return error if failed to alloc snapshot 2024-02-23 09:12:32 +01:00
trace_events_user.c
trace_export.c
trace_functions.c
trace_functions_graph.c
trace_hwlat.c tracing: Remove extra space at the end of hwlat_detector/mode 2023-09-13 09:42:57 +02:00
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing/kprobes: Fix symbol counting logic by looking at modules as well 2024-01-05 15:18:40 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c
trace_output.c tracing: Add size check when printing trace_marker output 2024-01-20 11:50:07 +01:00
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c
trace_probe.h tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols 2023-10-25 12:03:16 +02:00
trace_probe_kernel.h
trace_probe_tmpl.h
trace_recursion_record.c
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_synth.h
trace_syscalls.c
trace_uprobe.c
tracing_map.c tracing: Ensure visibility when inserting an element into tracing_map 2024-01-31 16:17:04 -08:00
tracing_map.h