Mercurial > hg > Game > Cerium
changeset 1428:af2adce9752e draft
add to export TaskLog
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 28 Mar 2012 01:36:31 +0900 |
parents | 1bf286e37ba3 |
children | ae5fb867cf84 |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/CellTaskManagerImpl.h TaskManager/Cell/spe/SpeTaskManagerImpl.cc TaskManager/Cell/spe/SpeTaskManagerImpl.h TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.h TaskManager/kernel/main.cc TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/TaskLog.h TaskManager/kernel/ppe/TaskManager.h TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h |
diffstat | 12 files changed, 37 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Wed Mar 28 01:36:31 2012 +0900 @@ -6,6 +6,7 @@ #include "CellTaskManagerImpl.h" #include "HTask.h" #include "QueueInfo.h" +#include "ExportTaskLog.h" #include "SchedTask.h" #include "MainScheduler.h" #include "types.h" @@ -348,6 +349,11 @@ } } +void CellTaskManagerImpl::export_task_log() { + ExportTaskLog _export(taskLogQueue); + _export.printOut(); +} + void CellTaskManagerImpl::print_arch() { printf("CellTaskManager\n"); }
--- a/TaskManager/Cell/CellTaskManagerImpl.h Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.h Wed Mar 28 01:36:31 2012 +0900 @@ -38,6 +38,7 @@ void append_activeTask(HTaskPtr); void show_profile() ; void start_profile() ; + void export_task_log() ; void polling(); void debug_check_spe_idle(QueueInfo<HTask> * activeTaskQueue, int spe_running_); void print_arch();
--- a/TaskManager/Cell/spe/SpeTaskManagerImpl.cc Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/Cell/spe/SpeTaskManagerImpl.cc Wed Mar 28 01:36:31 2012 +0900 @@ -16,6 +16,7 @@ void SpeTaskManagerImpl::show_profile() {} void SpeTaskManagerImpl::start_profile() {} +void SpeTaskManagerImpl::export_task_log() {} void SpeTaskManagerImpl::print_arch() { printf("SpeTaskManagerImpl\n"); }
--- a/TaskManager/Cell/spe/SpeTaskManagerImpl.h Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/Cell/spe/SpeTaskManagerImpl.h Wed Mar 28 01:36:31 2012 +0900 @@ -19,6 +19,7 @@ void run(); void start_profile(); void show_profile(); + void export_task_log(); HTaskPtr create_task(int cmd); HTaskPtr create_task(int cmd, memaddr rbuf, long r_size, memaddr wbuf, long w_size); HTaskPtr create_task_array(int cmd, memaddr rbuf, long rs, memaddr wbuf, long ws);
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Wed Mar 28 01:36:31 2012 +0900 @@ -314,6 +314,9 @@ } } +void FifoTaskManagerImpl::export_task_log() { +} + void FifoTaskManagerImpl::print_arch() {
--- a/TaskManager/Fifo/FifoTaskManagerImpl.h Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.h Wed Mar 28 01:36:31 2012 +0900 @@ -29,6 +29,7 @@ void run(); void show_profile(); void start_profile(); + void export_task_log(); void polling();
--- a/TaskManager/kernel/main.cc Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/kernel/main.cc Wed Mar 28 01:36:31 2012 +0900 @@ -11,6 +11,7 @@ extern int TMmain(TaskManager* manager, int argc, char *argv[]); static int profile = 0; +static int export_task_log = 0; /* Default TMend function */ static void @@ -42,6 +43,8 @@ machineNum = atoi(argv[++i]); } else if (strcmp(argv[i], "-p") == 0) { profile = 1; + } else if (strcmp(argv[i], "-export") == 0) { + export_task_log = 1; } else if (strcmp(argv[i], "-speidle") == 0) { // これなんだよ? speIdle = atoi(argv[++i]); } else if (strcmp(argv[i], "-copy") == 0) { // force copy DMA in FifoManager @@ -77,6 +80,9 @@ (manager->tm_end)(manager); if (profile) manager->show_profile(); + if (export_task_log) + manager->export_task_log(); + manager->run(); // tm_end/show_profile may create a Task.. FINISH:
--- a/TaskManager/kernel/ppe/HTask.cc Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/kernel/ppe/HTask.cc Wed Mar 28 01:36:31 2012 +0900 @@ -36,7 +36,7 @@ { waitTask *wait_task = new waitTask; wait_task->task_id = master->tasklog->mtask_id; - wait_task->cmd = master->command; + wait_task->cmd = master->tasklog->cmd; tasklog->wait_for_list.addLast(wait_task); mimpl->set_task_depend(master, this);
--- a/TaskManager/kernel/ppe/TaskLog.h Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/kernel/ppe/TaskLog.h Wed Mar 28 01:36:31 2012 +0900 @@ -1,7 +1,6 @@ #ifndef INCLUDED_TASKLOG #define INCLUDED_TASKLOG -#include "HTask.h" #include "QueueInfo.h" struct waitTask { @@ -34,6 +33,11 @@ task_id++; } + void set_cmd(int _cmd) { + cmd = _cmd; + } + + private: // Unique id static int task_id;
--- a/TaskManager/kernel/ppe/TaskManager.h Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.h Wed Mar 28 01:36:31 2012 +0900 @@ -33,6 +33,7 @@ void start_profile() { m_impl->start_profile(); } void show_profile() { m_impl->show_profile(); } + void export_task_log() { m_impl->export_task_log(); } SchedTask *get_schedTask() { return m_impl->schedTaskManager;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Wed Mar 28 01:36:31 2012 +0900 @@ -13,6 +13,7 @@ QueueInfo<TaskQueue> *taskQueuePool = new QueueInfo<TaskQueue>() ; QueueInfo<HTask> *htaskPool = new QueueInfo<HTask>() ; QueueInfo<TaskList> *taskListPool = new QueueInfo<TaskList>() ; +QueueInfo<TaskLog> *taskLogQueue = new QueueInfo<TaskLog>(); static HTaskPtr systask_start; @@ -69,7 +70,8 @@ new_task->from = (memaddr)from; TaskLog *tasklog = new TaskLog(); - taskLogQueue.addLast(tasklog); + tasklog->set_cmd(cmd); + taskLogQueue->addLast(tasklog); new_task->tasklog = tasklog; #ifdef EARLY_TOUCH @@ -111,6 +113,11 @@ new_task->command = TaskArray1; new_task->from = (memaddr)from; + TaskLog *tasklog = new TaskLog(); + tasklog->set_cmd(cmd); + taskLogQueue->addLast(tasklog); + new_task->tasklog = tasklog; + return new_task; }
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h Sun Mar 11 19:31:16 2012 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.h Wed Mar 28 01:36:31 2012 +0900 @@ -12,7 +12,8 @@ extern QueueInfo<TaskQueue> *taskQueuePool ; extern QueueInfo<HTask> *htaskPool ; -extern QueueInfo<TaskList> *taskListPool; +extern QueueInfo<TaskList> *taskListPool; +extern QueueInfo<TaskLog> *taskLogQueue; @@ -27,8 +28,6 @@ QueueInfo<TaskQueue> *taskQueueImpl; QueueInfo<HTask> *htaskImpl; - QueueInfo<TaskLog> taskLogQueue; - SchedTask *schedTaskManager; Scheduler *scheduler; TaskManagerImpl *others; @@ -44,6 +43,7 @@ virtual void run() = 0; virtual void start_profile() = 0; virtual void show_profile() = 0; + virtual void export_task_log() = 0; virtual void append_activeTask(HTaskPtr); virtual void append_waitTask(HTaskPtr); virtual void polling() = 0;