LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wink Saville <wink@saville.com>
To: linux-kernel@vger.kernel.org
Cc: Wink Saville <wink@saville.com>
Subject: [PATCH 3/3] Initialize and use trec_snapshot and trec_print_snapshot.
Date: Sat, 24 Mar 2007 16:51:39 -0700	[thread overview]
Message-ID: <1174780300775-git-send-email-wink@saville.com> (raw)
In-Reply-To: <11747803002933-git-send-email-wink@saville.com>

Trec's are initialized early in main.c and then dump
trec's in die(), panic() and do_page_fault().

Signed-off-by: Wink Saville <wink@saville.com>
---
 arch/x86_64/kernel/traps.c |    5 +++++
 arch/x86_64/mm/fault.c     |    6 ++++++
 init/main.c                |    4 ++++
 kernel/panic.c             |    5 +++++
 4 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 09d2e8a..b4f1a36 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -32,6 +32,7 @@
 #include <linux/unwind.h>
 #include <linux/uaccess.h>
 #include <linux/bug.h>
+#include <linux/trec.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -547,9 +548,13 @@ void die(const char * str, struct pt_regs * regs, long err)
 {
 	unsigned long flags = oops_begin();
 
+	trec_snapshot();
+
 	if (!user_mode(regs))
 		report_bug(regs->rip);
 
+	trec_print_snapshot();
+
 	__die(str, regs, err);
 	oops_end(flags);
 	do_exit(SIGSEGV); 
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 6ada723..e92f6bc 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/kprobes.h>
 #include <linux/uaccess.h>
+#include <linux/trec.h>
 
 #include <asm/system.h>
 #include <asm/pgalloc.h>
@@ -535,6 +536,8 @@ no_context:
 
 	flags = oops_begin();
 
+	trec_snapshot();
+
 	if (address < PAGE_SIZE)
 		printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
 	else
@@ -548,6 +551,9 @@ no_context:
 	__die("Oops", regs, error_code);
 	/* Executive summary in case the body of the oops scrolled away */
 	printk(KERN_EMERG "CR2: %016lx\n", address);
+	
+	trec_print_snapshot();
+
 	oops_end(flags);
 	do_exit(SIGKILL);
 
diff --git a/init/main.c b/init/main.c
index a92989e..46bc440 100644
--- a/init/main.c
+++ b/init/main.c
@@ -54,6 +54,7 @@
 #include <linux/lockdep.h>
 #include <linux/pid_namespace.h>
 #include <linux/device.h>
+#include <linux/trec.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -517,6 +518,9 @@ asmlinkage void __init start_kernel(void)
 	early_boot_irqs_off();
 	early_init_irq_lock_class();
 
+	trec_init();
+	TREC0();
+
 /*
  * Interrupts are still disabled. Do necessary setups, then
  * enable them
diff --git a/kernel/panic.c b/kernel/panic.c
index 623d182..52812f2 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -19,6 +19,7 @@
 #include <linux/nmi.h>
 #include <linux/kexec.h>
 #include <linux/debug_locks.h>
+#include <linux/trec.h>
 
 int panic_on_oops;
 int tainted;
@@ -66,6 +67,8 @@ NORET_TYPE void panic(const char * fmt, ...)
         unsigned long caller = (unsigned long) __builtin_return_address(0);
 #endif
 
+	trec_snapshot();
+
 	/*
 	 * It's possible to come here directly from a panic-assertion and not
 	 * have preempt disabled. Some functions called from here want
@@ -96,6 +99,8 @@ NORET_TYPE void panic(const char * fmt, ...)
 	smp_send_stop();
 #endif
 
+	trec_print_snapshot();
+
 	atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
 
 	if (!panic_blink)
-- 
1.5.0.rc2


  reply	other threads:[~2007-03-24 23:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 23:51 [PATCH 1/3] Documention for trace records (trec) Wink Saville
2007-03-24 23:51 ` [PATCH 2/3] Trec driver Wink Saville
2007-03-24 23:51   ` Wink Saville [this message]
2007-03-25 19:17   ` Randy Dunlap
2007-03-25 19:23 ` [PATCH 1/3] Documention for trace records (trec) Randy Dunlap
2007-03-27 15:19 ` Andi Kleen

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=1174780300775-git-send-email-wink@saville.com \
    --to=wink@saville.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 3/3] Initialize and use trec_snapshot and trec_print_snapshot.' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).