Mercurial > hg > Game > Cerium
changeset 1943:f82bb7393c4d draft
fix debug function
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 05 Feb 2014 18:28:52 +0900 |
parents | b5d778f00bf1 |
children | dcf42acc5006 |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/kernel/schedule/SchedExit.cc TaskManager/kernel/schedule/SchedMail.cc TaskManager/kernel/schedule/SchedNop.cc TaskManager/kernel/schedule/SchedNop2Ready.cc TaskManager/kernel/schedule/SchedNop2Ready.h TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTaskList.cc |
diffstat | 9 files changed, 18 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Wed Feb 05 18:28:52 2014 +0900 @@ -1,4 +1,4 @@ -#define DEBUG +//#define DEBUG #include "error.h" #include <stdio.h> #include <stdlib.h>
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Wed Feb 05 18:28:52 2014 +0900 @@ -217,14 +217,14 @@ memaddr data = mainScheduler->mail_read_from_host(); if (data == (memaddr)MY_SPE_STATUS_READY) { - __debug_ppe("mail_check(): Task List finish\n"); + __debug_ppe(this->scheduler, "mail_check(): Task List finish\n"); ppeTaskList->freeAll(); } else if (data == (memaddr)MY_SPE_COMMAND_EXIT) { - __debug_ppe("mail_check(): Task List finish COMMAND\n"); + __debug_ppe(this->scheduler, "mail_check(): Task List finish COMMAND\n"); } else if (data == (memaddr)MY_SPE_COMMAND_MALLOC) { send_alloc_reply(this, 0, mainScheduler); } else if (data != (memaddr)MY_SPE_NOP) { - __debug_ppe("mail_check(): recv from 0x%x\n", data); + __debug_ppe(this->scheduler, "mail_check(): recv from 0x%x\n", data); // post_func を先に実行しないと、systask_finish が active_queue // 移されてから、wait_for されるという事態が起きることがある。 TaskListPtr list = (TaskListPtr)data;
--- a/TaskManager/kernel/schedule/SchedExit.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedExit.cc Wed Feb 05 18:28:52 2014 +0900 @@ -6,7 +6,7 @@ SchedExit::next(Scheduler *scheduler, SchedTaskBase *p) { - __debug("SchedExit::next()\n"); + __debug(scheduler, "SchedExit::next()\n"); return NULL; }
--- a/TaskManager/kernel/schedule/SchedMail.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedMail.cc Wed Feb 05 18:28:52 2014 +0900 @@ -10,7 +10,7 @@ connector = scheduler->connector; memaddr params_addr = connector->task_list_mail_read(); - __debug("[SchedMail:%s]\n", __FUNCTION__); + __debug(scheduler, "[SchedMail:%s]\n", __FUNCTION__); if (params_addr == (memaddr)MY_SPE_COMMAND_EXIT) { return new SchedExit();
--- a/TaskManager/kernel/schedule/SchedNop.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedNop.cc Wed Feb 05 18:28:52 2014 +0900 @@ -6,8 +6,8 @@ SchedTaskBase* SchedNop::next(Scheduler *scheduler, SchedTaskBase *p) { - __debug("SchedNop::next()"); - + __debug(scheduler, "SchedNop::next()\n"); + // delete p; return new SchedMail();
--- a/TaskManager/kernel/schedule/SchedNop2Ready.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedNop2Ready.cc Wed Feb 05 18:28:52 2014 +0900 @@ -13,14 +13,14 @@ void SchedNop2Ready::exec(void) { - __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedNop2Ready:%s]\n", __FUNCTION__); } void SchedNop2Ready::write(void) { - __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedNop2Ready:%s]\n", __FUNCTION__); #ifdef MAIL_QUEUE connector->mail_write_finish_list((memaddr)MY_SPE_STATUS_READY); @@ -34,9 +34,8 @@ SchedTaskBase* SchedNop2Ready::next(Scheduler *scheduler,SchedTaskBase *p) { - __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedNop2Ready:%s]\n", __FUNCTION__); return new SchedNop(); - }
--- a/TaskManager/kernel/schedule/SchedNop2Ready.h Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedNop2Ready.h Wed Feb 05 18:28:52 2014 +0900 @@ -25,8 +25,8 @@ const char * name() { return "Nop2" ; }; -#if DEBUG - void read(void) { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); } +#ifdef DEBUG + void read(void) { __debug(this->scheduler, "[SchedNop2Ready:%s]\n", __FUNCTION__); } //void write(void) { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); } #endif };
--- a/TaskManager/kernel/schedule/SchedTask.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Wed Feb 05 18:28:52 2014 +0900 @@ -1,4 +1,4 @@ - +//#define DEBUG #include <stdlib.h> #include <string.h> #include "SchedTask.h" @@ -63,7 +63,7 @@ void SchedTask::read() { - __debug("[SchedTask:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedTask:%s]\n", __FUNCTION__); // object creation をSchedTask生成時にやらないので、 // exec の直前のread で十分に間に合う @@ -160,7 +160,7 @@ void SchedTask::write() { - __debug("[SchedTask:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedTask:%s]\n", __FUNCTION__); connector->dma_wait(DMA_WRITE); connector->free_(writebuf); @@ -174,7 +174,7 @@ SchedTask::next(Scheduler *scheduler, SchedTaskBase *p) { TaskList *nextList = list; // do not modify list - __debug("[SchedTask:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedTask:%s]\n", __FUNCTION__); if (cur_index == 0) { // 最初の一つ SchedTask *nextSched = new SchedTask();
--- a/TaskManager/kernel/schedule/SchedTaskList.cc Tue Feb 04 02:18:27 2014 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskList.cc Wed Feb 05 18:28:52 2014 +0900 @@ -39,7 +39,7 @@ { // next() で TaskListの中身を見られてしまうので、 // ここで DMA 待ちを行う - __debug("[SchedTaskList:%s]\n", __FUNCTION__); + __debug(this->scheduler, "[SchedTaskList:%s]\n", __FUNCTION__); connector->dma_wait(DMA_READ_TASKLIST); }