From: jan.kiszka@domain.hid
To: xenomai@xenomai.org
Subject: [Xenomai-core] [PATCH 2/6] Improve fault report
Date: Mon, 26 Jun 2006 19:21:18 +0200 [thread overview]
Message-ID: <20060626172118.347530000@domain.hid> (raw)
In-Reply-To: 20060626172116.019532000@domain.hid
[-- Attachment #1: enhance-kernel-fault-report.patch --]
[-- Type: text/plain, Size: 2846 bytes --]
Introduce xnarch_fault_um() to test if a fault happened in user-mode and applies the new feature to report core and driver crashes more verbosely.
---
include/asm-generic/system.h | 5 +++++
include/asm-sim/system.h | 1 +
include/asm-uvm/system.h | 1 +
ksrc/nucleus/pod.c | 11 ++++++++++-
4 files changed, 17 insertions(+), 1 deletion(-)
Index: xenomai/include/asm-generic/system.h
===================================================================
--- xenomai.orig/include/asm-generic/system.h
+++ xenomai/include/asm-generic/system.h
@@ -35,6 +35,7 @@
#include <asm/uaccess.h>
#include <asm/param.h>
#include <asm/mmu_context.h>
+#include <asm/ptrace.h>
#include <linux/config.h>
#include <asm/xenomai/hal.h>
#include <asm/xenomai/atomic.h>
@@ -52,6 +53,10 @@
#define xnarch_trace_panic_freeze() rthal_trace_panic_freeze()
#define xnarch_trace_panic_dump() rthal_trace_panic_dump()
+#ifndef xnarch_fault_um
+#define xnarch_fault_um(fi) user_mode(fi->regs)
+#endif
+
#define module_param_value(parm) (parm)
typedef unsigned long spl_t;
Index: xenomai/include/asm-sim/system.h
===================================================================
--- xenomai.orig/include/asm-sim/system.h
+++ xenomai/include/asm-sim/system.h
@@ -56,6 +56,7 @@ typedef void *xnarch_fltinfo_t; /* Unuse
#define xnarch_fault_code(fi) 0
#define xnarch_fault_pc(fi) 0L
#define xnarch_fault_notify(fi) 1
+#define xnarch_fault_um(fi) 0
typedef int spl_t;
Index: xenomai/include/asm-uvm/system.h
===================================================================
--- xenomai.orig/include/asm-uvm/system.h
+++ xenomai/include/asm-uvm/system.h
@@ -192,6 +192,7 @@ typedef void *xnarch_fltinfo_t; /* Unuse
#define xnarch_fault_code(fi) 0
#define xnarch_fault_pc(fi) 0L
#define xnarch_fault_notify(fi) 1
+#define xnarch_fault_um(fi) 0
typedef struct xnarch_heapcb {
Index: xenomai/ksrc/nucleus/pod.c
===================================================================
--- xenomai.orig/ksrc/nucleus/pod.c
+++ xenomai/ksrc/nucleus/pod.c
@@ -194,7 +194,16 @@ static int xnpod_fault_handler(xnarch_fl
if (xnpod_shadow_p()) {
#ifdef CONFIG_XENO_OPT_DEBUG
- if (xnarch_fault_notify(fltinfo)) /* Don't report debug traps */
+ if (!xnarch_fault_um(fltinfo)) {
+ xnarch_trace_panic_freeze();
+ xnprintf
+ ("Switching %s to secondary mode after exception #%u in "
+ "kernel-space at 0x%lx (pid %d)\n", thread->name,
+ xnarch_fault_trap(fltinfo),
+ xnarch_fault_pc(fltinfo),
+ xnthread_user_pid(thread));
+ xnarch_trace_panic_dump();
+ } else if (xnarch_fault_notify(fltinfo)) /* Don't report debug traps */
xnprintf
("Switching %s to secondary mode after exception #%u from "
"user-space at 0x%lx (pid %d)\n", thread->name,
--
next prev parent reply other threads:[~2006-06-26 17:21 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 17:21 [Xenomai-core] [PATCH 0/6] Various refactoring and new IRQ test jan.kiszka
2006-06-26 17:21 ` [Xenomai-core] [PATCH 1/6] Refactor tracer API jan.kiszka
2006-06-26 17:21 ` jan.kiszka [this message]
2006-06-28 7:42 ` [Xenomai-core] [PATCH 2/6] Improve fault report Philippe Gerum
2006-06-28 7:51 ` Jan Kiszka
2006-06-28 8:04 ` Philippe Gerum
2006-06-28 8:18 ` Jan Kiszka
2006-06-28 8:36 ` Philippe Gerum
2006-06-28 8:51 ` Jan Kiszka
2006-06-28 9:00 ` Philippe Gerum
2006-06-28 9:17 ` Jan Kiszka
2006-06-28 16:36 ` Philippe Gerum
2006-06-26 17:21 ` [Xenomai-core] [PATCH 3/6] Refactor rttesting device interface jan.kiszka
2006-06-26 17:21 ` [Xenomai-core] [PATCH 4/6] Add prio switch to latency test jan.kiszka
2006-06-28 19:38 ` Jan Kiszka
2006-06-26 17:21 ` [Xenomai-core] [PATCH 5/6] Overread dev-prefix on posix open jan.kiszka
2006-06-28 19:38 ` Jan Kiszka
2006-06-26 17:21 ` [Xenomai-core] [PATCH 6/6] Introduce IRQ latency benchmark jan.kiszka
2006-06-27 16:45 ` Jan Kiszka
2006-06-28 12:11 ` Gilles Chanteperdrix
2006-06-28 12:28 ` Jan Kiszka
2006-06-28 12:35 ` Gilles Chanteperdrix
2006-06-28 13:42 ` Gilles Chanteperdrix
2006-06-28 14:14 ` Dmitry Adamushko
2006-06-28 14:37 ` Jan Kiszka
2006-06-28 15:18 ` Dmitry Adamushko
2006-06-28 14:44 ` Jan Kiszka
2006-06-28 19:39 ` Jan Kiszka
2006-06-29 11:20 ` Jan Kiszka
2006-07-01 15:38 ` Philippe Gerum
2006-07-01 18:17 ` Jan Kiszka
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=20060626172118.347530000@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.