Skip to contentSkip to conversation

util-linux/sys-utils dmesg add PRINTK_CALLER support

PATCH New Edward Chron 1 participant 1 message Dec 28, 2023 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util-linux/sys-utils dmesg add PRINTK_CALLER support

Submission to Project: util-linux
Open Incident: #2609 at github.com/util-linux/util-linux/issues/2609
Component: util-linux/sys-utils
File: dmesg.c
Code level patch applied against: 2.39.3 - latest code pulled from
git.github.com:util-linux/util-linux.git
Revision: #1 on 2023/12/08 per Review from Karel Zak
Revision: #2 on 2023/12/12 Adjust line offsets for master update and
Add caller_id_size init to dmesg -K
Revision: #3 on 2023/12/12 Use of sizeof for cidbuf and limit search
for caller_id to dmesg prefix to msg text
Revision: #4 on 2023/12/15 Ensure SYSLOG and kmsg inputs have
caller_id_size set appropriately
Revision: #5 on 2023/12/24 Make caller_id width consistent with
makedumpfile

Add support to standard dmesg command for the optional Linux Kernel debug CONFIG option PRINTK_CALLER which adds an optional dmesg field that contains the Thread Id or CPU Id that is issuing the printk to add the message to the kernel ring buffer. This makes debugging simpler as dmesg entries for a specific thread or CPU can be recognized.

The dmesg -S using the old syslog interface supports printing the PRINTK_CALLER field but currently standard dmesg does not support printing the field if present. There are utilities that use dmesg and so it would be optimal if dmesg supported PRINTK_CALLER as well.

The additional field provided by PRINTK_CALLER is only present if it was configured for the Linux kernel where the dmesg command is run. It is a debug option and not configured by default so the dmesg output will only change for those kernels where the option was configured when the kernel was built. For users who went to the trouble to configure PRINTK_CALLER and have the extra field available for debugging, having dmesg print the field is very helpful.

Size of the PRINTK_CALLER field is determined by the maximum number tasks that can be run on the system which is limited by the value of /proc/sys/kernel/pid_max as pid values are from 0 to value - 1. This value determines the number of id digits needed by the caller id. The PRINTK_CALLER field is printed as T<id> for a Task Id or C<id> for a CPU Id for a printk in CPU context. The values are left space
padded and enclosed in parentheses such as: [ T123] or [ C16]

For consistency with dmesg -S which supports the PRINTK_CALLER field the field is printed followed by a space. For JSON format output the PRINTK_CALLER field is identified as caller as that is consistent with it's naming in /dev/kmsg. No space padding is used to reduce space consumed by the JSON output. So the output from the command on a system with PRINTK_CALLER field enabled in the Linux .config file the dmesg output appears as:

Quoted 1 line

dmesg

...

[  520.897104] [   T3919] usb 3-3: Product: USB 2.0 Hub

and

Quoted 1 line

dmesg -x

...
kern :info : [ 520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub

and

Quoted 1 line

dmesg -J

...

      },{
         "pri": 6,
         "time":    520.897104,
         "caller": "T3919",
         "msg": "usb 3-3: Product: USB 2.0 Hub"
      },{

and

Quoted 1 line

dmesg -J -x

...

      },{
         "fac": "kern",
         "pri": "info",
         "time":   520.897104,
         "caller": "T3919",
         "msg": "usb 3-3: Product: USB 2.0 Hub"
      },{
Quoted 1 line

For comparison:

Quoted 1 line

dmesg -S

...

[  520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub

and

Quoted 1 line

dmesg -S -x

...
kern :info : [ 520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub

Note: When dmesg uses the old syslog interface the reserved space for
the PRINTK_CALLER field is capped at 5 digits because 32-bit kernels are capped at 32768 as the max number of PIDs. However, 64-bit systems are currently capped at 2^22 PIDs (0 - 4194303). The PID cap is set by PID_MAX_LIMIT but the system limit can be less so we use /proc/sys/kernel/pid_max to determine the size needed to hold the maximum PID value size for the current system. Many 64-bit systems support 2^22 PIDs (0 - 4194303) and you see:

Quoted 1 line

dmesg -x

...
kern :info : [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found
...

kern  :info  : [ 9830.456898] [  T98982] cgroup: fork rejected by pids ...
kern  :info  : [14301.158878] [ T137336] cgroup: fork rejected by pids ...
kern  :info  : [18980.803190] [T1637865] cgroup: fork rejected by pids ...
Quoted 1 line

dmesg -S -x

...
kern :info : [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found
...

kern  :info  : [ 9830.456898] [T98982] cgroup: fork rejected by pids ...
kern  :info  : [14301.158878] [T137336] cgroup: fork rejected by pids ...
kern  :info  : [18980.803190] [T1637865] cgroup: fork rejected by pids ...

This is the only difference seen with PRINTK_CALLER configured and printing between the dmesg /dev/kmsg interface and the dmesg -S syslog interface.

---
 include/pathnames.h                           |   3 +
 sys-utils/dmesg.c                             | 128 ++++-
 .../expected/dmesg/colors-kmsg-printk-caller  |  22 +
 .../dmesg/console-levels-kmsg-printk-caller   |  45 ++
 .../expected/dmesg/decode-kmsg-printk-caller  |  22 +
 tests/expected/dmesg/delta-kmsg-printk-caller |  22 +
 .../dmesg/facilities-kmsg-printk-caller       |  22 +
 .../dmesg/indentation-kmsg-printk-caller      |  28 +
 tests/expected/dmesg/json-kmsg-printk-caller  | 115 ++++
 .../expected/dmesg/json-syslog-printk-caller  | 530 ++++++++++++++++++
 tests/expected/dmesg/kmsg-file-printk-caller  | 115 ++++
 tests/expected/dmesg/limit-kmsg-printk-caller |  11 +
 tests/ts/dmesg/colors-kmsg-printk-caller      |  29 +
 .../dmesg/console-levels-kmsg-printk-caller   |  36 ++
 tests/ts/dmesg/decode-kmsg-printk-caller      |  28 +
 tests/ts/dmesg/delta-kmsg-printk-caller       |  28 +
 tests/ts/dmesg/facilities-kmsg-printk-caller  |  30 +
 tests/ts/dmesg/indentation-kmsg-printk-caller |  40 ++
 tests/ts/dmesg/input-syslog-printk-caller     | 105 ++++
 tests/ts/dmesg/json-kmsg-printk-caller        |  28 +
 tests/ts/dmesg/json-syslog-printk-caller      |  28 +
 tests/ts/dmesg/kmsg-file-printk-caller        |  28 +
 tests/ts/dmesg/kmsg-input-printk-caller       | Bin 0 -> 2187 bytes
 tests/ts/dmesg/limit-kmsg-printk-caller       |  29 +
 tests/ts/dmesg/newlines-kmsg-printk-caller    | Bin 0 -> 152 bytes
 25 files changed, 1469 insertions(+), 3 deletions(-)
 create mode 100644 tests/expected/dmesg/colors-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/console-levels-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/decode-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/delta-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/facilities-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/indentation-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/json-kmsg-printk-caller
 create mode 100644 tests/expected/dmesg/json-syslog-printk-caller
 create mode 100644 tests/expected/dmesg/kmsg-file-printk-caller
 create mode 100644 tests/expected/dmesg/limit-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/colors-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/console-levels-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/decode-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/delta-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/facilities-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/indentation-kmsg-printk-caller
 create mode 100644 tests/ts/dmesg/input-syslog-printk-caller
 create mode 100755 tests/ts/dmesg/json-kmsg-printk-caller
 create mode 100755 tests/ts/dmesg/json-syslog-printk-caller
 create mode 100755 tests/ts/dmesg/kmsg-file-printk-caller
 create mode 100644 tests/ts/dmesg/kmsg-input-printk-caller
 create mode 100755 tests/ts/dmesg/limit-kmsg-printk-caller
 create mode 100644 tests/ts/dmesg/newlines-kmsg-printk-caller
include/pathnames.h +3 -0
index caf0e63d4..81fa405f6 100644
@@ -230,4 +230,7 @@
 /* cgroup path */
 #define _PATH_SYS_CGROUP	"/sys/fs/cgroup"
 
+/* Maximum number of PIDs system supports */
+#define _PATH_PROC_PIDMAX	"/proc/sys/kernel/pid_max"
+
 #endif /* PATHNAMES_H */
sys-utils/dmesg.c +125 -3

223 lines not on this page · raw message

tests/expected/dmesg/colors-kmsg-printk-caller new file +22 -0
new file mode 100644
index 000000000..c7bf6e8b7
@@ -0,0 +1,22 @@
+kern  :notice: [    0.000000] [     T0] Linux version 6.6.4-arch1-1 (linux@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Mon, 04 Dec 2023 00:29:19 +0000
+kern  :info  : [    0.000000] [     T1] Command line: initrd=\ucode.img initrd=\initramfs-linux.img rw cryptdevice=/dev/nvme0n1p3:system:discard root=/dev/mapper/system
+kern  :info  : [    0.000000] [     T2] BIOS-provided physical RAM map:
+kern  :info  : [    0.000000] [     T3] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
+kern  :info  : [    0.000000] [     T4] BIOS-e820: [mem 0x000000000009f000-0x00000000000bffff] reserved
+kern  :info  : [    0.000000] [     T5] BIOS-e820: [mem 0x0000000000100000-0x0000000009afffff] usable
+kern  :info  : [    0.000000] [     T6] BIOS-e820: [mem 0x0000000009b00000-0x0000000009dfffff] reserved
+kern  :info  : [    0.000000] [     T7] BIOS-e820: [mem 0x0000000009e00000-0x0000000009efffff] usable
+kern  :info  : [    0.000000] [     T8] BIOS-e820: [mem 0x0000000009f00000-0x0000000009f3bfff] ACPI NVS
+kern  :info  : [    0.000000] [     T9] BIOS-e820: [mem 0x0000000009f3c000-0x000000004235ffff] usable
+kern  :info  : [    0.000000] [    T10] BIOS-e820: [mem 0x0000000042360000-0x000000004455ffff] reserved
+kern  :info  : [    0.367657] [    T11] ACPI: \_SB_.PCI0.GP19.NHI1.PWRS: New power resource
+kern  :info  : [    0.368615] [    T12] ACPI: \_SB_.PCI0.GP19.XHC4.PWRS: New power resource
+kern  :info  : [    0.376316] [    T13] ACPI: \_SB_.PRWL: New power resource
+kern  :info  : [    0.376343] [    T14] ACPI: \_SB_.PRWB: New power resource
+kern  :info  : [    0.377373] [    T15] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
+kern  :info  : [    0.377378] [    T16] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
+kern  :info  : [    0.377569] [    T17] acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug AER]
+kern  :info  : [    0.377933] [    T18] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability LTR DPC]
+kern  :info  : [    0.378458] [    T19] PCI host bridge to bus 0000:00
+kern  :info  : [    0.378459] [    T20] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
+kern  :info  : [    0.378461] [    T21] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
tests/expected/dmesg/console-levels-kmsg-printk-caller new file +45 -0

45 lines not on this page · raw message

tests/expected/dmesg/decode-kmsg-printk-caller new file +22 -0
new file mode 100644
index 000000000..78c363389
@@ -0,0 +1,22 @@
+kern  :notice: [    0.000000] [     T0] Linux version 6.6.4-arch1-1 (linux@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Mon, 04 Dec 2023 00:29:19 +0000
+kern  :info  : [    0.000000] [     T1] Command line: initrd=\ucode.img initrd=\initramfs-linux.img rw cryptdevice=/dev/nvme0n1p3:system:discard root=/dev/mapper/system
+kern  :info  : [    0.000000] [     T2] BIOS-provided physical RAM map:
+kern  :info  : [    0.000000] [     T3] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
+kern  :info  : [    0.000000] [     T4] BIOS-e820: [mem 0x000000000009f000-0x00000000000bffff] reserved
+kern  :info  : [    0.000000] [     T5] BIOS-e820: [mem 0x0000000000100000-0x0000000009afffff] usable
+kern  :info  : [    0.000000] [     T6] BIOS-e820: [mem 0x0000000009b00000-0x0000000009dfffff] reserved
+kern  :info  : [    0.000000] [     T7] BIOS-e820: [mem 0x0000000009e00000-0x0000000009efffff] usable
+kern  :info  : [    0.000000] [     T8] BIOS-e820: [mem 0x0000000009f00000-0x0000000009f3bfff] ACPI NVS
+kern  :info  : [    0.000000] [     T9] BIOS-e820: [mem 0x0000000009f3c000-0x000000004235ffff] usable
+kern  :info  : [    0.000000] [    T10] BIOS-e820: [mem 0x0000000042360000-0x000000004455ffff] reserved
+kern  :info  : [    0.367657] [    T11] ACPI: \_SB_.PCI0.GP19.NHI1.PWRS: New power resource
+kern  :info  : [    0.368615] [    T12] ACPI: \_SB_.PCI0.GP19.XHC4.PWRS: New power resource
+kern  :info  : [    0.376316] [    T13] ACPI: \_SB_.PRWL: New power resource
+kern  :info  : [    0.376343] [    T14] ACPI: \_SB_.PRWB: New power resource
+kern  :info  : [    0.377373] [    T15] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
+kern  :info  : [    0.377378] [    T16] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
+kern  :info  : [    0.377569] [    T17] acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug AER]
+kern  :info  : [    0.377933] [    T18] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability LTR DPC]
+kern  :info  : [    0.378458] [    T19] PCI host bridge to bus 0000:00
+kern  :info  : [    0.378459] [    T20] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
+kern  :info  : [    0.378461] [    T21] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
tests/expected/dmesg/delta-kmsg-printk-caller new file +22 -0
new file mode 100644
index 000000000..892d2dcea
@@ -0,0 +1,22 @@
+[    0.000000 <    0.000000>] [     T0] Linux version 6.6.4-arch1-1 (linux@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Mon, 04 Dec 2023 00:29:19 +0000
+[    0.000000 <    0.000000>] [     T1] Command line: initrd=\ucode.img initrd=\initramfs-linux.img rw cryptdevice=/dev/nvme0n1p3:system:discard root=/dev/mapper/system
+[    0.000000 <    0.000000>] [     T2] BIOS-provided physical RAM map:
+[    0.000000 <    0.000000>] [     T3] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
+[    0.000000 <    0.000000>] [     T4] BIOS-e820: [mem 0x000000000009f000-0x00000000000bffff] reserved
+[    0.000000 <    0.000000>] [     T5] BIOS-e820: [mem 0x0000000000100000-0x0000000009afffff] usable
+[    0.000000 <    0.000000>] [     T6] BIOS-e820: [mem 0x0000000009b00000-0x0000000009dfffff] reserved
+[    0.000000 <    0.000000>] [     T7] BIOS-e820: [mem 0x0000000009e00000-0x0000000009efffff] usable
+[    0.000000 <    0.000000>] [     T8] BIOS-e820: [mem 0x0000000009f00000-0x0000000009f3bfff] ACPI NVS
+[    0.000000 <    0.000000>] [     T9] BIOS-e820: [mem 0x0000000009f3c000-0x000000004235ffff] usable
+[    0.000000 <    0.000000>] [    T10] BIOS-e820: [mem 0x0000000042360000-0x000000004455ffff] reserved
+[    0.367657 <    0.000000>] [    T11] ACPI: \_SB_.PCI0.GP19.NHI1.PWRS: New power resource
+[    0.368615 <    0.000000>] [    T12] ACPI: \_SB_.PCI0.GP19.XHC4.PWRS: New power resource
+[    0.376316 <    0.000000>] [    T13] ACPI: \_SB_.PRWL: New power resource
+[    0.376343 <    0.000000>] [    T14] ACPI: \_SB_.PRWB: New power resource
+[    0.377373 <    0.000000>] [    T15] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
+[    0.377378 <    0.000000>] [    T16] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
+[    0.377569 <    0.000000>] [    T17] acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug AER]
+[    0.377933 <    0.000000>] [    T18] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability LTR DPC]
+[    0.378458 <    0.000000>] [    T19] PCI host bridge to bus 0000:00
+[    0.378459 <    0.000000>] [    T20] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
+[    0.378461 <    0.000000>] [    T21] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
tests/expected/dmesg/facilities-kmsg-printk-caller new file +22 -0
new file mode 100644
index 000000000..78c363389
@@ -0,0 +1,22 @@
+kern  :notice: [    0.000000] [     T0] Linux version 6.6.4-arch1-1 (linux@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Mon, 04 Dec 2023 00:29:19 +0000
+kern  :info  : [    0.000000] [     T1] Command line: initrd=\ucode.img initrd=\initramfs-linux.img rw cryptdevice=/dev/nvme0n1p3:system:discard root=/dev/mapper/system
+kern  :info  : [    0.000000] [     T2] BIOS-provided physical RAM map:
+kern  :info  : [    0.000000] [     T3] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
+kern  :info  : [    0.000000] [     T4] BIOS-e820: [mem 0x000000000009f000-0x00000000000bffff] reserved
+kern  :info  : [    0.000000] [     T5] BIOS-e820: [mem 0x0000000000100000-0x0000000009afffff] usable
+kern  :info  : [    0.000000] [     T6] BIOS-e820: [mem 0x0000000009b00000-0x0000000009dfffff] reserved
+kern  :info  : [    0.000000] [     T7] BIOS-e820: [mem 0x0000000009e00000-0x0000000009efffff] usable
+kern  :info  : [    0.000000] [     T8] BIOS-e820: [mem 0x0000000009f00000-0x0000000009f3bfff] ACPI NVS
+kern  :info  : [    0.000000] [     T9] BIOS-e820: [mem 0x0000000009f3c000-0x000000004235ffff] usable
+kern  :info  : [    0.000000] [    T10] BIOS-e820: [mem 0x0000000042360000-0x000000004455ffff] reserved
+kern  :info  : [    0.367657] [    T11] ACPI: \_SB_.PCI0.GP19.NHI1.PWRS: New power resource
+kern  :info  : [    0.368615] [    T12] ACPI: \_SB_.PCI0.GP19.XHC4.PWRS: New power resource
+kern  :info  : [    0.376316] [    T13] ACPI: \_SB_.PRWL: New power resource
+kern  :info  : [    0.376343] [    T14] ACPI: \_SB_.PRWB: New power resource
+kern  :info  : [    0.377373] [    T15] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
+kern  :info  : [    0.377378] [    T16] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
+kern  :info  : [    0.377569] [    T17] acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug AER]
+kern  :info  : [    0.377933] [    T18] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability LTR DPC]
+kern  :info  : [    0.378458] [    T19] PCI host bridge to bus 0000:00
+kern  :info  : [    0.378459] [    T20] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
+kern  :info  : [    0.378461] [    T21] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
tests/expected/dmesg/indentation-kmsg-printk-caller new file +28 -0
new file mode 100644
index 000000000..47ad73f27
@@ -0,0 +1,28 @@
+[    0.000000] [     T0] line zero
+[    1.000000] [     T1] new
+[    2.000000] [     T2] two
+[    3.000000] [     T3] three
+kern  :notice: [    0.000000] [     T0] line zero
+user  :crit  : [    1.000000] [     T1] new
+mail  :warn  : [    2.000000] [     T2] two
+daemon:info  : [    3.000000] [     T3] three
+[<    0.000000>] [     T0] line zero
+[<    0.000000>] [     T1] new
+[<    1.000000>] [     T2] two
+[<    1.000000>] [     T3] three
+[     T0] line zero
+[     T1] new
+[     T2] two
+[     T3] three
+[Feb13 23:31] [     T0] line zero
+[  +0.000000] [     T1] new
+[  +1.000000] [     T2] two
+[  +1.000000] [     T3] three
+[Fri Feb 13 23:31:30 2009] [     T0] line zero
+[Fri Feb 13 23:31:31 2009] [     T1] new
+[Fri Feb 13 23:31:32 2009] [     T2] two
+[Fri Feb 13 23:31:33 2009] [     T3] three
+2009-02-13T23:31:30,123456+00:00 [     T0] line zero
+2009-02-13T23:31:31,123456+00:00 [     T1] new
+2009-02-13T23:31:32,123456+00:00 [     T2] two
+2009-02-13T23:31:33,123456+00:00 [     T3] three
tests/expected/dmesg/json-kmsg-printk-caller new file +115 -0

115 lines not on this page · raw message

tests/expected/dmesg/json-syslog-printk-caller new file +530 -0

530 lines not on this page · raw message

tests/expected/dmesg/kmsg-file-printk-caller new file +115 -0

115 lines not on this page · raw message

tests/expected/dmesg/limit-kmsg-printk-caller new file +11 -0
new file mode 100644
index 000000000..2ea07d4c8
@@ -0,0 +1,11 @@
+[    0.367657] [    T11] ACPI: \_SB_.PCI0.GP19.NHI1.PWRS: New power resource
+[    0.368615] [    T12] ACPI: \_SB_.PCI0.GP19.XHC4.PWRS: New power resource
+[    0.376316] [    T13] ACPI: \_SB_.PRWL: New power resource
+[    0.376343] [    T14] ACPI: \_SB_.PRWB: New power resource
+[    0.377373] [    T15] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
+[    0.377378] [    T16] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
+[    0.377569] [    T17] acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug AER]
+[    0.377933] [    T18] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability LTR DPC]
+[    0.378458] [    T19] PCI host bridge to bus 0000:00
+[    0.378459] [    T20] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
+[    0.378461] [    T21] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
tests/ts/dmesg/colors-kmsg-printk-caller new file +29 -0
new file mode 100755
index 000000000..513ca82d4
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="colors-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+ts_inhibit_custom_colorscheme
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG --color=always -K $TS_SELF/kmsg-input-printk-caller -x >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/console-levels-kmsg-printk-caller new file +36 -0
new file mode 100755
index 000000000..00b8b3681
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="levels-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+for I in {-1..8}; do
+	$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -l $I >> $TS_OUTPUT 2>/dev/null
+done
+
+$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -l err+ >> $TS_OUTPUT 2>/dev/null
+$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -l emerg+ >> $TS_OUTPUT 2>/dev/null
+$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -l +err >> $TS_OUTPUT 2>/dev/null
+$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -l +debug >> $TS_OUTPUT 2>/dev/null
+$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -l + 2>> $TS_OUTPUT >/dev/null
+
+ts_finalize
tests/ts/dmesg/decode-kmsg-printk-caller new file +28 -0
new file mode 100755
index 000000000..d05b9fb68
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="decode-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -x -K $TS_SELF/kmsg-input-printk-caller >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/delta-kmsg-printk-caller new file +28 -0
new file mode 100755
index 000000000..020b82357
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="delta-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -d -K $TS_SELF/kmsg-input-printk-caller >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/facilities-kmsg-printk-caller new file +30 -0
new file mode 100755
index 000000000..bec301516
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="facilities-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+for I in {-1..12}; do
+	$TS_HELPER_DMESG -K $TS_SELF/kmsg-input-printk-caller -f $I -x >> $TS_OUTPUT 2>/dev/null
+done
+
+ts_finalize
tests/ts/dmesg/indentation-kmsg-printk-caller new file +40 -0
new file mode 100755
index 000000000..53e549b62
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="indentation-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -K $TS_SELF/newlines-kmsg-printk-caller >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG -K $TS_SELF/newlines-kmsg-printk-caller -x >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=delta --kmsg-file $TS_SELF/newlines-kmsg-printk-caller >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=notime --kmsg-file $TS_SELF/newlines-kmsg-printk-caller >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=reltime --kmsg-file $TS_SELF/newlines-kmsg-printk-caller >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=ctime --kmsg-file $TS_SELF/newlines-kmsg-printk-caller >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=iso --kmsg-file $TS_SELF/newlines-kmsg-printk-caller >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+ts_finalize
tests/ts/dmesg/input-syslog-printk-caller new file +105 -0

