linux-stable/kernel/trace
Joel Fernandes (Google) c3bc8fd637 tracing: Centralize preemptirq tracepoints and unify their usage
This patch detaches the preemptirq tracepoints from the tracers and
keeps it separate.

Advantages:
* Lockdep and irqsoff event can now run in parallel since they no longer
have their own calls.

* This unifies the usecase of adding hooks to an irqsoff and irqson
event, and a preemptoff and preempton event.
  3 users of the events exist:
  - Lockdep
  - irqsoff and preemptoff tracers
  - irqs and preempt trace events

The unification cleans up several ifdefs and makes the code in preempt
tracer and irqsoff tracers simpler. It gets rid of all the horrific
ifdeferry around PROVE_LOCKING and makes configuration of the different
users of the tracepoints more easy and understandable. It also gets rid
of the time_* function calls from the lockdep hooks used to call into
the preemptirq tracer which is not needed anymore. The negative delta in
lines of code in this patch is quite large too.

In the patch we introduce a new CONFIG option PREEMPTIRQ_TRACEPOINTS
as a single point for registering probes onto the tracepoints. With
this,
the web of config options for preempt/irq toggle tracepoints and its
users becomes:

 PREEMPT_TRACER   PREEMPTIRQ_EVENTS  IRQSOFF_TRACER PROVE_LOCKING
       |                 |     \         |           |
       \    (selects)    /      \        \ (selects) /
      TRACE_PREEMPT_TOGGLE       ----> TRACE_IRQFLAGS
                      \                  /
                       \ (depends on)   /
                     PREEMPTIRQ_TRACEPOINTS

Other than the performance tests mentioned in the previous patch, I also
ran the locking API test suite. I verified that all tests cases are
passing.

I also injected issues by not registering lockdep probes onto the
tracepoints and I see failures to confirm that the probes are indeed
working.

This series + lockdep probes not registered (just to inject errors):
[    0.000000]      hard-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.000000]      soft-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/12:FAILED|FAILED|  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/21:FAILED|FAILED|  ok  |
[    0.000000]          hard-safe-A + irqs-on/12:FAILED|FAILED|  ok  |
[    0.000000]          soft-safe-A + irqs-on/12:FAILED|FAILED|  ok  |
[    0.000000]          hard-safe-A + irqs-on/21:FAILED|FAILED|  ok  |
[    0.000000]          soft-safe-A + irqs-on/21:FAILED|FAILED|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |

With this series + lockdep probes registered, all locking tests pass:

[    0.000000]      hard-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.000000]      soft-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/12:  ok  |  ok  |  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/21:  ok  |  ok  |  ok  |
[    0.000000]          hard-safe-A + irqs-on/12:  ok  |  ok  |  ok  |
[    0.000000]          soft-safe-A + irqs-on/12:  ok  |  ok  |  ok  |
[    0.000000]          hard-safe-A + irqs-on/21:  ok  |  ok  |  ok  |
[    0.000000]          soft-safe-A + irqs-on/21:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |

Link: http://lkml.kernel.org/r/20180730222423.196630-4-joel@joelfernandes.org

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-07-31 11:32:27 -04:00
..
blktrace.c
bpf_trace.c bpf: guard bpf_get_current_cgroup_id() with CONFIG_CGROUPS 2018-06-04 21:52:26 +02:00
ftrace.c tracing: Remove orphaned function ftrace_nr_registered_ops() 2018-07-26 10:58:43 -04:00
Kconfig tracing: Centralize preemptirq tracepoints and unify their usage 2018-07-31 11:32:27 -04:00
Makefile tracing: Centralize preemptirq tracepoints and unify their usage 2018-07-31 11:32:27 -04:00
power-traces.c
preemptirq_delay_test.c tracing: preemptirq_delay_run() can be static 2018-07-27 17:58:34 -04:00
ring_buffer.c ring_buffer: tracing: Inherit the tracing setting to next ring buffer 2018-07-25 10:29:41 -04:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c ring_buffer: tracing: Inherit the tracing setting to next ring buffer 2018-07-25 10:29:41 -04:00
trace.h tracing: Remove orphaned function using_ftrace_ops_list_func(). 2018-07-26 10:53:05 -04:00
trace_benchmark.c rcu: Rename cond_resched_rcu_qs() to cond_resched_tasks_rcu_qs() 2018-05-15 10:27:29 -07:00
trace_benchmark.h
trace_branch.c
trace_clock.c tracing: Hide global trace clock from lockdep 2018-04-06 08:56:52 -04:00
trace_entries.h tracing: Add trigger file for trace_markers tracefs/ftrace/print 2018-05-29 08:28:53 -04:00
trace_event_perf.c perf/core: Fix perf_uprobe_init() 2018-04-10 07:33:10 +02:00
trace_events.c tracing: Do not show filter file for ftrace internal events 2018-05-29 08:28:46 -04:00
trace_events_filter.c tracing: Make create_filter() code match the comments 2018-07-03 18:14:40 -04:00
trace_events_filter_test.h
trace_events_hist.c tracing: Avoid string overflow 2018-07-03 18:14:39 -04:00
trace_events_trigger.c tracing: Make unregister_trigger() static 2018-07-26 10:50:18 -04:00
trace_export.c tracing: Add trigger file for trace_markers tracefs/ftrace/print 2018-05-29 08:28:53 -04:00
trace_functions.c
trace_functions_graph.c tracing: Fix missing return symbol in function_graph output 2018-07-03 18:47:11 -04:00
trace_hwlat.c
trace_irqsoff.c tracing: Centralize preemptirq tracepoints and unify their usage 2018-07-31 11:32:27 -04:00
trace_kdb.c
trace_kprobe.c selftest/ftrace: Move kprobe selftest function to separate compile unit 2018-07-30 18:41:04 -04:00
trace_kprobe_selftest.c selftest/ftrace: Move kprobe selftest function to separate compile unit 2018-07-30 18:41:04 -04:00
trace_kprobe_selftest.h selftest/ftrace: Move kprobe selftest function to separate compile unit 2018-07-30 18:41:04 -04:00
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Reorder display of TGID to be after PID 2018-07-12 19:56:25 -04:00
trace_output.h
trace_preemptirq.c tracing: Centralize preemptirq tracepoints and unify their usage 2018-07-31 11:32:27 -04:00
trace_printk.c treewide: Align function definition open/close braces 2018-03-26 11:13:09 +02:00
trace_probe.c
trace_probe.h Merge branch 'perf/urgent' into perf/core 2018-03-29 16:03:48 +02:00
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing: Fix the file mode of stack tracer 2018-05-03 11:58:05 -04:00
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c bpf: introduce bpf subcommand BPF_TASK_FD_QUERY 2018-05-24 18:18:19 -07:00
tracing_map.c treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
tracing_map.h