solaris内核跟踪

DTRACE
  who_access_thisfile.d
--------------------------------------------------------------------------------

#!/usr/sbin/dtrace -qs
syscall::creat*:return,
syscall::open*:return
/arg0 != -1 && fds[arg0].fi_pathname == $1 /
{
        printf("uid#%d %s %s\n",uid,execname,$1);
}

--------------------------------------------------------------------------------

      chmod +x who_access_thisfile.d,然后执行./who_access_thisfile.d /etc/passwd,在另一个终端上试试cat /etc/passwd, vi /etc/passwd,看看你都看到了什么信息,你原来能做到吗?

kstat

mdb
1. 主机名(hostname)和操作系统版本

::satus
::showrev

2. 系统硬件信息(hardware configuration)

::prtconf

3. 模块或驱动信息

::modinfo

4. Crash时系统消息缓冲区的消息

该消息缓冲区是ring buffer,有很多有价值的信息,可以知道系统crash时或者之前很长一段时间的系统消息。

::msgbuf


进一步分析,可能需要查看以下几方面

1. 调用栈的backtrace

$c
::stack
::stackregs

2. 内核符号表

::nm

3. 反汇编

<内核函数>::dis

4. CPU寄存器

::regs

5. 调度队列(dispatch queue)

::cpuinfo -v

6. 物理内存及slab子系统

::memstat
::kmastat

7. 系统中所有进程

::ps

8. 所有内核线程

::threadlist

9. 线程状态

<kthread_t的地址>::thread


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/liyue0624/archive/2009/07/02/4316027.aspx

原文地址:https://www.cnblogs.com/itfriend/p/1926913.html