mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-24 07:01:35 +00:00
Sort -time-passes report first by user+system, then by Wall clock time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
05bd1b2eee
commit
b8fa514b1d
@ -107,6 +107,17 @@ static TimeRecord getTimeRecord() {
|
||||
return Result;
|
||||
}
|
||||
|
||||
bool TimeRecord::operator<(const TimeRecord &TR) const {
|
||||
// Primary sort key is User+System time
|
||||
if (UserTime+SystemTime < TR.UserTime+TR.SystemTime)
|
||||
return true;
|
||||
if (UserTime+SystemTime > TR.UserTime+TR.SystemTime)
|
||||
return false;
|
||||
|
||||
// Secondary sort key is Wall Time
|
||||
return Elapsed < TR.Elapsed;
|
||||
}
|
||||
|
||||
void TimeRecord::passStart(const TimeRecord &T) {
|
||||
Elapsed -= T.Elapsed;
|
||||
UserTime -= T.UserTime;
|
||||
|
@ -85,9 +85,7 @@ struct TimeRecord { // TimeRecord - Data we collect and print for each pass
|
||||
void passStart(const TimeRecord &T);
|
||||
void passEnd(const TimeRecord &T);
|
||||
void sum(const TimeRecord &TR);
|
||||
bool operator<(const TimeRecord &TR) const {
|
||||
return UserTime+SystemTime < TR.UserTime+TR.SystemTime;
|
||||
}
|
||||
bool operator<(const TimeRecord &TR) const;
|
||||
|
||||
void print(const char *PassName, const TimeRecord &TotalTime) const;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user