changeset 1989:f4c16bdddee0 draft

fix tasklog
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Sat, 19 Apr 2014 13:51:54 +0900
parents f13abbbaaf72
children e93e115b1903
files TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/HTask.h TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h
diffstat 4 files changed, 15 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc	Fri Apr 18 18:20:36 2014 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Sat Apr 19 13:51:54 2014 +0900
@@ -19,8 +19,6 @@
 void
 HTask::spawn(void)
 {
-    if (export_task_log)
-        tasklog->create_time = rdtsc();
     this->flag.dim_count = 1;    
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
@@ -80,13 +78,6 @@
 void
 HTask::wait_for(HTaskPtr master)
 {
-    if (export_task_log) {
-        waitTask *wait_task = new waitTask;
-        wait_task->task_id = master->tasklog->mtask_id;
-        wait_task->cmd = master->tasklog->cmd;
-        tasklog->wait_for_list.addLast(wait_task);
-    }
-
     mimpl->set_task_depend(master, this);
 }
 
--- a/TaskManager/kernel/ppe/HTask.h	Fri Apr 18 18:20:36 2014 +0900
+++ b/TaskManager/kernel/ppe/HTask.h	Sat Apr 19 13:51:54 2014 +0900
@@ -43,9 +43,6 @@
     TaskManagerImpl *mimpl;
     TaskPtr last;
 
-    int export_task_log;
-    TaskLog *tasklog;
-
     HTask *waiter;
     HTask *next;
     HTask *prev;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc	Fri Apr 18 18:20:36 2014 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc	Sat Apr 19 13:51:54 2014 +0900
@@ -72,12 +72,10 @@
     t->set_inData(0,rbuf,r_size);
     t->set_outData(0,wbuf,w_size);
 
-    new_task->export_task_log = _export_task_log;
     if (_export_task_log) {
-        TaskLog *tasklog = new TaskLog();
+        tasklog = new TaskLog();
         tasklog->set_cmd(cmd);
         taskLogQueue->addLast(tasklog);
-        new_task->tasklog = tasklog;
     }
 
 #ifdef EARLY_TOUCH
@@ -118,12 +116,10 @@
     new_task->from = (memaddr)from;
     new_task->next_task_array(cmd,0,8,8,8);
 
-    new_task->export_task_log = _export_task_log;
     if (_export_task_log) {
-        TaskLog *tasklog = new TaskLog();
+        tasklog = new TaskLog();
         tasklog->set_cmd(cmd);
         taskLogQueue->addLast(tasklog);
-        new_task->tasklog = tasklog;
     }
 
     return new_task;
@@ -204,6 +200,13 @@
 void
 TaskManagerImpl::set_task_depend(HTaskPtr master, HTaskPtr slave)
 {
+    if (_export_task_log) {
+        waitTask* wait_task = new waitTask;
+        wait_task->task_id = tasklog->mtask_id;
+        wait_task->cmd = tasklog->cmd;
+        tasklog->wait_for_list.addLast(wait_task);
+    }
+
     TaskQueuePtr m, s;
     if (!master->self) return;
 
@@ -223,6 +226,8 @@
 void
 TaskManagerImpl::spawn_task(HTaskPtr task)
 {
+    if (_export_task_log)
+        tasklog->create_time = rdtsc();
     // waiter // master
     // waitee // slave
     if (task->wait_i->empty()) {
@@ -284,7 +289,7 @@
 TaskManagerImpl::check_task_finish(HTaskPtr me, QueueInfo<HTask> *wait_queue)
 {
     if (_export_task_log)
-        me->tasklog->finish_time = rdtsc();
+        tasklog->finish_time = rdtsc();
 
     while(TaskQueue *p = me->wait_me->poll()) {
 	HTaskPtr you = p->task;
@@ -352,7 +357,7 @@
 TaskManagerImpl::set_taskList(HTaskPtr htask, QueueInfo<TaskList> * taskList)
 {
     if (_export_task_log)
-        htask->tasklog->execute_time = rdtsc();
+        tasklog->execute_time = rdtsc();
 
     TaskListPtr tl = (TaskList*)htask->rbuf;
     while(tl->prev) tl=tl->prev;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h	Fri Apr 18 18:20:36 2014 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.h	Sat Apr 19 13:51:54 2014 +0900
@@ -30,8 +30,10 @@
     SchedTask *schedTaskManager;
     Scheduler *scheduler;
     TaskManagerImpl *others;
+    TaskLog* tasklog;
     int _export_task_log;
     
+    
     /* constructor */
     TaskManagerImpl(int num = 0);