kernel: Print <DROP> at the beginning and not the end of dropped regions.
This way there is a better indication of where the drop occurred.
This commit is contained in:
@@ -1215,16 +1215,20 @@ syslog_sender(void* data)
|
|||||||
if (length > (int32)SYSLOG_MAX_MESSAGE_LENGTH)
|
if (length > (int32)SYSLOG_MAX_MESSAGE_LENGTH)
|
||||||
length = SYSLOG_MAX_MESSAGE_LENGTH;
|
length = SYSLOG_MAX_MESSAGE_LENGTH;
|
||||||
|
|
||||||
length = ring_buffer_peek(sSyslogBuffer, sSyslogBufferOffset,
|
uint8* message = (uint8*)sSyslogMessage->message;
|
||||||
(uint8*)sSyslogMessage->message, length);
|
|
||||||
sSyslogBufferOffset += length;
|
|
||||||
if (sSyslogDropped) {
|
if (sSyslogDropped) {
|
||||||
// Add drop marker - since parts had to be dropped, it's
|
memcpy(message, "<DROP>", 6);
|
||||||
// guaranteed that we have enough space in the buffer now.
|
message += 6;
|
||||||
ring_buffer_write(sSyslogBuffer, (uint8*)"<DROP>", 6);
|
if ((length + 6) > (int32)SYSLOG_MAX_MESSAGE_LENGTH)
|
||||||
|
length -= 6;
|
||||||
sSyslogDropped = false;
|
sSyslogDropped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
length = ring_buffer_peek(sSyslogBuffer, sSyslogBufferOffset,
|
||||||
|
message, length);
|
||||||
|
sSyslogBufferOffset += length;
|
||||||
|
length += (addr_t)message - (addr_t)sSyslogMessage->message;
|
||||||
|
|
||||||
release_spinlock(&sSpinlock);
|
release_spinlock(&sSpinlock);
|
||||||
restore_interrupts(state);
|
restore_interrupts(state);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user