Added boolean "syslogOutput" parameter to flush_pending_repeats() so

that dprintf_no_syslog() can avoid sending something to the syslog.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28286 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-10-22 14:55:33 +00:00
parent 412319e8eb
commit 204b1f011b

View File

@ -78,7 +78,7 @@ static char sLastOutputBuffer[OUTPUT_BUFFER_SIZE];
static DebugOutputFilter* sDebugOutputFilter = NULL; static DebugOutputFilter* sDebugOutputFilter = NULL;
DefaultDebugOutputFilter gDefaultDebugOutputFilter; DefaultDebugOutputFilter gDefaultDebugOutputFilter;
static void flush_pending_repeats(void); static void flush_pending_repeats(bool syslogOutput);
static void check_pending_repeats(void *data, int iter); static void check_pending_repeats(void *data, int iter);
static int64 sMessageRepeatFirstTime = 0; static int64 sMessageRepeatFirstTime = 0;
@ -150,7 +150,7 @@ void
DefaultDebugOutputFilter::Print(const char* format, va_list args) DefaultDebugOutputFilter::Print(const char* format, va_list args)
{ {
vsnprintf(sOutputBuffer, OUTPUT_BUFFER_SIZE, format, args); vsnprintf(sOutputBuffer, OUTPUT_BUFFER_SIZE, format, args);
flush_pending_repeats(); flush_pending_repeats(sInDebugger == 0);
PrintString(sOutputBuffer); PrintString(sOutputBuffer);
} }
@ -1148,7 +1148,7 @@ debug_puts(const char *string, int32 length)
if (sMessageRepeatFirstTime == 0) if (sMessageRepeatFirstTime == 0)
sMessageRepeatFirstTime = sMessageRepeatLastTime; sMessageRepeatFirstTime = sMessageRepeatLastTime;
} else { } else {
flush_pending_repeats(); flush_pending_repeats(true);
if (sSerialDebugEnabled) if (sSerialDebugEnabled)
arch_debug_serial_puts(string); arch_debug_serial_puts(string);
@ -1387,7 +1387,7 @@ set_dprintf_enabled(bool newState)
//! Must be called with the sSpinlock held. //! Must be called with the sSpinlock held.
static void static void
flush_pending_repeats(void) flush_pending_repeats(bool syslogOutput)
{ {
if (sMessageRepeatCount <= 0) if (sMessageRepeatCount <= 0)
return; return;
@ -1399,7 +1399,7 @@ flush_pending_repeats(void)
if (sSerialDebugEnabled) if (sSerialDebugEnabled)
arch_debug_serial_puts(temp); arch_debug_serial_puts(temp);
if (sSyslogOutputEnabled) if (sSyslogOutputEnabled && syslogOutput)
syslog_write(temp, length); syslog_write(temp, length);
if (sBlueScreenEnabled || sDebugScreenEnabled) if (sBlueScreenEnabled || sDebugScreenEnabled)
blue_screen_puts(temp); blue_screen_puts(temp);
@ -1415,7 +1415,7 @@ flush_pending_repeats(void)
if (sSerialDebugEnabled) if (sSerialDebugEnabled)
arch_debug_serial_puts(sLastOutputBuffer); arch_debug_serial_puts(sLastOutputBuffer);
if (sSyslogOutputEnabled) if (sSyslogOutputEnabled && syslogOutput)
syslog_write(sLastOutputBuffer, length); syslog_write(sLastOutputBuffer, length);
if (sBlueScreenEnabled || sDebugScreenEnabled) if (sBlueScreenEnabled || sDebugScreenEnabled)
blue_screen_puts(sLastOutputBuffer); blue_screen_puts(sLastOutputBuffer);
@ -1443,7 +1443,7 @@ check_pending_repeats(void* /*data*/, int /*iteration*/)
cpu_status state = disable_interrupts(); cpu_status state = disable_interrupts();
acquire_spinlock(&sSpinlock); acquire_spinlock(&sSpinlock);
flush_pending_repeats(); flush_pending_repeats(true);
release_spinlock(&sSpinlock); release_spinlock(&sSpinlock);
restore_interrupts(state); restore_interrupts(state);
@ -1477,7 +1477,7 @@ dprintf_args(const char *format, va_list args, bool syslogOutput)
if (sMessageRepeatFirstTime == 0) if (sMessageRepeatFirstTime == 0)
sMessageRepeatFirstTime = sMessageRepeatLastTime; sMessageRepeatFirstTime = sMessageRepeatLastTime;
} else { } else {
flush_pending_repeats(); flush_pending_repeats(syslogOutput);
if (sSerialDebugEnabled) if (sSerialDebugEnabled)
arch_debug_serial_puts(sOutputBuffer); arch_debug_serial_puts(sOutputBuffer);