From b490c0bbaf81fb741c6751eff30082883343e2ff Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 18 Oct 2011 00:06:10 +0000 Subject: * gold.cc: Include timer.h. (queue_middle_tasks): Stamp time. (queue_final_tasks): Likewise. * main.cc (main): Store timer in parameters. Print timers for each pass. * parameters.cc (Parameters::Parameters): Initialize timer_. (Parameters::set_timer): New function. (set_parameters_timer): New function. * parameters.h (Parameters::set_timer): New function. (Parameters::timer): New function. (Parameters::timer_): New data member. (set_parameters_timer): New function. * timer.cc (Timer::stamp): New function. (Timer::get_pass_time): New function. * timer.h (Timer::stamp): New function. (Timer::get_pass_time): New function. (Timer::pass_times_): New data member. --- gold/gold.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gold/gold.cc') diff --git a/gold/gold.cc b/gold/gold.cc index 2700bdb..f455ec8 100644 --- a/gold/gold.cc +++ b/gold/gold.cc @@ -45,6 +45,7 @@ #include "gc.h" #include "icf.h" #include "incremental.h" +#include "timer.h" namespace gold { @@ -487,6 +488,10 @@ queue_middle_tasks(const General_options& options, Workqueue* workqueue, Mapfile* mapfile) { + Timer* timer = parameters->timer(); + if (timer != NULL) + timer->stamp(0); + // Add any symbols named with -u options to the symbol table. symtab->add_undefined_symbols_from_command_line(layout); @@ -786,6 +791,10 @@ queue_final_tasks(const General_options& options, Workqueue* workqueue, Output_file* of) { + Timer* timer = parameters->timer(); + if (timer != NULL) + timer->stamp(1); + int thread_count = options.thread_count_final(); if (thread_count == 0) thread_count = std::max(2, input_objects->number_of_input_objects()); -- cgit v1.1