* Write kernel debugger output to the syslog as well. This should make life

for people who cannot capture serial output easier.
* The syslog sender thread waits with timeout now, so output added to the
  syslog buffer without explicit notification is still written after a few
  seconds at the latest.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35883 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-03-16 19:36:54 +00:00
parent 085cf27b40
commit 3fded33493
+11 -2
View File
@@ -71,6 +71,8 @@ extern "C" int kgets(char* buffer, int length);
void call_modules_hook(bool enter);
static void syslog_write(const char* text, int32 length, bool notify);
int dbg_register_file[B_MAX_CPU_COUNT][14];
/* XXXmpetit -- must be made generic */
@@ -165,14 +167,18 @@ DebugOutputFilter::Print(const char* format, va_list args)
void
DefaultDebugOutputFilter::PrintString(const char* string)
{
size_t length = strlen(string);
if (sSerialDebugEnabled)
arch_debug_serial_puts(string);
if (sSyslogOutputEnabled)
syslog_write(string, length, false);
if (sBlueScreenEnabled || sDebugScreenEnabled)
blue_screen_puts(string);
for (uint32 i = 0; sSerialDebugEnabled && i < kMaxDebuggerModules; i++) {
if (sDebuggerModules[i] && sDebuggerModules[i]->debugger_puts)
sDebuggerModules[i]->debugger_puts(string, strlen(string));
sDebuggerModules[i]->debugger_puts(string, length);
}
}
@@ -1051,7 +1057,10 @@ syslog_sender(void* data)
while (true) {
// wait for syslog data to become available
acquire_sem(sSyslogNotify);
acquire_sem_etc(sSyslogNotify, 1, B_RELATIVE_TIMEOUT, 5000000);
// Note: We time out since in some situations output is added to
// the syslog buffer without being allowed to notify us (e.g. in
// the kernel debugger).
sSyslogMessage->when = real_time_clock();