Mercurial > hg > Game > Cerium
changeset 923:382a48afb061 draft
fix DMA/Mail wait profiler
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 30 Jul 2010 15:24:13 +0900 |
parents | cb1023423861 |
children | 1640b14ec15a |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/spe/ShowTime.cc TaskManager/Cell/spe/main.cc TaskManager/kernel/schedule/DmaManager.h TaskManager/kernel/schedule/Scheduler.cc TaskManager/kernel/schedule/Scheduler.h example/Bulk/Func.h |
diffstat | 7 files changed, 13 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Thu Jul 29 22:56:58 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Fri Jul 30 15:24:13 2010 +0900 @@ -247,7 +247,7 @@ void CellTaskManagerImpl::show_profile() { for (int id = 0; id < machineNum; id++) { - HTaskPtr t = create_task(ShowTime,__builtin_return_address(0)); + HTaskPtr t = schedTaskManager->create_task(ShowTime,0,0,0,0); t->set_cpu((CPU_TYPE)(id+2)); t->spawn(); } @@ -255,7 +255,7 @@ void CellTaskManagerImpl::start_profile() { for (int id = 0; id < machineNum; id++) { - HTaskPtr t = create_task(StartProfile,__builtin_return_address(0)); + HTaskPtr t = schedTaskManager->create_task(StartProfile,0,0,0,0); t->set_cpu((CPU_TYPE)(id+2)); t->spawn(); }
--- a/TaskManager/Cell/spe/ShowTime.cc Thu Jul 29 22:56:58 2010 +0900 +++ b/TaskManager/Cell/spe/ShowTime.cc Fri Jul 30 15:24:13 2010 +0900 @@ -10,8 +10,8 @@ /* * ここで show_dma_wait() を呼びたい */ + // printf("Show Time !\n"); smanager->show_dma_wait(); - //printf("Show Time !\n"); return 0; }
--- a/TaskManager/Cell/spe/main.cc Thu Jul 29 22:56:58 2010 +0900 +++ b/TaskManager/Cell/spe/main.cc Fri Jul 30 15:24:13 2010 +0900 @@ -29,8 +29,6 @@ TaskManagerImpl *manager = new SpeTaskManagerImpl(); - SchedRegister(ShowTime); - SchedRegister(StartProfile); c_scheduler = new CellScheduler(); c_scheduler->init(manager); @@ -38,6 +36,9 @@ manager->set_scheduler(c_scheduler); + SchedRegister(ShowTime); + SchedRegister(StartProfile); + c_scheduler->run(new SchedNop()); c_scheduler->finish();
--- a/TaskManager/kernel/schedule/DmaManager.h Thu Jul 29 22:56:58 2010 +0900 +++ b/TaskManager/kernel/schedule/DmaManager.h Fri Jul 30 15:24:13 2010 +0900 @@ -13,6 +13,8 @@ DMA_READ_TASKLIST = 31, }; +class Scheduler; + class DmaManager { public: virtual ~DmaManager() {}; @@ -23,7 +25,7 @@ virtual void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask) {} virtual void dma_store(void *buf,memaddr addr, uint32 size, uint32 mask) {} virtual void dma_wait(uint32 mask) {} - virtual void show_dma_wait(int cpu) {} + virtual void show_dma_wait(Scheduler *s, int cpu) {} virtual void start_profile() {} // API for SPU inbound/outbound mailbox
--- a/TaskManager/kernel/schedule/Scheduler.cc Thu Jul 29 22:56:58 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Fri Jul 30 15:24:13 2010 +0900 @@ -4,6 +4,7 @@ #include "Scheduler.h" #include "SchedTask.h" #include "SchedNop.h" +#include "SysFunc.h" #include "error.h" #include <assert.h> #include "TaskManagerImpl.h" @@ -23,7 +24,7 @@ static int null_run(SchedTask* smanager, void* r, void *w) { - smanager->printf("Calling Undefined Task\n"); + smanager->printf("Calling Undefined Task %d\n", smanager->task->command==TaskArray1? smanager->atask->command: smanager->task->command); return 0; }
--- a/TaskManager/kernel/schedule/Scheduler.h Thu Jul 29 22:56:58 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.h Fri Jul 30 15:24:13 2010 +0900 @@ -119,7 +119,7 @@ void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask); void dma_store(void *buf,memaddr addr, uint32 size, uint32 mask); void dma_wait(uint32 mask); - void show_dma_wait() { connector->show_dma_wait(id); }; + void show_dma_wait() { connector->show_dma_wait(this, id); }; void start_profile() { connector->start_profile(); }; void mail_write(memaddr data); memaddr mail_read();