dmesg 程序崩溃调试2

dmesg命令基于缓冲区打印信息
dmesg -c可以清除该内存信息
清除后demsg 命令不显示任何信息,但可以到/var/log/dmesg查看信息

dmesg |tail 20
dmesg |head 20
dmesg |grep sda
dmesg |grep tty
dmesg |grep memory
dmesg |grep DMA
dmesg |grep usb

[root@localhost var]# dmesg | more Linux version
2.6.32 (root@localhost.localdomain) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-55)) #1 SMP Sun Sep 20 18:58:21 PDT 2015 Command line: ro root=LABEL=/ rhgb quiet KERNEL supported cpus: Intel GenuineIntel AMD AuthenticAMD Centaur CentaurHauls BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f400 (usable) BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved) BIOS-e820: 00000000000ca000 - 00000000000cc000 (reserved) BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 0000000057ee0000 (usable) BIOS-e820: 0000000057ee0000 - 0000000057eff000 (ACPI data) BIOS-e820: 0000000057eff000 - 0000000057f00000 (ACPI NVS) BIOS-e820: 0000000057f00000 - 0000000058000000 (usable) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved) BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved) BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved) DMI present. Phoenix BIOS detected: BIOS may corrupt low RAM, working around it. e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved) last_pfn = 0x58000 max_arch_pfn = 0x400000000 MTRR default type: uncachable MTRR fixed ranges enabled: 00000-9FFFF write-back A0000-BFFFF uncachable C0000-CBFFF write-protect CC000-EFFFF uncachable F0000-FFFFF write-protect
[root@localhost var]# dmesg | less
Linux version 2.6.32 (root@localhost.localdomain) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-55))
 #1 SMP Sun Sep 20 18:58:21 PDT 2015
Command line: ro root=LABEL=/ rhgb quiet
KERNEL supported cpus:
  Intel GenuineIntel
  AMD AuthenticAMD
  Centaur CentaurHauls
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009f400 (usable)
 BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000ca000 - 00000000000cc000 (reserved)
 BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000057ee0000 (usable)
 BIOS-e820: 0000000057ee0000 - 0000000057eff000 (ACPI data)
 BIOS-e820: 0000000057eff000 - 0000000057f00000 (ACPI NVS)
 BIOS-e820: 0000000057f00000 - 0000000058000000 (usable)
 BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved)
DMI present.
Phoenix BIOS detected: BIOS may corrupt low RAM, working around it.
e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
last_pfn = 0x58000 max_arch_pfn = 0x400000000
MTRR default type: uncachable
MTRR fixed ranges enabled:
  00000-9FFFF write-back
  A0000-BFFFF uncachable
  C0000-CBFFF write-protect
  CC000-EFFFF uncachable
  F0000-FFFFF write-protect
[root@localhost var]# dmesg | tail 
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
eth0: no IPv6 routers present
hdc: task_pio_intr: status=0x51 { DriveReady SeekComplete Error }
hdc: task_pio_intr: error=0x04 { AbortedCommand }
hdc: possibly failed opcode: 0xec
xx[4107]: segfault at 0 ip 0000000000400454 sp 00007fff206b7d60 error 6 in xx[400000+1000]
[root@localhost var]# dmesg | grep ttyS*
console [tty0] enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0b: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
You have new mail in /var/spool/mail/root
dmesg -c    清除缓存


tail -n 20 /var/log/dmesg
[root@localhost log]# tail -n 20 /var/log/dmesg
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
ide-cd driver 5.00
ide-cd: hdc: ATAPI 1X DVD-ROM DVD-R/RAM CD-R/RW drive, 32kB Cache
Uniform CD-ROM driver Revision: 3.20
sd 0:0:0:0: Attached scsi generic sg0 type 0
lp0: using parport0 (interrupt-driven).
lp0: console ready
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
device-mapper: multipath: version 1.1.0 loaded
EXT3 FS on sda2, internal journal
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with writeback data mode.
Adding 2064344k swap on /dev/sda3.  Priority:-1 extents:1 across:2064344k 




[root@localhost log]# tail -n 20 messages
May 28 22:42:19 localhost avahi-daemon[3921]: Server startup complete. Host name is localhost.local. Local service cookie is 982515779.
May 28 22:42:20 localhost avahi-daemon[3921]: Service "SFTP File Transfer on localhost" (/services/sftp-ssh.service) successfully established.
May 28 22:42:22 localhost smartd[4007]: smartd version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen 
May 28 22:42:22 localhost smartd[4007]: Home page is http://smartmontools.sourceforge.net/  
May 28 22:42:22 localhost smartd[4007]: Opened configuration file /etc/smartd.conf 
May 28 22:42:22 localhost smartd[4007]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices 
May 28 22:42:22 localhost smartd[4007]: Device: /dev/hdc, opened 
May 28 22:42:22 localhost smartd[4007]: Device: /dev/hdc, not ATA, no IDENTIFY DEVICE Structure 
May 28 22:42:22 localhost kernel: hdc: task_pio_intr: status=0x51 { DriveReady SeekComplete Error }
May 28 22:42:22 localhost kernel: hdc: task_pio_intr: error=0x04 { AbortedCommand }
May 28 22:42:22 localhost kernel: hdc: possibly failed opcode: 0xec
May 28 22:42:22 localhost smartd[4007]: Device: /dev/sda, opened 
May 28 22:42:22 localhost smartd[4007]: Device: /dev/sda, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sda' to turn on SMART features 
May 28 22:42:22 localhost smartd[4007]: Monitoring 0 ATA and 0 SCSI devices 
May 28 22:42:22 localhost smartd[4013]: smartd has fork()ed into background mode. New PID=4013. 
May 28 22:42:25 localhost gdm[4044]: gdm_config_parse: Logdir /var/log/gdm does not exist or isn't a directory.  Using ServAuthDir /var/gdm.
May 28 22:42:25 localhost pcscd: winscard.c:304:SCardConnect() Reader E-Gate 0 0 Not Found
May 28 22:42:25 localhost last message repeated 3 times
May 28 22:43:45 localhost kernel: xx[4107]: segfault at 0 ip 0000000000400454 sp 00007fff206b7d60 error 6 in xx[400000+1000]
May 28 22:45:06 localhost logger: Oracle Configuration Manager failed to establish a connection to Oracle. Reconfigure using /opt/oracle/112/ccr/bin/configCCR
原文地址:https://www.cnblogs.com/zengkefu/p/5539403.html