diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-06 07:02:40 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-06 07:02:40 +0000 |
commit | 9c70caf429770830b34b01e7aa358b951bf8c7b5 (patch) | |
tree | 0d040b9869b04e0a6f18aecb15ab1dc0279df379 /gcc/timevar.c | |
parent | f9bb50112a2c5f95d772c370c32c0693cd5d0845 (diff) | |
download | gcc-9c70caf429770830b34b01e7aa358b951bf8c7b5.tar.gz |
* timevar.c (timevar_add): Delete.
(timevar_get): Also count time since the selected timer was
last updated. Do not examine the timevar stack if the
selected timer is standalone.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36184 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/timevar.c')
-rw-r--r-- | gcc/timevar.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/gcc/timevar.c b/gcc/timevar.c index 5a79fa7ccab..cce106abd71 100644 --- a/gcc/timevar.c +++ b/gcc/timevar.c @@ -95,8 +95,6 @@ static struct timevar_time_def start_time; static void get_time PARAMS ((struct timevar_time_def *)); -static void timevar_add - PARAMS ((struct timevar_time_def *, struct timevar_time_def *)); static void timevar_accumulate PARAMS ((struct timevar_time_def *, struct timevar_time_def *, struct timevar_time_def *)); @@ -197,18 +195,6 @@ get_time (now) #endif /* __BEOS__ */ } -/* Add ELAPSED to TIMER. */ - -static void -timevar_add (timer, elapsed) - struct timevar_time_def *timer; - struct timevar_time_def *elapsed; -{ - timer->user += elapsed->user; - timer->sys += elapsed->sys; - timer->wall += elapsed->wall; -} - /* Add the difference between STOP_TIME and START_TIME to TIMER. */ static void @@ -387,18 +373,22 @@ timevar_get (timevar, elapsed) struct timevar_time_def *elapsed; { struct timevar_def *tv = &timevars[timevar]; + struct timevar_time_def now; *elapsed = tv->elapsed; - + /* Is TIMEVAR currently running as a standalone timer? */ if (tv->standalone) - /* Add the time elapsed since the it was started. */ - timevar_add (elapsed, &tv->start_time); - - /* Is TIMEVAR at the top of the timer stack? */ - if (stack->timevar == tv) - /* Add the elapsed time since it was pushed. */ - timevar_add (elapsed, &start_time); + { + get_time (&now); + timevar_accumulate (elapsed, &tv->start_time, &now); + } + /* Or is TIMEVAR at the top of the timer stack? */ + else if (stack->timevar == tv) + { + get_time (&now); + timevar_accumulate (elapsed, &start_time, &now); + } } /* Summarize timing variables to FP. The timing variable TV_TOTAL has |