Dmesg: Difference between revisions
No edit summary |
No edit summary |
||
Line 91: | Line 91: | ||
kern :info : [L okt 11 13:58:35 2014] [drm] Initialized radeon 2.36.0 20080528 for 0000:01:00.0 on minor 0 | kern :info : [L okt 11 13:58:35 2014] [drm] Initialized radeon 2.36.0 20080528 for 0000:01:00.0 on minor 0 | ||
</pre> | </pre> | ||
dmesg väljavõte, kui lisada töötavale masinale USB pulk külge: | |||
<pre> | |||
[ 6212.318708] ehci-pci 0000:00:1d.7: port 2 reset error -110 | |||
[ 6212.652109] usb 2-2: new high-speed USB device number 4 using ehci-pci | |||
[ 6212.785278] usb 2-2: New USB device found, idVendor=0781, idProduct=5567 | |||
[ 6212.785286] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 | |||
[ 6212.785293] usb 2-2: Product: Cruzer Blade | |||
[ 6212.785298] usb 2-2: Manufacturer: SanDisk | |||
[ 6212.785303] usb 2-2: SerialNumber: 20060877230F1D92A39C | |||
[ 6212.869584] usb-storage 2-2:1.0: USB Mass Storage device detected | |||
[ 6212.870039] scsi6 : usb-storage 2-2:1.0 | |||
[ 6212.870175] usbcore: registered new interface driver usb-storage | |||
[ 6213.869337] scsi 6:0:0:0: Direct-Access SanDisk Cruzer Blade 1.26 PQ: 0 ANSI: 5 | |||
[ 6213.869939] sd 6:0:0:0: Attached scsi generic sg2 type 0 | |||
[ 6213.871177] sd 6:0:0:0: [sdb] 7821312 512-byte logical blocks: (4.00 GB/3.72 GiB) | |||
[ 6213.872566] sd 6:0:0:0: [sdb] Write Protect is off | |||
[ 6213.872578] sd 6:0:0:0: [sdb] Mode Sense: 43 00 00 00 | |||
[ 6213.874210] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA | |||
[ 6213.899811] sdb: sdb1 | |||
[ 6213.903278] sd 6:0:0:0: [sdb] Attached SCSI removable disk | |||
</pre> | |||
=Kokkuvõte= | =Kokkuvõte= |
Revision as of 14:43, 11 October 2014
Tõnis Umbsaar A41, 2014/2015
Sissejuhatus
dmesg on käsk, mis sisuliselt näitab ära kõik draiverid, mis kernelisse laetakse alglaadimisel või kui lisatakse seade arvuti külge. See on väga tõhus tööriist näitamaks draiveritega seotud veateateid. dmesg on enamikes Linuxi distributsioonides vaikimisi olemas.
Viimase muudatuse ajalugu
11.10.2014 valmis esialgne versioon
Süntaks
Usage: dmesg [options] Options: -C, --clear clear the kernel ring buffer (tühjendab viimasest alglaadimisest tekkinud dmesg outputi) -c, --read-clear read and clear all messages (näitab ja tühjendab dmesg outputi) -D, --console-off disable printing messages to console (keelab ära käsureale dmesg printimise) -d, --show-delta show time delta between printed messages (näitab aega teadete vahel) -E, --console-on enable printing messages to console (lubab käsureale dmesg printimise) -f, --facility <list> restrict output to defined facilities (täpsustab milliseid osi täpsemalt välja printida: kern - kernel messages user - random user-level messages mail - mail system daemon - system daemons auth - security/authorization messages syslog - messages generated internally by syslogd lpr - line printer subsystem news - network news subsystem) -h, --help display this help and exit (näitab käesolevat süntaksi) -k, --kernel display kernel messages (näitab kerneliga seotud teateid) -l, --level <list> restrict output to defined levels (aitab vea otsimisel määrata vea tase: level 0-3 näitab tõsisemaid erroreid level 4 näitab kergemaid vigu, mis võivad viitada suuremale murele level 5 kerged vead, mis võib olla vajavad tähelepanu, aga ei pruugi level 6 näitab informatsiooni draiverite käimamineku kohta level 7 kasutatakse debuggimiseks) -n, --console-level <level> set level of messages printed to console -r, --raw print the raw message buffer (näitab koos log-level numbriga) -s, --buffer-size <size> buffer size to query the kernel ring buffer (saab määrata puhvri suuruse, vaikimisi 16392) -T, --ctime show human readable timestamp (näitab lihtsamini loetavas ajaformaadis, aga võib olla ebatäpne kui on kasutatud süsteemis SUSPEND/RESUME funktsioone) -t, --notime don't print messages timestamp -u, --userspace display userspace messages -V, --version output version information and exit (näitab dmesg versiooni) -x, --decode decode facility and level to readable string (näitab vea taset loetaval kujul)
dmesg lubab samuti kasutada "pipe"-ga grep ja less funktsioone.
Näited
Järgnev käsk näitab wifi draiveriga seotud infot
root@exod3rmus:~# dmesg | grep wifi [ 14.088628] iwlwifi 0000:04:00.0: can't disable ASPM; OS doesn't have ASPM control [ 14.088777] iwlwifi 0000:04:00.0: irq 46 for MSI/MSI-X [ 14.718192] iwlwifi 0000:04:00.0: loaded firmware version 8.83.5.1 build 33692 op_mode iwldvm [ 14.749585] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEBUG disabled [ 14.749590] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEBUGFS enabled [ 14.749592] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEVICE_TRACING enabled [ 14.749595] iwlwifi 0000:04:00.0: Detected Intel(R) WiFi Link 5100 AGN, REV=0x54 [ 14.750236] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S [ 19.845701] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S [ 19.849532] iwlwifi 0000:04:00.0: Radio type=0x1-0x2-0x0 [ 19.947359] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S [ 19.950527] iwlwifi 0000:04:00.0: Radio type=0x1-0x2-0x0
Järgnev käsk näitab videokaardi infot loetava vea tasemega (6-info, 7-debug) ja lihtsamini loetavas ajaformaadis.
root@exod3rmus:~# dmesg -x -T | grep radeon kern :info : [L okt 11 13:58:32 2014] [drm] radeon kernel modesetting enabled. kern :info : [L okt 11 13:58:32 2014] fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used) kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: GTT: 1024M 0x0000000020000000 - 0x000000005FFFFFFF kern :info : [L okt 11 13:58:32 2014] [drm] radeon: 512M of VRAM memory ready kern :info : [L okt 11 13:58:32 2014] [drm] radeon: 1024M of GTT memory ready. kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: WB enabled kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000020000c00 and cpu addr 0xffff8800b023cc00 kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000020000c0c and cpu addr 0xffff8800b023cc0c kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c598 and cpu addr 0xffffc9001119c598 kern :debug : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: irq 48 for MSI/MSI-X kern :info : [L okt 11 13:58:32 2014] radeon 0000:01:00.0: radeon: using MSI. kern :info : [L okt 11 13:58:32 2014] [drm] radeon: irq initialized. kern :info : [L okt 11 13:58:33 2014] [drm] radeon atom DIG backlight initialized kern :info : [L okt 11 13:58:33 2014] [drm] radeon: dpm initialized kern :info : [L okt 11 13:58:34 2014] fbcon: radeondrmfb (fb0) is primary device kern :info : [L okt 11 13:58:35 2014] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device kern :info : [L okt 11 13:58:35 2014] radeon 0000:01:00.0: registered panic notifier kern :info : [L okt 11 13:58:35 2014] [drm] Initialized radeon 2.36.0 20080528 for 0000:01:00.0 on minor 0
dmesg väljavõte, kui lisada töötavale masinale USB pulk külge:
[ 6212.318708] ehci-pci 0000:00:1d.7: port 2 reset error -110 [ 6212.652109] usb 2-2: new high-speed USB device number 4 using ehci-pci [ 6212.785278] usb 2-2: New USB device found, idVendor=0781, idProduct=5567 [ 6212.785286] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 6212.785293] usb 2-2: Product: Cruzer Blade [ 6212.785298] usb 2-2: Manufacturer: SanDisk [ 6212.785303] usb 2-2: SerialNumber: 20060877230F1D92A39C [ 6212.869584] usb-storage 2-2:1.0: USB Mass Storage device detected [ 6212.870039] scsi6 : usb-storage 2-2:1.0 [ 6212.870175] usbcore: registered new interface driver usb-storage [ 6213.869337] scsi 6:0:0:0: Direct-Access SanDisk Cruzer Blade 1.26 PQ: 0 ANSI: 5 [ 6213.869939] sd 6:0:0:0: Attached scsi generic sg2 type 0 [ 6213.871177] sd 6:0:0:0: [sdb] 7821312 512-byte logical blocks: (4.00 GB/3.72 GiB) [ 6213.872566] sd 6:0:0:0: [sdb] Write Protect is off [ 6213.872578] sd 6:0:0:0: [sdb] Mode Sense: 43 00 00 00 [ 6213.874210] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 6213.899811] sdb: sdb1 [ 6213.903278] sd 6:0:0:0: [sdb] Attached SCSI removable disk
Kokkuvõte
Võib esineda juhtumeid, kus mingi muu viga on alguse saanud just draiverist, mistõttu on dmesg väga hea tööriist selle välja selgitamiseks. Igaks juhuks tasuks lisaks logifailide kontrollimisele lisada juurde just selle käsu, vältimaks riistvaralisi vigu.
Kasutatud kirjandus
http://www.linuxnix.com/2013/05/what-is-linuxunix-dmesg-command-and-how-to-use-it.html
http://www.linfo.org/dmesg.html
http://man7.org/linux/man-pages/man1/dmesg.1.html