Mercurial > hg > Game > Cerium
view TaskManager/kernel/ppe/ExportTaskLog.cc @ 1602:e33e106ca3e0 draft
change default make parallel from fifo
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 06 Apr 2013 17:27:30 +0900 |
parents | 9b0908cb7553 |
children |
line wrap: on
line source
#include "ExportTaskLog.h" const char* const ExportTaskLog::FILENAME="logfile.yml"; ExportTaskLog::ExportTaskLog(QueueInfo<TaskLog> *_tasklog) { tasklog = _tasklog; open(); } ExportTaskLog::~ExportTaskLog() { close(); } void ExportTaskLog::open() { if ((fp = fopen(FILENAME, "w")) == NULL) { printf("file open error!\n"); exit(EXIT_FAILURE); }; } void ExportTaskLog::printOut() { while(!tasklog->empty()){ TaskLog *log = tasklog->poll(); fprintf(fp, "--- \n"); fprintf(fp, "task_id: %d\n", log->mtask_id); fprintf(fp, "cmd: %d\n", log->cmd); fprintf(fp, "create_time: %llu\n", log->create_time); fprintf(fp, "execute_time: %llu\n", log->execute_time); fprintf(fp, "finish_time: %llu\n", log->finish_time); fprintf(fp, "wait_for:\n"); while(!log->wait_for_list.empty()){ waitTask *task = log->wait_for_list.poll(); fprintf(fp, " - \n"); fprintf(fp, " task_id: %d\n", task->task_id); fprintf(fp, " cmd: %d\n", task->cmd); } } } void ExportTaskLog::close() { fclose(fp); }