/* * 計測ルーチン */ void perf_eval(uint_t n) { uint_t i, j; init_hist(1, MAX_TIME, histarea1); sus_tsk(LOGTASK); /* システムログタスクの動作を止める */ for (i = 0; i < NO_MEASURE; i++) { ini_flg(FLG1); for (j = 0; j < n; j++) { act_tsk(task_list[j]); } chg_pri(TSK_SELF, MAIN_PRIORITY_LOW); /* タスクが待ち状態に入るのを待つ */ chg_pri(TSK_SELF, TPRI_INI); begin_measure(1); set_flg(FLG1, 0x01U); end_measure(1); chg_pri(TSK_SELF, MAIN_PRIORITY_LOW); /* タスクが終了するのを待つ */ chg_pri(TSK_SELF, TPRI_INI); } rsm_tsk(LOGTASK); /* システムログタスクの動作を再開する */ syslog_1(LOG_NOTICE, "Execution times of set_flg" " when %d tasks are released from waiting.", n); print_hist(1); logtask_flush(0U); }
/* * performance evaluation routine */ void perf_eval(uint_t n) { uint_t i, j; init_hist(1, MAX_TIME, histarea1); for (i = 0; i < NO_MEASURE; i++) { ini_flg(FLG1); for (j = 0; j < n; j++) { act_tsk(task_list[j]); } chg_pri(TSK_SELF, MAIN_PRIORITY_LOW); /* let the task in the waiting queue of the event flag */ chg_pri(TSK_SELF, TPRI_INI); begin_measure(1); set_flg(FLG1, 0x01U); end_measure(1); chg_pri(TSK_SELF, MAIN_PRIORITY_LOW); /* wait the task exits */ chg_pri(TSK_SELF, TPRI_INI); } syslog_1(LOG_NOTICE, "Execution times of set_flg" " when %d tasks are released from waiting.", n); print_hist(1); syslog_flush(); }