?? app.c
字號:
//#include <asm/rt_time.h> #include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <unistd.h>#include <errno.h>#include "control.h"event_info ev1,ev2;#ifndef DEBUG# error Probably kernel does not produce statistic for this program#endif int main(){ int i; int debug_fifo; printf("TASK 1 \"UNO\"\nTASK 2 \"DOS\"\nTASK 3 \"TRES\"\n"); printf("TASK 4 \"CUATRO\"\nTASK 5 \"CINCO\"\nTASK 6 \"SEIS\"\n:BODY\n"); debug_fifo = open ("/dev/rtf5",O_RDONLY); if ( debug_fifo == -1 ) { printf("rtf5: not such device\n"); exit(1); } for (i=0; i<1000 ; i++) { read( debug_fifo, (char *) &ev2, sizeof(event_info)); if ( i==0 ) ev1 = ev2; printf("%s %d %d %d\n", (ev2.state== EXEC) ? "EXEC": "ACTI", ev2.id, (int) ((ev2.in-ev1.in)/10), (int) ((ev2.out-ev1.in)/10)); } close(debug_fifo); return 0;}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -