diff options
author | Kay Sievers <kay@vrfy.org> | 2012-07-16 21:35:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 21:35:30 -0400 |
commit | d39f3d77c9b1fe7cc33a14beb4a4849af0a4ac22 (patch) | |
tree | bf3a4fd34aa850a5f30f966dfd98a40a424f6b9a /Documentation/ABI | |
parent | 96efedf1491cdf0616e5e4fff0711cebf20f69c7 (diff) |
kmsg - export "continuation record" flag to /dev/kmsg
In some cases we are forced to store individual records for a continuation
line print.
Export a flag to allow the external re-construction of the line. The flag
allows us to apply a similar logic externally which is used internally when
the console, /proc/kmsg or the syslog() output is printed.
$ cat /dev/kmsg
4,165,0,-;Free swap = 0kB
4,166,0,-;Total swap = 0kB
6,167,0,c;[
4,168,0,+;0
4,169,0,+;1
4,170,0,+;2
4,171,0,+;3
4,172,0,+;]
6,173,0,-;[0 1 2 3 ]
6,174,0,-;Console: colour VGA+ 80x25
6,175,0,-;console [tty0] enabled
Signed-off-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/ABI')
-rw-r--r-- | Documentation/ABI/testing/dev-kmsg | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/Documentation/ABI/testing/dev-kmsg b/Documentation/ABI/testing/dev-kmsg index 281ecc5f9709..7e7e07a82e0e 100644 --- a/Documentation/ABI/testing/dev-kmsg +++ b/Documentation/ABI/testing/dev-kmsg | |||
@@ -58,16 +58,18 @@ Description: The /dev/kmsg character device node provides userspace access | |||
58 | 58 | ||
59 | The output format consists of a prefix carrying the syslog | 59 | The output format consists of a prefix carrying the syslog |
60 | prefix including priority and facility, the 64 bit message | 60 | prefix including priority and facility, the 64 bit message |
61 | sequence number and the monotonic timestamp in microseconds. | 61 | sequence number and the monotonic timestamp in microseconds, |
62 | The values are separated by a ','. Future extensions might | 62 | and a flag field. All fields are separated by a ','. |
63 | add more comma separated values before the terminating ';'. | 63 | |
64 | Unknown values should be gracefully ignored. | 64 | Future extensions might add more comma separated values before |
65 | the terminating ';'. Unknown fields and values should be | ||
66 | gracefully ignored. | ||
65 | 67 | ||
66 | The human readable text string starts directly after the ';' | 68 | The human readable text string starts directly after the ';' |
67 | and is terminated by a '\n'. Untrusted values derived from | 69 | and is terminated by a '\n'. Untrusted values derived from |
68 | hardware or other facilities are printed, therefore | 70 | hardware or other facilities are printed, therefore |
69 | all non-printable characters in the log message are escaped | 71 | all non-printable characters and '\' itself in the log message |
70 | by "\x00" C-style hex encoding. | 72 | are escaped by "\x00" C-style hex encoding. |
71 | 73 | ||
72 | A line starting with ' ', is a continuation line, adding | 74 | A line starting with ' ', is a continuation line, adding |
73 | key/value pairs to the log message, which provide the machine | 75 | key/value pairs to the log message, which provide the machine |
@@ -75,11 +77,11 @@ Description: The /dev/kmsg character device node provides userspace access | |||
75 | userspace. | 77 | userspace. |
76 | 78 | ||
77 | Example: | 79 | Example: |
78 | 7,160,424069;pci_root PNP0A03:00: host bridge window [io 0x0000-0x0cf7] (ignored) | 80 | 7,160,424069,-;pci_root PNP0A03:00: host bridge window [io 0x0000-0x0cf7] (ignored) |
79 | SUBSYSTEM=acpi | 81 | SUBSYSTEM=acpi |
80 | DEVICE=+acpi:PNP0A03:00 | 82 | DEVICE=+acpi:PNP0A03:00 |
81 | 6,339,5140900;NET: Registered protocol family 10 | 83 | 6,339,5140900,-;NET: Registered protocol family 10 |
82 | 30,340,5690716;udevd[80]: starting version 181 | 84 | 30,340,5690716,-;udevd[80]: starting version 181 |
83 | 85 | ||
84 | The DEVICE= key uniquely identifies devices the following way: | 86 | The DEVICE= key uniquely identifies devices the following way: |
85 | b12:8 - block dev_t | 87 | b12:8 - block dev_t |
@@ -87,4 +89,13 @@ Description: The /dev/kmsg character device node provides userspace access | |||
87 | n8 - netdev ifindex | 89 | n8 - netdev ifindex |
88 | +sound:card0 - subsystem:devname | 90 | +sound:card0 - subsystem:devname |
89 | 91 | ||
92 | The flags field carries '-' by default. A 'c' indicates a | ||
93 | fragment of a line. All following fragments are flagged with | ||
94 | '+'. Note, that these hints about continuation lines are not | ||
95 | neccessarily correct, and the stream could be interleaved with | ||
96 | unrelated messages, but merging the lines in the output | ||
97 | usually produces better human readable results. A similar | ||
98 | logic is used internally when messages are printed to the | ||
99 | console, /proc/kmsg or the syslog() syscall. | ||
100 | |||
90 | Users: dmesg(1), userspace kernel log consumers | 101 | Users: dmesg(1), userspace kernel log consumers |