1PRINTK(9)                        Driver Basics                       PRINTK(9)
2
3
4

NAME

6       printk - print a kernel message
7

SYNOPSIS

9       int printk(const char * fmt, ...);
10

ARGUMENTS

12       fmt
13           format string
14
15       ...
16           variable arguments
17

DESCRIPTION

19       This is printk. It can be called from any context. We want it to work.
20
21       We try to grab the console_lock. If we succeed, it's easy - we log the
22       output and call the console drivers. If we fail to get the semaphore,
23       we place the output into the log buffer and return. The current holder
24       of the console_sem will notice the new output in console_unlock; and
25       will send it to the consoles before releasing the lock.
26
27       One effect of this deferred printing is that code which calls printk
28       and then changes console_loglevel may break. This is because
29       console_loglevel is inspected when the actual printing occurs.
30

SEE ALSO

32       printf(3)
33
34       See the vsnprintf documentation for format string extensions over C99.
35
37Kernel Hackers Manual 3.10         June 2019                         PRINTK(9)
Impressum