Skip to content

tracing: Add trace events for preemption and irq disable/enable

Joel Fernandes lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 4 repliesIn review
  2. v7 posting 2/22 patches 15 repliesSuperseded
  3. v7 posting 1/20 of 2 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v62 patches16 repliesSuperseded
v52 patches2 repliesSuperseded
v4 RFC3 patches2 repliesSuperseded

Changes in v8 from the cover letter

* Defining the tracepoints when they are unused gives a false impression to the user that the tracepoints are present but unused, for this reason:
- preempt toggle tracepoints are unused when CONFIG_PREEMPT_DEBUG is off, lets not define them.
- irq toggle tracepoints are unused when CONFIG_PROVE_LOCKING is on, lets not define them.
I think in future patches, we should also do the same to the irqsoff tracer since it can appear that the tracer is not working when the issue is hooks aren't called.
Also in future patches, we should unify the trace_hardirqs* paths of trace_irqsoff.c and lockdep.c and avoid duplication of the 2 paths - but I leave that for a future patch set as I don't want to disrupt the functionality of irqsoff tracer or lockdep in this patchset and increase the risk of breaking something else. I am focusing on getting the tracepoints in first in this set. Hope that's Ok.

* Clarified comment about per-CPU variable used for protection in trace_hardirqs_*

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tracing: Prepare to add preempt and irq trace eventskernel/trace/trace_irqsoff.c+74 -264 replies
2/2tracing: Add support for preempt and irq enable/disable eventsinclude/linux/ftrace.h include/trace/events/preemptirq.h kernel/trace/Kconfig +2 more+118 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH v8 0/2] tracing: Add trace events for preemption and irq disable/enable

These patches add trace events support for preempt and irq disable/enable events.

Here's an example of how Android's systrace will be using it to show atomic sections as a gantt chart: http://imgur.com/download/TZplEVp
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 v7:
* Defining the tracepoints when they are unused gives a false impression to the user that the tracepoints are present but unused, for this reason:
- preempt toggle tracepoints are unused when CONFIG_PREEMPT_DEBUG is off, lets not define them.
- irq toggle tracepoints are unused when CONFIG_PROVE_LOCKING is on, lets not define them.
I think in future patches, we should also do the same to the irqsoff tracer since it can appear that the tracer is not working when the issue is hooks aren't called.
Also in future patches, we should unify the trace_hardirqs* paths of trace_irqsoff.c and lockdep.c and avoid duplication of the 2 paths - but I leave that for a future patch set as I don't want to disrupt the functionality of irqsoff tracer or lockdep in this patchset and increase the risk of breaking something else. I am focusing on getting the tracepoints in first in this set. Hope that's Ok.

* Clarified comment about per-CPU variable used for protection in trace_hardirqs_*

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 |  70 ++++++++++++++++++++
 kernel/trace/Kconfig              |  11 ++++
 kernel/trace/Makefile             |   1 +
 kernel/trace/trace_irqsoff.c      | 133 ++++++++++++++++++++++++++++++--------
 5 files changed, 191 insertions(+), 27 deletions(-)
 create mode 100644 include/trace/events/preemptirq.h
Cc Steven Rostedt <[email protected]>
Cc Peter Zilstra <[email protected]>
Signature · 1 line
2.14.2.920.gcf0c67979c-goog