crash命令 —— foreach

简介: crash命令 —— foreach

参考:https://crash-utility.github.io/help_pages/foreach.html

用法:

  • 在所有的进程上执行命令
  • 这里的命令支持如下:
命令 可选参数 用途
bt -r -t -l -e -R -f -F -o -s -x -d 查看调用栈
vm -p -v -m -R -d -x 进程的用户虚拟内存信息
task -R -d -x 查看进程的task_struct结构内容
files -c -R 查看进程打开的文件的信息
net -s -S -R -d -x
set
ps -G -s -p -c -t -l -a -g -r -y
sig -g
vtop -c -u -k

foreach <命令>

  • 在指定的进程上执行命令
    foreach <进程的pid> <cmd>foreach <进程的task_struct地址> <cmd>
  • 在指定名字的进程上执行命令
    foreach <名字> <cmd>
  • 在所有的用户线程上执行命令
    foreach user <cmd>
  • 在所有的用户线程组的组长进程上执行命令
    foreach gleader <cmd>
  • 在所有的内核线程上执行命令
    foreach kernel <cmd>
  • 在所有当前正在cpu上运行的线程上执行命令
    foreach active <cmd>
  • 在特定运行状态的进程上执行命令
  • 目前支持如下一些运行状态过滤:
状态 含义
RU 可运行态
IN 可中断睡眠
UN 不可中断睡眠
ST 停止状态
ZO 僵尸状态
TR 跟踪态
SW SWAPPING态
DE 死亡态
WA Waking态
PA Park态
ID IDLE态
NE NEW态

foreach UN <cmd> : 在所有处于不可中断状态的进程上执行命令

相关文章
|
12月前
|
数据库管理
SVN 执行cleanup报错:Cleanup failed to process the following paths : 解决方法
引用:https://www.cnblogs.com/pinpin/p/11395438.html 在SVN更新时提示文件被锁住了,要求执行 clean up操作,执行clean up时又报clean up failed。造成的原因是在某次更新后,点击了cancel按钮,操作没有完成所以会锁住。解决方法如下:
1049 0
|
13天前
crash命令 —— list
crash命令 —— list
|
13天前
crash命令 —— tree
crash命令 —— tree
|
13天前
crash命令 —— search
crash命令 —— search
|
13天前
crash命令 —— log
crash命令 —— log
|
13天前
crash命令 —— task
crash命令 —— task
|
13天前
|
缓存
crash命令 —— files
crash命令 —— files
|
Ubuntu JavaScript
ubuntu 文件监视数量 Error: ENOSPC: System limit for number of file watchers reached, watch‘所在文件路径‘
vue 运行执行 npm run dev | * Error: ENOSPC: System limit for number of file watchers reached, watch’所在文件路径’ 最简单的命令 沾走就能用
196 0
ubuntu 文件监视数量 Error: ENOSPC: System limit for number of file watchers reached, watch‘所在文件路径‘
|
JavaScript
Error: EMFILE: too many open files, watch 报错的解决方法
Error: EMFILE: too many open files, watch 报错的解决方法
655 1
|
XML SQL Java
如何去寻找解决bug?(以Mapped Statements collection does not contain value for xxx的异常为例)
如何去寻找解决bug?(以Mapped Statements collection does not contain value for xxx的异常为例)
如何去寻找解决bug?(以Mapped Statements collection does not contain value for xxx的异常为例)