From: Joel Fernandes <joelaf@google.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-team@android.com, Joel Fernandes <joelaf@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Peter Zilstra <peterz@infradead.org>
Subject: [PATCH v8 0/2] tracing: Add trace events for preemption and irq disable/enable
Date: Thu, 5 Oct 2017 17:54:30 -0700 [thread overview]
Message-ID: <20171006005432.14244-1-joelaf@google.com> (raw)
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 <rostedt@goodmis.org>
Cc: Peter Zilstra <peterz@infradead.org>
Cc: kernel-team@android.com
--
2.14.2.920.gcf0c67979c-goog
next reply other threads:[~2017-10-06 0:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 0:54 Joel Fernandes [this message]
2017-10-06 0:54 ` [PATCH v8 1/2] tracing: Prepare to add preempt and irq trace events Joel Fernandes
2017-10-10 22:19 ` Steven Rostedt
2017-10-10 22:32 ` Joel Fernandes
2017-10-10 22:44 ` Steven Rostedt
2017-10-10 22:54 ` Joel Fernandes
2017-10-06 0:54 ` [PATCH v8 2/2] tracing: Add support for preempt and irq enable/disable events Joel Fernandes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171006005432.14244-1-joelaf@google.com \
--to=joelaf@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox