LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 579|回复: 1

如何監視dmesg?

[复制链接]
发表于 2010-10-26 04:56:41 | 显示全部楼层 |阅读模式
我的電腦用到一段時間有時候kacpi_notify會crash:
  1. Oct 24 21:48:17 [kernel] [ 9861.265699] BUG: unable to handle kernel NULL pointer dereference at (null)
  2. Oct 24 21:48:17 [kernel] [ 9861.265717] IP: [<(null)>] (null)
  3. Oct 24 21:48:17 [kernel] [ 9861.265726] PGD 12ef88067 PUD 12efa2067 PMD 0
  4. Oct 24 21:48:17 [kernel] [ 9861.265756] CPU 0
  5. Oct 24 21:48:17 [kernel] [ 9861.265760] Modules linked in: nls_utf8 udf crc_itu_t fuse sco bnep rfcomm l2cap tp_smapi hdaps thinkpad_ec tun cpufreq_performance cpufreq_powersave cpufreq_conservative cpufreq_ondemand acpi_cpufreq freq_table mperf snd_hda_codec_intelhdmi snd_hda_codec_conexant usb_storage usb_libusual uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 snd_hda_intel i915 snd_hda_codec btusb bluetooth usbhid snd_hwdep arc4 snd_pcm ecb snd_timer hid drm_kms_helper thinkpad_acpi iwlagn hwmon drm snd iwlcore i2c_i801 i2c_algo_bit soundcore mac80211 ehci_hcd cfg80211 intel_agp joydev usbcore nvram e1000e snd_page_alloc ac sg thermal i2c_core battery processor video pcspkr rfkill nls_base output agpgart thermal_sys evdev
  6. Oct 24 21:48:17 [kernel] [ 9861.265898]
  7. Oct 24 21:48:17 [kernel] [ 9861.265905] Pid: 142, comm: kacpi_notify Not tainted 2.6.35-zen2-BFS #12 0831CTO/0831CTO
  8. Oct 24 21:48:17 [kernel] [ 9861.265914] RIP: 0010:[<0000000000000000>]  [<(null)>] (null)
  9. Oct 24 21:48:17 [kernel] [ 9861.265925] RSP: 0018:ffff880136cabde8  EFLAGS: 00010286
  10. Oct 24 21:48:17 [kernel] [ 9861.265934] RAX: 0000000000000000 RBX: ffff88011be4ab90 RCX: ffff880001c17348
  11. Oct 24 21:48:17 [kernel] [ 9861.265944] RDX: ffffffff8110b1e3 RSI: 0000000000000080 RDI: ffff880137c1f4e0
  12. Oct 24 21:48:17 [kernel] [ 9861.265953] RBP: ffff880136cabe00 R08: ffff880136cabe00 R09: ffff880136cabe20
  13. Oct 24 21:48:17 [kernel] [ 9861.265963] R10: ffff8801372fc4c0 R11: ffffffff00000000 R12: ffff880135ee65e8
  14. Oct 24 21:48:17 [kernel] [ 9861.265972] R13: ffff8801372fc4c0 R14: ffff8801372fc4c0 R15: ffff880136caa000
  15. Oct 24 21:48:17 [kernel] [ 9861.265983] FS:  0000000000000000(0000) GS:ffff880001c00000(0000) knlGS:0000000000000000
  16. Oct 24 21:48:17 [kernel] [ 9861.265995] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
  17. Oct 24 21:48:17 [kernel] [ 9861.266004] CR2: 0000000000000000 CR3: 000000011bccc000 CR4: 00000000000006f0
  18. Oct 24 21:48:17 [kernel] [ 9861.266014] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  19. Oct 24 21:48:17 [kernel] [ 9861.266024] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
  20. Oct 24 21:48:17 [kernel] [ 9861.266034] Process kacpi_notify (pid: 142, threadinfo ffff880136caa000, task ffff8801372fc4c0)
  21. Oct 24 21:48:17 [kernel] [ 9861.266049]  ffffffff81206391 ffff8800a4885bd0 ffff8800a4885bc0 ffff880136cabe20
  22. Oct 24 21:48:17 [kernel] [ 9861.266062] <0> ffffffff811f5cfb ffff880001c17340 ffff8801372fc4c0 ffff880136cabee0
  23. Oct 24 21:48:17 [kernel] [ 9861.266077] <0> ffffffff810496a0 ffff880136cabe50 ffffffff8136dfd9 ffff8801372fc7c0
  24. Oct 24 21:48:17 [kernel] [ 9861.266107]  [<ffffffff81206391>] ? acpi_ev_notify_dispatch+0x62/0x79
  25. Oct 24 21:48:17 [kernel] [ 9861.266120]  [<ffffffff811f5cfb>] acpi_os_execute_deferred+0x24/0x31
  26. Oct 24 21:48:17 [kernel] [ 9861.266133]  [<ffffffff810496a0>] worker_thread+0x1d3/0x27a
  27. Oct 24 21:48:17 [kernel] [ 9861.266146]  [<ffffffff8136dfd9>] ? sub_preempt_count+0x92/0xa6
  28. Oct 24 21:48:17 [kernel] [ 9861.266157]  [<ffffffff811f5cd7>] ? acpi_os_execute_deferred+0x0/0x31
  29. Oct 24 21:48:17 [kernel] [ 9861.266169]  [<ffffffff8104d4bf>] ? autoremove_wake_function+0x0/0x34
  30. Oct 24 21:48:17 [kernel] [ 9861.266179]  [<ffffffff810494cd>] ? worker_thread+0x0/0x27a
  31. Oct 24 21:48:17 [kernel] [ 9861.266188]  [<ffffffff8104d00f>] kthread+0x7a/0x82
  32. Oct 24 21:48:17 [kernel] [ 9861.266198]  [<ffffffff81003814>] kernel_thread_helper+0x4/0x10
  33. Oct 24 21:48:17 [kernel] [ 9861.266210]  [<ffffffff8104cf95>] ? kthread+0x0/0x82
  34. Oct 24 21:48:17 [kernel] [ 9861.266218]  [<ffffffff81003810>] ? kernel_thread_helper+0x0/0x10
  35. Oct 24 21:48:17 [kernel] [ 9861.266237] RIP  [<(null)>] (null)
  36. Oct 24 21:48:17 [kernel] [ 9861.266246]  RSP <ffff880136cabde8>
  37. Oct 24 21:48:17 [kernel] [ 9861.266278] ---[ end trace b00922b08f54a8df ]---
复制代码


但我完全不知道我到底做了甚麼造成這crash。我想問有办法可以監視dmesg然後报告到X前端來嗎?例如用libnotify?
发表于 2010-10-26 09:23:28 | 显示全部楼层
# dmesg
里的信息是通过系统调用 syslog 打印出来的。
自己写一个合适的代码就好了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表