Linux?????????perf??ü??
???????????? ???????[ 2013/9/3 16:08:08 ] ????????
????3.perfstat——????????????????
??????????????????ò?????????μ??????????忴???ó?????????????????????????????Щ????????????????????????????????????????????
??????Щ????????????????????????????????????CPU???м????????CPUbound?????Щ????????????????IO???????????CPU????????ò?????????IObound???????CPUbound?????????IObound????????????
??????????????Щ????????Perfstat???????????????????????????????????????????????????е??????????????????
????????У?????????????????????test1.c??
??????????????test1
<SPAN style="FONT-SIZE: 14px"> //test.c
void longa()
{
int i??j;
for(i = 0; i < 1000000; i++)
j=i; //am I silly or crazy? I feel boring and desperate.
}
void foo2()
{
int i;
for(i=0 ; i < 10; i++)
longa();
}
void foo1()
{
int i;
for(i = 0; i< 100; i++)
longa();
}
int main(void)
{
foo1();
foo2();
} </SPAN>
????????????????????? test1
????gcc – o test1 – g test.c
????????????????-g????????????????????
????????????? perf stat ?????? test1 ???????
?????????????
?????? test1???е????????????? ( ????????????? )???????????????????????Ч???
??????????£????? task-clock-msecs ???perf stat ?????????????????????????????
????Task-clock-msecs??CPU ??????????????????????????仨???? CPU ????????? IO??
????Context-switches???????л??????????????????й????з????????ν????л????????????л???????????
????Cache-misses?????????й?????????? cache ???????????????????????????? cache ???ò???
????CPU-migrations????????? t1 ???й????з????????? CPU ??????????????????? CPU ??????????? CPU ?????С?
????Cycles??????????????????????????????? cycles??
????Instructions: ????????????
????IPC???? Instructions/Cycles ???????????????????????????????????????????
????Cache-references: cache ???е????
????Cache-misses: cache ?Ч???????
??????
???·???
??????????????????
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