[lkml]   [2017]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v7 0/2] tracing: Add trace events for preemption and irq disable/enable
These patches add trace events support for preempt and irq disable/enable

Here's an example of how Android's systrace will be using it to show atomic
sections as a gantt chart:
Other advantages of this initial work could be rewriting of preemptirqs off
tracer to use trace events, and replacing kprobes with tracepoint hooks for
these events in BPF samples (see samples/bpf/lathist_kern.c).

Changes since v6:
1. Drop the stop_critical_timings changes - previous patch was generating the
preempt_enable/disable events. Instead since we already have cpuidle trace
events, we can just rely on those for now to understand how much time was spent
in idle. A future patch could do something smarter.

2. Drop the per-cpu variable usage from trace_preempt_enable/disable.
The trace_preempt_enable/disable calls don't nest, so there's no need
to protect it with a per-cpu variable.

3. trace_irq_enable/disable on the other hand are called in this way,
so I added some comments about why per-cpu variable is needed.

Joel Fernandes (2):
tracing: Prepare to add preempt and irq trace events
tracing: Add support for preempt and irq enable/disable events

include/linux/ftrace.h | 3 +-
include/trace/events/preemptirq.h | 66 ++++++++++++++++++
kernel/trace/Kconfig | 9 +++
kernel/trace/Makefile | 1 +
kernel/trace/trace_irqsoff.c | 139 +++++++++++++++++++++++++++++++-------
5 files changed, 191 insertions(+), 27 deletions(-)
create mode 100644 include/trace/events/preemptirq.h

Links to earlier series:

Cc: Steven Rostedt <>
Cc: Peter Zilstra <>

 \ /
  Last update: 2017-09-29 23:22    [W:0.047 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site