Mercurial > hg > Game > Cerium
changeset 1423:515a0f15b5d2 draft
add to log taskdependency
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 09 Mar 2012 19:03:18 +0900 |
parents | be036663780c |
children | 0ce6c6880b4b |
files | TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/HTask.h TaskManager/kernel/ppe/TaskLog.h TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h |
diffstat | 5 files changed, 63 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc Wed Mar 07 19:39:27 2012 +0900 +++ b/TaskManager/kernel/ppe/HTask.cc Fri Mar 09 19:03:18 2012 +0900 @@ -2,6 +2,7 @@ #include "ListData.h" #include "TaskManagerImpl.h" #include "strings.h" +#include "rdtsc.h" /*! @@ -18,7 +19,8 @@ void HTask::spawn(void) { - mimpl->spawn_task(this); + tasklog->create_time = rdtsc(); + mimpl->spawn_task(this); } /*! @@ -32,6 +34,11 @@ void HTask::wait_for(HTaskPtr master) { + waitTask *wait_task = new waitTask; + wait_task->task_id = master->tasklog->mtask_id; + wait_task->cmd = master->command; + tasklog->wait_for_list.push_back(wait_task); + mimpl->set_task_depend(master, this); }
--- a/TaskManager/kernel/ppe/HTask.h Wed Mar 07 19:39:27 2012 +0900 +++ b/TaskManager/kernel/ppe/HTask.h Fri Mar 09 19:03:18 2012 +0900 @@ -6,6 +6,7 @@ #include "Task.h" #include "TaskQueue.h" #include "QueueInfo.h" +#include "TaskLog.h" //#include <stdio.h> class TaskManagerImpl; @@ -40,6 +41,8 @@ CPU_TYPE cpu_type; TaskManagerImpl *mimpl; + TaskLog *tasklog; + HTask *waiter; HTask *next; HTask *prev;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/kernel/ppe/TaskLog.h Fri Mar 09 19:03:18 2012 +0900 @@ -0,0 +1,35 @@ +#ifndef INCLUDED_TASKLOG +#define INCLUDED_TASKLOG + +#include <list> +#include "HTask.h" + +struct waitTask { + int task_id; + int cmd; +}; + +class TaskLog { +public: + + /* variables */ + int mtask_id; + int cmd; + std::list<waitTask*> wait_for_list; + unsigned long long create_time; + unsigned long long execute_time; + unsigned long long finish_time; + + /* constructor */ + TaskLog() { + mtask_id = task_id; + task_id++; + } + +private: + // Unique id + static int task_id; + +}; + +#endif
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Wed Mar 07 19:39:27 2012 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Fri Mar 09 19:03:18 2012 +0900 @@ -6,7 +6,9 @@ #include "Scheduler.h" #include "SysTask.h" #include "SysFunc.h" +#include "rdtsc.h" #include <string.h> +#include <list> // singleton QueueInfo<TaskQueue> *taskQueuePool = new QueueInfo<TaskQueue>() ; @@ -32,6 +34,7 @@ htaskImpl = waitTaskQueue ; // any QueueInfo<HTask> // Task の dependency を表現する double linked list. QueueInfo<HTask> とは別に必要。 taskQueueImpl = new QueueInfo<TaskQueue>(taskQueuePool); + } /** @@ -65,6 +68,11 @@ new_task->post_func = noaction; new_task->mimpl = this; new_task->from = (memaddr)from; + + TaskLog *tasklog = new TaskLog(); + taskLogQueue.push_back(tasklog); + new_task->tasklog = tasklog; + #ifdef EARLY_TOUCH if (rbuf) { if ((unsigned long)rbuf&0xf) { @@ -276,6 +284,8 @@ void TaskManagerImpl::check_task_finish(HTaskPtr me, QueueInfo<HTask> *wait_queue) { + me->tasklog->finish_time = rdtsc(); + while(TaskQueue *p = me->wait_me->poll()) { HTaskPtr you = p->task; QueueInfo<TaskQueue> *wait_i = you->wait_i; @@ -297,8 +307,6 @@ // TaskArray の rbuf はfreeされない見たいなので、ここでfreeしてみる。 - //;TODO - //ReferencedDmaManagerを使う場合ここでfreeすると、wordcountが動かない if (me->command == TaskArray) { free(me->rbuf); } @@ -355,7 +363,10 @@ TaskList は自動的に延長される */ void -TaskManagerImpl::set_taskList(HTaskPtr htask, QueueInfo<TaskList> * taskList) { +TaskManagerImpl::set_taskList(HTaskPtr htask, QueueInfo<TaskList> * taskList) +{ + htask->tasklog->execute_time = rdtsc(); + TaskListPtr list ; if ( taskList->empty() ) {
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h Wed Mar 07 19:39:27 2012 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.h Fri Mar 09 19:03:18 2012 +0900 @@ -7,6 +7,7 @@ #include "TaskQueue.h" #include "HTask.h" #include "Scheduler.h" +#include "TaskLog.h" class MemList; extern QueueInfo<TaskQueue> *taskQueuePool ; @@ -26,6 +27,8 @@ QueueInfo<TaskQueue> *taskQueueImpl; QueueInfo<HTask> *htaskImpl; + std::list<TaskLog*> taskLogQueue; + SchedTask *schedTaskManager; Scheduler *scheduler; TaskManagerImpl *others;