进程信息监控:除free top外,最靠谱的就是 /proc/$pid/status,该文件会实时记录进程的
内存占用、文件占用、信号处理等各种资源占用状况,具体内容看参照相关文档
下面的源码主要是实现了一个进程监控脚本,定时记录给定pid进程的信息,以供后期分析
为考虑可移植性即嵌入式环境的使用,脚本没有采用外部的命令
[root@linux mem_monitor]# cat process_monitor.sh
#!/bin/sh
#process_monitor.sh monitor a process statics by pid
#Copyright (C) <2013> Jiancheng Li
#Written by Jiancheng Li ,August 2013.
#e-mail:jiancheng.leei@gmail.com
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; wi
内存占用、文件占用、信号处理等各种资源占用状况,具体内容看参照相关文档
下面的源码主要是实现了一个进程监控脚本,定时记录给定pid进程的信息,以供后期分析
为考虑可移植性即嵌入式环境的使用,脚本没有采用外部的命令
[root@linux mem_monitor]# cat process_monitor.sh
#!/bin/sh
#process_monitor.sh monitor a process statics by pid
#Copyright (C) <2013> Jiancheng Li
#Written by Jiancheng Li ,August 2013.
#e-mail:jiancheng.leei@gmail.com
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; wi