linux-stable/kernel/trace
Nikita Yushchenko 0878355b51 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: bce29ac9ce ("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>
2022-01-13 17:02:42 -05:00
..
blktrace.c block: don't call blk_status_to_errno in blk_update_request 2021-10-19 05:54:57 -06:00
bpf_trace.c bpf: Forbid bpf_ktime_get_coarse_ns and bpf_timer_* in tracing progs 2021-11-15 20:35:58 -08:00
bpf_trace.h
error_report-traces.c
fgraph.c x86/ftrace: Make function graph use ftrace directly 2021-10-20 23:44:43 -04:00
ftrace.c ftrace: Add test to make sure compiled time sorts work 2022-01-13 16:23:05 -05:00
ftrace_internal.h
Kconfig ftrace: Add test to make sure compiled time sorts work 2022-01-13 16:23:05 -05:00
kprobe_event_gen_test.c
Makefile tracing: Place trace_pid_list logic into abstract functions 2021-10-05 17:30:08 -04: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
ring_buffer.c ring-buffer: Protect ring_buffer_reset() from reentrancy 2021-11-10 11:56:29 -05:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c tracing: Account bottom half disabled sections. 2022-01-13 16:23:04 -05:00
trace.h tracing: Add helper functions to simplify event_command.parse() callback handling 2022-01-10 11:09:11 -05: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 tracing: Remove ops param from event_command reg()/unreg() callbacks 2022-01-10 11:09:11 -05:00
trace_event_perf.c tracing: Show size of requested perf buffer 2021-10-27 12:25:09 -04:00
trace_events.c tracing: Remove duplicate warnings when calling trace_create_file() 2022-01-13 17:02:42 -05:00
trace_events_filter.c tracing: Add test for user space strings when filtering on string pointers 2022-01-13 17:00:45 -05:00
trace_events_filter_test.h
trace_events_hist.c tracing: Remove ops param from event_command reg()/unreg() callbacks 2022-01-10 11:09:11 -05: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: Do not let synth_events block other dyn_event systems during create 2021-12-11 09:34:32 -05:00
trace_events_trigger.c tracing: Add helper functions to simplify event_command.parse() callback handling 2022-01-10 11:09:11 -05: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 tracing/hwlat: Make some internal symbols static 2021-10-26 09:18:28 -04:00
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing/kprobes: 'nmissed' not showed correctly for kretprobe 2022-01-13 17:02:42 -05:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails 2022-01-13 17:02:42 -05: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 tracing/probes: check the return value of kstrndup() for pbuf 2022-01-13 16:23:04 -05:00
trace_probe.h tracing: Add a probe that attaches to trace events 2021-08-20 14:18:40 -04: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
trace_sched_wakeup.c
trace_selftest.c tracing: Fix selftest config check for function graph start up test 2021-10-21 14:18:48 -04: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/uprobes: Check the return value of kstrdup() for tu->filename 2022-01-13 16:23:04 -05:00
tracing_map.c tracing: Fix a kmemleak false positive in tracing_map 2021-12-01 21:04:34 -05:00
tracing_map.h