Module: xenomai-forge Branch: next Commit: ae3a7e55d9202078cd70d1dc64c29b3baa2f70dc URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ae3a7e55d9202078cd70d1dc64c29b3baa2f70dc
Author: Philippe Gerum <r...@xenomai.org> Date: Thu Jun 26 11:44:34 2014 +0200 lib/cobalt, testsuite, demo: handle SIGDEBUG_LOCK_BREAK alert --- demo/alchemy/latency.c | 15 +++++++-------- lib/cobalt/assert_context.c | 2 +- testsuite/latency/latency.c | 15 +++++++-------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/demo/alchemy/latency.c b/demo/alchemy/latency.c index 9c31096..cfb894e 100644 --- a/demo/alchemy/latency.c +++ b/demo/alchemy/latency.c @@ -473,21 +473,20 @@ static void faulthand(int sig) #include <cobalt/uapi/syscall.h> static const char *reason_str[] = { - [SIGDEBUG_UNDEFINED] = "latency: received SIGDEBUG for unknown reason", + [SIGDEBUG_UNDEFINED] = "received SIGDEBUG for unknown reason", [SIGDEBUG_MIGRATE_SIGNAL] = "received signal", [SIGDEBUG_MIGRATE_SYSCALL] = "invoked syscall", [SIGDEBUG_MIGRATE_FAULT] = "triggered fault", [SIGDEBUG_MIGRATE_PRIOINV] = "affected by priority inversion", - [SIGDEBUG_NOMLOCK] = "Xenomai: process memory not locked " - "(missing mlockall?)", - [SIGDEBUG_WATCHDOG] = "Xenomai: watchdog triggered " - "(period too short?)", + [SIGDEBUG_NOMLOCK] = "process memory not locked", + [SIGDEBUG_WATCHDOG] = "watchdog triggered (period too short?)", + [SIGDEBUG_LOCK_BREAK] = "scheduler lock break", }; static void sigdebug(int sig, siginfo_t *si, void *context) { - const char fmt[] = "Mode switch detected (reason: %s), aborting.\n" - "Enable XENO_OPT_DEBUG_TRACE_RELAX to find the cause.\n"; + const char fmt[] = "%s, aborting.\n" + "(enabling CONFIG_XENO_OPT_DEBUG_TRACE_RELAX may help)\n"; unsigned int reason = si->si_value.sival_int; int n __attribute__ ((unused)); static char buffer[256]; @@ -504,7 +503,7 @@ static void sigdebug(int sig, siginfo_t *si, void *context) case SIGDEBUG_UNDEFINED: case SIGDEBUG_NOMLOCK: case SIGDEBUG_WATCHDOG: - n = snprintf(buffer, sizeof(buffer), "%s\n", + n = snprintf(buffer, sizeof(buffer), "latency: %s\n", reason_str[reason]); n = write(STDERR_FILENO, buffer, n); exit(EXIT_FAILURE); diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c index 54f2d52..6b49f3d 100644 --- a/lib/cobalt/assert_context.c +++ b/lib/cobalt/assert_context.c @@ -40,7 +40,7 @@ static void assert_nrt_inner(void) return; } - if (stat.status & XNTRAPSW) + if (stat.status & XNWARN) pthread_kill(pthread_self(), SIGDEBUG); } diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c index 6917f99..3c164ef 100644 --- a/testsuite/latency/latency.c +++ b/testsuite/latency/latency.c @@ -532,21 +532,20 @@ static void faulthand(int sig) #include <cobalt/uapi/syscall.h> static const char *reason_str[] = { - [SIGDEBUG_UNDEFINED] = "latency: received SIGDEBUG for unknown reason", + [SIGDEBUG_UNDEFINED] = "received SIGDEBUG for unknown reason", [SIGDEBUG_MIGRATE_SIGNAL] = "received signal", [SIGDEBUG_MIGRATE_SYSCALL] = "invoked syscall", [SIGDEBUG_MIGRATE_FAULT] = "triggered fault", [SIGDEBUG_MIGRATE_PRIOINV] = "affected by priority inversion", - [SIGDEBUG_NOMLOCK] = "Xenomai: process memory not locked " - "(missing mlockall?)", - [SIGDEBUG_WATCHDOG] = "Xenomai: watchdog triggered " - "(period too short?)", + [SIGDEBUG_NOMLOCK] = "process memory not locked", + [SIGDEBUG_WATCHDOG] = "watchdog triggered (period too short?)", + [SIGDEBUG_LOCK_BREAK] = "scheduler lock break", }; static void sigdebug(int sig, siginfo_t *si, void *context) { - const char fmt[] = "Mode switch detected (reason: %s), aborting.\n" - "Enable XENO_OPT_DEBUG_TRACE_RELAX to find the cause.\n"; + const char fmt[] = "%s, aborting.\n" + "(enabling CONFIG_XENO_OPT_DEBUG_TRACE_RELAX may help)\n"; unsigned int reason = sigdebug_reason(si); int n __attribute__ ((unused)); static char buffer[256]; @@ -558,7 +557,7 @@ static void sigdebug(int sig, siginfo_t *si, void *context) case SIGDEBUG_UNDEFINED: case SIGDEBUG_NOMLOCK: case SIGDEBUG_WATCHDOG: - n = snprintf(buffer, sizeof(buffer), "%s\n", + n = snprintf(buffer, sizeof(buffer), "latency: %s\n", reason_str[reason]); n = write(STDERR_FILENO, buffer, n); exit(EXIT_FAILURE); _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git