aboutsummaryrefslogtreecommitdiff
path: root/gold/workqueue.cc
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2009-12-17 16:02:03 +0000
committerRafael Ávila de Espíndola <respindola@mozilla.com>2009-12-17 16:02:03 +0000
commitd675ff4684242402af02908e431ed5e9fe045320 (patch)
tree45bfbe1903cf6096bd6e80327625852653480829 /gold/workqueue.cc
parentff4a8d2b939133ea12e8994ff1f83d3a8e17baa2 (diff)
downloadgdb-d675ff4684242402af02908e431ed5e9fe045320.zip
gdb-d675ff4684242402af02908e431ed5e9fe045320.tar.gz
gdb-d675ff4684242402af02908e431ed5e9fe045320.tar.bz2
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.
Diffstat (limited to 'gold/workqueue.cc')
-rw-r--r--gold/workqueue.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/gold/workqueue.cc b/gold/workqueue.cc
index 18c3900..c713dca 100644
--- a/gold/workqueue.cc
+++ b/gold/workqueue.cc
@@ -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;
{