Oracle Linux 6.4 で動的にカーネルの動作を追跡するために crash をインストールした。
crash とは
crashユーティリティを使用すると、実行中のOracle Linuxシステム、またはカーネル・クラッシュの結果であるコア・ダンプの状態を分析できます。crashは、ソース・コード・デバッグ機能を提供するためにGNUデバッガgdbとマージされています。
http://docs.oracle.com/cd/E39368_01/e48214/ch10s02.html
インストール手順
# yum install crash # export DLP="https://oss.oracle.com/ol6/debuginfo" # wget ${DLP}/kernel-uek-debuginfo-`uname -r`.rpm # wget ${DLP}/kernel-uek-debuginfo-common-`uname -r`.rpm # rpm -Uvh kernel-uek-debuginfo-2.6.39-400.17.1.el6uek.x86_64.rpm kernel-uek-debuginfo-common-2.6.39-400.17.1.el6uek.x86_64.rpm
使ってみる
- 起動する
# crash crash 6.1.0-1.0.1.el6 Copyright (C) 2002-2012 Red Hat, Inc. Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation Copyright (C) 1999-2006 Hewlett-Packard Co Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited Copyright (C) 2006, 2007 VA Linux Systems Japan K.K. Copyright (C) 2005, 2011 NEC Corporation Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc. Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details. GNU gdb (GDB) 7.3.1 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu"... crash: read error: kernel virtual address: ffffffff8152f460 type: "cpu_possible_mask" crash: this kernel may be configured with CONFIG_STRICT_DEVMEM, which renders /dev/mem unusable as a live memory source. crash: trying /proc/kcore as an alternative to /dev/mem KERNEL: /usr/lib/debug/lib/modules/2.6.39-400.17.1.el6uek.x86_64/vmlinux DUMPFILE: /proc/kcore CPUS: 4 DATE: Thu Feb 20 21:41:05 2014 UPTIME: 00:32:46 LOAD AVERAGE: 0.84, 0.76, 0.69 TASKS: 390 NODENAME: yazekats-linux RELEASE: 2.6.39-400.17.1.el6uek.x86_64 VERSION: #1 SMP Fri Feb 22 18:16:18 PST 2013 MACHINE: x86_64 (2593 Mhz) MEMORY: 15.7 GB PID: 20470 COMMAND: "crash" TASK: ffff8803dba62180 [THREAD_INFO: ffff8803956cc000] CPU: 0 STATE: TASK_RUNNING (ACTIVE) crash>
- メモリ情報を見てみる
crash> kmem -i PAGES TOTAL PERCENTAGE TOTAL MEM 4039636 15.4 GB ---- FREE 2826719 10.8 GB 69% of TOTAL MEM USED 1212917 4.6 GB 30% of TOTAL MEM SHARED 729843 2.8 GB 18% of TOTAL MEM BUFFERS 29494 115.2 MB 0% of TOTAL MEM CACHED 890931 3.4 GB 22% of TOTAL MEM SLAB 57404 224.2 MB 1% of TOTAL MEM TOTAL SWAP 2021375 7.7 GB ---- SWAP USED 0 0 0% of TOTAL SWAP SWAP FREE 2021375 7.7 GB 100% of TOTAL SWAP