forked from Imagelibrary/binutils-gdb
2009-12-17 Rafael Avila de Espindola <espindola@google.com>
* Makefile.am (CCFILES): Add timer.cc. (HFILES): Add timer.h. * configure.ac: Check for sysconf and times. * main.cc: include timer.h. (main): Use Timer instead of get_run_time. * timer.cc: New. * timer.h: New. * workqueue.cc: include timer.h. (Workqueue::find_and_run_task): Report user, sys and wall time. * Makefile.in: Regenerate. * config.in: Regenerate. * configure: Regenerate.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "debug.h"
|
||||
#include "options.h"
|
||||
#include "timer.h"
|
||||
#include "workqueue.h"
|
||||
#include "workqueue-internal.h"
|
||||
|
||||
@@ -311,10 +312,24 @@ Workqueue::find_and_run_task(int thread_number)
|
||||
gold_debug(DEBUG_TASK, "%3d running task %s", thread_number,
|
||||
t->name().c_str());
|
||||
|
||||
Timer timer;
|
||||
if (is_debugging_enabled(DEBUG_TASK))
|
||||
timer.start();
|
||||
|
||||
t->run(this);
|
||||
|
||||
gold_debug(DEBUG_TASK, "%3d completed task %s", thread_number,
|
||||
t->name().c_str());
|
||||
if (is_debugging_enabled(DEBUG_TASK))
|
||||
{
|
||||
Timer::TimeStats elapsed = timer.get_elapsed_time();
|
||||
|
||||
gold_debug(DEBUG_TASK,
|
||||
"%3d completed task %s "
|
||||
"(user: %ld.%06ld sys: %ld.%06ld wall: %ld.%06ld)",
|
||||
thread_number, t->name().c_str(),
|
||||
elapsed.user / 1000, (elapsed.user % 1000) * 1000,
|
||||
elapsed.sys / 1000, (elapsed.user % 1000) * 1000,
|
||||
elapsed.wall / 1000, (elapsed.wall % 1000) * 1000);
|
||||
}
|
||||
|
||||
Task* next;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user