From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Daniel Bristot de Oliveira <daniel@bristot.me>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Andy Lutomirski <luto@kernel.org>,
Clark Williams <williams@redhat.com>,
x86@kernel.org
Subject: [PATCH 2/2] trace,x86: Add nmi to the irq_vectors class
Date: Mon, 17 Sep 2018 10:48:53 +0200 [thread overview]
Message-ID: <998ff6da1fe084c94cb7eedcee697b7ec1fbd66c.1537173660.git.bristot@redhat.com> (raw)
In-Reply-To: <461ac057690a58e05395d07d0e1994855bb3cd7d.1537173660.git.bristot@redhat.com>
Currently, the irq_vector class of tracepoints does not include the NMI
entry. The NMI was in the first set of tracepoints for IRQs, but it was
dropped off because of the logic of switching IDT when enabling trace[1].
However, as the switching IDT logic was removed [2], it is possible to add
the NMI tracepoints back.
The tracepoints looks like:
<idle>-0 [000] d.Z. 179.594315: nmi_entry: vector=2
<idle>-0 [000] d.Z. 179.594396: nmi_exit: vector=2
[1] trace,x86: irq vector tracepoint support
https://lwn.net/Articles/555465/
[2] commit 4b9a8dca0e58 ("x86/idt: Remove the tracing IDT completely")
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Clark Williams <williams@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: x86@kernel.org
---
arch/x86/include/asm/trace/irq_vectors.h | 5 +++++
arch/x86/kernel/nmi.c | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/arch/x86/include/asm/trace/irq_vectors.h b/arch/x86/include/asm/trace/irq_vectors.h
index bc9669df97c9..5b93e1a6b1fe 100644
--- a/arch/x86/include/asm/trace/irq_vectors.h
+++ b/arch/x86/include/asm/trace/irq_vectors.h
@@ -144,6 +144,11 @@ DEFINE_IRQ_VECTOR_EVENT(thermal_apic);
*/
DEFINE_IRQ_VECTOR_EVENT(external_interrupt);
+/*
+ * nmi - called when entering/exiting from nmi vector handler.
+ */
+DEFINE_IRQ_VECTOR_EVENT(nmi);
+
TRACE_EVENT(vector_config,
TP_PROTO(unsigned int irq, unsigned int vector,
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 18bc9b51ac9b..fa2d16b3af60 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -37,6 +37,8 @@
#define CREATE_TRACE_POINTS
#include <trace/events/nmi.h>
+#undef CREATE_TRACE_POINTS
+#include <asm/trace/irq_vectors.h>
struct nmi_desc {
raw_spinlock_t lock;
@@ -514,12 +516,14 @@ do_nmi(struct pt_regs *regs, long error_code)
#endif
nmi_enter();
+ trace_nmi_entry(2);
inc_irq_stat(__nmi_count);
if (!ignore_nmis)
default_do_nmi(regs);
+ trace_nmi_exit(2);
nmi_exit();
#ifdef CONFIG_X86_64
--
2.17.1
next prev parent reply other threads:[~2018-09-17 8:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 8:48 [PATCH 1/2] trace,x86: Add external_interrupts " Daniel Bristot de Oliveira
2018-09-17 8:48 ` Daniel Bristot de Oliveira [this message]
2018-09-17 10:18 ` [PATCH 2/2] trace,x86: Add nmi " kbuild test robot
2018-09-17 10:24 ` [PATCH 1/2] trace,x86: Add external_interrupts " kbuild test robot
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=998ff6da1fe084c94cb7eedcee697b7ec1fbd66c.1537173660.git.bristot@redhat.com \
--to=bristot@redhat.com \
--cc=daniel@bristot.me \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®