Skip to main content
Kernel log messages are the primary source of information for diagnosing boot failures, driver problems, and runtime errors. This page covers how to get those messages out of the device: via serial console, early boot console, runtime log commands, and log-level control.

Serial console

The Qualcomm® Linux kernel uses the Qualcomm Generic Interface (GENI) serial driver to support the UART console on Qualcomm SoCs.

Required kernel configuration

Verify that the following Kconfig options are enabled:
If either is missing, enable them in the kernel defconfig or a .cfg fragment and rebuild.

Add the serial console to the kernel command line

Add the console= parameter to KERNEL_CMDLINE_EXTRA in meta-qcom/conf/machine/include/qcom-<SoC>.conf:

Connect hardware

Connect a USB-to-UART cable between the device and the host:
On the host, open the serial port at 115200 baud using any terminal emulator (minicom, screen, PuTTY, or Tera Term):
For upstream documentation, see Linux Serial Console.

Early boot messages (earlycon)

The earlycon kernel parameter enables a minimal early console before the full UART driver is initialised. It provides kernel messages from the very start of the boot sequence, including the unpack of the initramfs and early device tree processing, that would otherwise be invisible. Add to the kernel command line:
On Qualcomm SoCs the early console uses the same ttyMSM0 UART. Messages appear immediately from the first line of start_kernel().
earlycon and console=ttyMSM0,... are independent. Use both together to get uninterrupted output from early boot through the login prompt.

printk log levels

printk is the kernel’s logging function. Every message carries a log level that controls whether it appears on the console. Table: printk log levels Messages with a level numerically lower than the current console log level are printed to the console. The default console log level on Qualcomm Linux is 7 (all messages printed). With the default console log level of 7, messages at levels 0–6 (Emergency through Info) reach the console. Set the level to 8 to include debug output.

Runtime log level control

Read and set the console log level at runtime via /proc/sys/kernel/printk. The file contains four space-separated values: <current> <default> <minimum> <boot-time-default>.

Boot-time log level

Set the log level on the kernel command line to control verbosity before /proc is mounted:

Read the kernel log buffer

dmesg

The most common way to read the kernel ring buffer:

/proc/kmsg

virtual proc file that provides a live stream of kernel messages. Each read returns new messages only:

Persistent logs across reboots

On systems running systemd-journald, kernel messages are stored persistently and can be queried across boots:
On systems without journald, kernel messages may be written to syslog files:

Disable console logging

To silence the console for production or performance testing:
Alternatively, disable the early console drivers in Kconfig for a fully silent build:

Debug builds

To include debug symbols and extra debug Kconfig in the Yocto image, pass DEBUG_BUILD=1 to the bitbake invocation. This enables debug.config fragments in the kernel build:
Or add it permanently to build/conf/local.conf: