Commit 881c4ad4 by Tobias Langer

Fixed problem with wrong timestamp. Now timestamps are printed relative to task start.

parent dfae4598
...@@ -34,8 +34,8 @@ auto calculate_hyperperiod() -> long long ...@@ -34,8 +34,8 @@ auto calculate_hyperperiod() -> long long
} }
struct timestamps { struct timestamps {
base_clock::time_point start; cpp_time_base::duration start;
base_clock::time_point end; cpp_time_base::duration end;
int core_id = 0; int core_id = 0;
}; };
...@@ -59,12 +59,12 @@ void benchmark_out() ...@@ -59,12 +59,12 @@ void benchmark_out()
std::cout << "executions " << taskset[i].count << std::endl; std::cout << "executions " << taskset[i].count << std::endl;
for(int j = 0; j < benchmark[i].size(); j++) { for(int j = 0; j < benchmark[i].size(); j++) {
auto start = base_clock::to_time_t(benchmark[i][j].start); auto task_start = benchmark[i][j].start.count();
auto end = base_clock::to_time_t(benchmark[i][j].end); auto task_end = benchmark[i][j].end.count();
auto core_id = benchmark[i][j].core_id; auto core_id = benchmark[i][j].core_id;
std::cout << "instance " << j << " "; std::cout << "instance " << j << " ";
std::cout << "start " << start << " "; std::cout << "start " << task_start << " ";
std::cout << "end " << end << " "; std::cout << "end " << end_task << " ";
std::cout << "core_id " << core_id << std::endl; std::cout << "core_id " << core_id << std::endl;
} }
} }
...@@ -112,8 +112,8 @@ static void IdleTask(const void* args, mtapi_size_t, void*, mtapi_size_t, ...@@ -112,8 +112,8 @@ static void IdleTask(const void* args, mtapi_size_t, void*, mtapi_size_t,
auto end_time = base_clock::now(); auto end_time = base_clock::now();
int core_id = sched_getcpu(); int core_id = sched_getcpu();
benchmark[task_id][task_num - 1].start = start_time; benchmark[task_id][task_num - 1].start = duration_cast<cpp_base_time>(start_time - start);
benchmark[task_id][task_num - 1].end = end_time; benchmark[task_id][task_num - 1].end = duration_cast<cpp_base_time>(end_time - start);
benchmark[task_id][task_num - 1].core_id = core_id; benchmark[task_id][task_num - 1].core_id = core_id;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment