查看进程何时开始执行
ps -eo comm,lstart
bash Tue Nov 22 15:46:39 2016
flush-253:0 Thu Dec 25 08:07:07 2014
sshd Tue Nov 22 16:46:00 2016
bash Tue Nov 22 16:46:00 2016
rsyslogd Mon Jan 25 15:12:46 2016
agent Tue Nov 22 17:07:00 2016
ps Tue Nov 22 17:07:00 2016
sshd Tue Jan 27 19:55:06 2015
bluetooth Tue Jan 27 17:00:18 2015
跟踪某命令的执行过程
strace ping -c 1
execve("/bin/ping", ["ping", "-c", "1", ""], [/* 28 vars */]) = 0
brk(0) = 0x7fc69259c000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc690c13000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=44088, ...}) = 0
mmap(NULL, 44088, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc690c08000
close(3) = 0
open("/lib64/libidn.so.11", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0/\200Y:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=209120, ...}) = 0
mmap(NULL, 2301768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc6907c3000
mprotect(0x7fc6907f5000, 2093056, PROT_NONE) = 0
mmap(0x7fc6909f4000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7fc6909f4000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
ps -eo pid,command,user,psr
psr 代表当前不同命令跑在不同的核心上
2085 gnome-power-manager gdm 1
2086 /usr/libexec/gdm-simple-gre gdm 3
2089 /usr/libexec/polkit-1/polki root 0
2098 /usr/bin/pulseaudio --start gdm 1
2100 /usr/libexec/rtkit-daemon rtkit 2
2103 sshd: root@pts/0 root 0
2107 pam: gdm-password root 2
2114 -bash root 0
2138 sshd: root@pts/1 root 0
2142 -bash root 0
2171 top root 3
2182 sshd: root@pts/2 root 0
2186 -bash root 3
阅读(1824) | 评论(0) | 转发(0) |