???Linux????(???)????????
?????GeaoZhang ???????[ 2017/5/31 11:33:25 ] ?????????????? Linux ????
???????????????
????1????滮?????????????????
????1???????????????е???????????????????????????
????2??????????????е??????????????????????????
????????????????????????????????????
????Linux??kernel???????????????????????
????????????
????1.??cpu???е??????
????2.???????й???
????3.???????й???
????4.??????????й???
????5.???????????????
????2????????????????????????????????????????????????
????????????
????process??????????????????????????????????????????л??????????????????(??楨CPU)??????????????????λ??
????1?????????饗PCB??
????????????????????????????????????????
????2????????????
????1???????????й????????????????????????????е????????????
????2?????????????е???????????????????????е??????
????3???????????е???????????????????????е??????
???????????????л???
??????????????У?CPU???????????????????????????????????????????????????????????????????????????????????????????????????????????
????3?????
????thread??????????????????????????y???????е???????????????????????????y??????????????????????????????????
????????????
????1???????????????????????????????????????????
????2???????????С????????????????????????
????3??????????й???????ж???????浥????????????????棬?????????????????????Ч???
????shell> echo $PPID //????????ID
????2100
????shell> echo $$ //?????????ID
????2102
????????ps????
?????????os?????????
????1??ps???????Щ????
????1???????????pid ?????? ????shell?????????
????2????????????????????????????????
????3?????????????????????棬?????????????
????4??cpu?????????
???????ps?????????????????????
????2??????ps????
????shell> ps aux ?? ps -elf
????a???????????????????
????u???????????????????
????x????????н??????
????-e?????????????н??????
????-l????ó??????????????
????-f???????????????????????
????[root@localhost ~]# ps aux
????USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
??????????
????PID ?????ID??
????%CPU ????????CPU?????
????%MEM ???????????
????COMMAND ?????????????
????[root@localhost ~]# ps -elf
????F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
??????????
????R ???????У?????ж??????(????)??
????S ???????????????????
????Z ?????????????????????????
???????top????
???????????????????????
????1???????????top????
????[root@localhost ~]# top
???????????……
????h??e???
????1???????CPU???
????P????%CPU????
????M????%MEM????
?????????????£????3??
????q???????????top?????????????
??????????load average: 0.06?? 0.60?? 0.48
??????????????????????е?????????
??????????????? 1?????5?????15????????????????????w??uptime??????top?????????
????2??top?????????
????[root@localhost ~]# top -d 1 -n 5 -p 1
????-d 1 ????????????1??
????-n 5 ??′???
????-p 1 ??????PID?1????????????????????PID?????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11