History log of /fuchsia/zircon/kernel/lib/debuglog/debuglog.cpp
Revision Date Author Comments
# 8ac6f785 11-Sep-2018 Mohan Srinivasan <srmohan@google.com>

[kernel][debuglog] Fix serial print bypass knob.

This makes the knobs that bypass the debuglog (and force output to
serial console) apply only to kernel printf's. The 2 knobs in question
are the ENABLE_KERNEL_LL_DEBUG switch and the kernel.bypass-debuglog
cmdline switch. Making these knobs apply to userspace messages messes
up buffering completely, causing interleaving (and garbling) of
userspace messages.

Test: Was able to repro the garbling of userspace messages before
the fix. After the fix, I no longer see garbled userspace messages,
when using either the ENABLE_KERNEL_LL_DEBUG switch or the
kernel.bypass-debuglog cmdline switch. Tested on a NUC.

ZX-2600.

Change-Id: Ib25177c352a49252c3a8a8705e0dcf407e7cd9bd


# 048b4b3c 17-Aug-2018 Nick Maniscalco <maniscalco@google.com>

[kernel][heap] Don't use heap for thread stacks

Kernel stacks are now allocated by vm_allocate_kstack.

Thread creation no longer allows you to bring your own
stack. thread_create and thread_create_etc now always create a stack
of size DEFAULT_STACK_SIZE.

Remove THREAD_STACK_BOUNDS_CHECK feature as it has been subsumed by
guard pages provided by vm_allocate_kstack.

Test: verified no leaks using "k vmm kaspaces" and "k thread_tests"

ZX-2509 #done

Change-Id: I8dbde5c8a6852775b9796e0c7f963289291822b2


# a06521fe 16-Jul-2018 Mohan Srinivasan <srmohan@google.com>

[kernel][debuglog] Kernel param to print to serial

Add a kernel cmdline parameter (kernel.bypass-debuglog) which if set to
true, behaves exactly as enabling ENABLE_KERNEL_LL_DEBUG. setting the
former to true (or enabling the latter) forces prints to go straight to
the serial console (unbuffered, bypassing debuglog). The reason for
retaining the compile time switch is to control the behavior of prints
that might happen very early in boot, before cmdline is parsed. The
compile time switch overrides the kernel cmdline parameter, and
secondly, both of these settings have the side effect of disabling irq
driver uart tx. Later, we can investigate turning this into a switch
that we can enable/disable at run time (via devmgr perhaps), so we can
control buffering for kernel printfs after boot, if necessary.

Test: Added internal state in the uart drivers, examine that for various
scenarios (bypass-debuglog on and off), ENABLE_KERNEL_LL_DEBUG on, which
should override the kernel cmdline parameter. Also tested using the uart
bulk print tests.

ZX-2301.

Change-Id: I075836313a13ff33077180bd01ebdf40d11e46fc


# 3e16f410 20-Aug-2018 Mohan Srinivasan <srmohan@google.com>

Revert "[kernel][debuglog] Add a kernel cmdline parameter to force prints to serial console."

This reverts commit 5427fd8bea3a465778a91bf84d0515a83e40616f.

Reason for revert: Debug and fix a crash.

Original change's description:
> [kernel][debuglog] Add a kernel cmdline parameter to force prints to serial console.
>
> Add a kernel cmdline parameter (kernel.bypass-debuglog) which if set to
> true, behaves exactly as enabling ENABLE_KERNEL_LL_DEBUG. setting the
> former to true (or enabling the latter) forces prints to go straight to
> the serial console (unbuffered, bypassing debuglog). The reason for
> retaining the compile time switch is to control the behavior of prints
> that might happen very early in boot, before cmdline is parsed. The
> compile time switch overrides the kernel cmdline parameter, and
> secondly, both of these settings have the side effect of disabling irq
> driver uart tx. Later, we can investigate turning this into a switch
> that we can enable/disable at run time (via devmgr perhaps), so we can
> control buffering for kernel printfs after boot, if necessary.
>
> Test: Added internal state in the uart drivers, examine that for various
> scenarios (bypass-debuglog on and off), ENABLE_KERNEL_LL_DEBUG on, which
> should override the kernel cmdline parameter.
>
> ZX-2301.
>
> Change-Id: If14620511575d7dd6c3ed0347efbc412ec13a6d6

TBR=voydanoff@google.com,cpu@google.com,travisg@google.com,swetland@google.com,srmohan@google.com

Change-Id: Ie3883cba76347ab195ae3525696d35827ba08adf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true


# 5427fd8b 16-Jul-2018 Mohan Srinivasan <srmohan@google.com>

[kernel][debuglog] Add a kernel cmdline parameter to force prints to serial console.

Add a kernel cmdline parameter (kernel.bypass-debuglog) which if set to
true, behaves exactly as enabling ENABLE_KERNEL_LL_DEBUG. setting the
former to true (or enabling the latter) forces prints to go straight to
the serial console (unbuffered, bypassing debuglog). The reason for
retaining the compile time switch is to control the behavior of prints
that might happen very early in boot, before cmdline is parsed. The
compile time switch overrides the kernel cmdline parameter, and
secondly, both of these settings have the side effect of disabling irq
driver uart tx. Later, we can investigate turning this into a switch
that we can enable/disable at run time (via devmgr perhaps), so we can
control buffering for kernel printfs after boot, if necessary.

Test: Added internal state in the uart drivers, examine that for various
scenarios (bypass-debuglog on and off), ENABLE_KERNEL_LL_DEBUG on, which
should override the kernel cmdline parameter.

ZX-2301.

Change-Id: If14620511575d7dd6c3ed0347efbc412ec13a6d6


# e302c45d 26-Jul-2018 Nick Maniscalco <maniscalco@google.com>

[zircon][syscalls] Make zx_time_t and zx_duration_t signed types

This change is part of a hard transition and breaks the layers above.

zx_time_t and zx_duration_t are now int64_t. ZX_TIME_INFINITE is now
INT64_MAX.

A negative time value passed to a syscall is treated as any other time
value that's "in the past".

Test: CQ; new unit tests; built and ran topaz system on Eve

ZX-2100 #comment

Change-Id: I2a020cb2cf3dd7212608e24c1ee90cec58dd51ef


# a09408b5 14-Aug-2018 Nick Maniscalco <maniscalco@google.com>

[debuglog] Shutdown debuglog before shutting down system

Prior to this change, we'd sometimes miss the last several log
messages emitted shortly before shutdown. This was a problem for CQ/CI
tests. See INTK-281 for details.

Add function to shutdown the debuglog subsystem and join its
threads (dlog_shutdown).

Call dlog_shutdown as part of graceful shutdown path.

Change core-tests to print magic "success" string only once.

Test: Tested manually as follows:
- Ran on CQ, observed that core-tests now show full output.
- Inserted a panic after dlog_shutdown, verified panic is printed.

ZX-2489 #done

INTK-281 #comment dlog_shutdown

Change-Id: I99f6a61b6afcf6387c4ab28f70db8f33e13a308a


# 42c716a1 18-Jul-2018 Corey Tabaka <eieio@google.com>

[kernel] Port debuglog to C++.

TEST=Manual

Change-Id: I8d9c5a4c286c26179ae241db34304e3f4fb613e8