论坛元老
- 积分
- 11478
- 金钱
- 11478
- 注册时间
- 2013-3-8
- 在线时间
- 1227 小时
|
发表于 2016-8-18 16:01:44
|
显示全部楼层
PRINTF("任务名 已用栈(B) 剩余栈(B) 栈使用率(%%) 优先级 CPU使用率(%%) CPU最大使用率(%%) 调用次数 状态\r\n"); OSTaskStkChk (&Led0TaskTCB,&free,&used,&err); PRINTF("Led0TaskTCB %4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n\r\n", used,free,(used*100)/(used+free),Led0TaskTCB.Prio,Led0TaskTCB.CPUUsage/100.0,Led0TaskTCB.CPUUsageMax/100.0,Led0TaskTCB.CtxSwCtr,task_state[Led0TaskTCB.TaskState]); OSTaskStkChk (&Led1TaskTCB,&free,&used,&err); PRINTF("Led1TaskTCB %4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n\r\n", used,free,(used*100)/(used+free),Led1TaskTCB.Prio,Led1TaskTCB.CPUUsage/100.0,Led1TaskTCB.CPUUsageMax/100.0,Led1TaskTCB.CtxSwCtr,task_state[Led1TaskTCB.TaskState]); OSTaskStkChk (&TCPCMDTaskTCB,&free,&used,&err); PRINTF("TCPCMDTaskTCB %4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n\r\n", used,free,(used*100)/(used+free),TCPCMDTaskTCB.Prio,TCPCMDTaskTCB.CPUUsage/100.0,TCPCMDTaskTCB.CPUUsageMax/100.0,TCPCMDTaskTCB.CtxSwCtr,task_state[TCPCMDTaskTCB.TaskState]); OSTaskStkChk (&COLLECTTaskTCB,&free,&used,&err); PRINTF("COLLECTTaskTCB %4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n\r\n", used,free,(used*100)/(used+free),COLLECTTaskTCB.Prio,COLLECTTaskTCB.CPUUsage/100.0,COLLECTTaskTCB.CPUUsageMax/100.0,COLLECTTaskTCB.CtxSwCtr,task_state[COLLECTTaskTCB.TaskState]); OSTaskStkChk (&GET_TEMPERATURETaskTCB,&free,&used,&err); PRINTF("STATUS %4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n\r\n", used,free,(used*100)/(used+free),GET_TEMPERATURETaskTCB.Prio,GET_TEMPERATURETaskTCB.CPUUsage/100.0,GET_TEMPERATURETaskTCB.CPUUsageMax/100.0,GET_TEMPERATURETaskTCB.CtxSwCtr,task_state[GET_TEMPERATURETaskTCB.TaskState]); OSTaskStkChk (&UDPDEBUGTaskTCB,&free,&used,&err); PRINTF("UDPDEBUGTaskTCB %4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n\r\n", used,free,(used*100)/(used+free),UDPDEBUGTaskTCB.Prio,UDPDEBUGTaskTCB.CPUUsage/100.0,UDPDEBUGTaskTCB.CPUUsageMax/100.0,UDPDEBUGTaskTCB.CtxSwCtr,task_state[UDPDEBUGTaskTCB.TaskState]); for(i=0;i<12;i++) { OSTaskStkChk (&LwIP_task_TCB[i],&free,&used,&err); if(LwIP_task_TCB[i].CtxSwCtr) PRINTF("LwIP_task_TCB[%2d]%4d %4d %3d%% %3d %3.2f%% %3.2f%% %8d %s\r\n", i,used,free,(used*100)/(used+free),LwIP_task_TCB[i].Prio,LwIP_task_TCB[i].CPUUsage/100.0,LwIP_task_TCB[i].CPUUsageMax/100.0,LwIP_task_TCB[i].CtxSwCtr,task_state[LwIP_task_TCB[i].TaskState]); } cpuuseage=OSStatTaskCPUUsage/100.0; //由于算出来的是万分之几的CPU占用率,这边做了一些处理 PRINTF("任务切换次数 :%d CPU总使用率=%3.2f%%\r\n",OSTaskCtxSwCtr,cpuuseage); |
|