105 lines not on this page · raw message

tests/ts/dmesg/json-kmsg-printk-caller new file +28 -0
new file mode 100755
index 000000000..cb6c5e4a8
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="json-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -K $TS_SELF/kmsg-input-printk-caller >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/json-syslog-printk-caller new file +28 -0
new file mode 100755
index 000000000..10dfaa423
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="json-syslog-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -F $TS_SELF/input-syslog-printk-caller >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/kmsg-file-printk-caller new file +28 -0
new file mode 100755
index 000000000..a01fc723f
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="kmsg-file-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -K $TS_SELF/kmsg-input-printk-caller >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/kmsg-input-printk-caller new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..8d67f11cad7988469dd5e4a7c8589d2b744168bb
GIT binary patch
tests/ts/dmesg/limit-kmsg-printk-caller new file +29 -0
new file mode 100755
index 000000000..4d4d9912d
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="limit-kmsg-prtk-caller"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG --since @1234567890.124 --until @1234567991 -K $TS_SELF/kmsg-input-printk-caller \
+	>> $TS_OUTPUT 2> $TS_ERRLOG
+
+ts_finalize
tests/ts/dmesg/newlines-kmsg-printk-caller new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..574d2177796677b73f1efcf273005169ed832c60
GIT binary patch
Signature · 1 line
2.43.0