Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: src/counters.cc

Issue 2020983002: [counters] Increase --runtime-call-stats output resolution (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index 0dd62a0c5b96d9fd0009b9b83f49b6b4cad93216..0f8367f68b4524e150522b43f77be3dc1208e8a8 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -200,14 +200,14 @@ class RuntimeCallStatEntries {
void Print(std::ostream& os) {
if (total_call_count == 0) return;
std::sort(entries.rbegin(), entries.rend());
- os << std::setw(50) << "Runtime Function/C++ Builtin" << std::setw(10)
+ os << std::setw(50) << "Runtime Function/C++ Builtin" << std::setw(12)
<< "Time" << std::setw(18) << "Count" << std::endl
- << std::string(86, '=') << std::endl;
+ << std::string(88, '=') << std::endl;
for (Entry& entry : entries) {
entry.SetTotal(total_time, total_call_count);
entry.Print(os);
}
- os << std::string(86, '-') << std::endl;
+ os << std::string(88, '-') << std::endl;
Entry("Total", total_time, total_call_count).Print(os);
}
@@ -223,7 +223,7 @@ class RuntimeCallStatEntries {
public:
Entry(const char* name, base::TimeDelta time, uint64_t count)
: name_(name),
- time_(time.InMilliseconds()),
+ time_(time.InMicroseconds()),
count_(count),
time_percent_(100),
count_percent_(100) {}
@@ -236,9 +236,9 @@ class RuntimeCallStatEntries {
void Print(std::ostream& os) {
os.precision(2);
- os << std::fixed;
+ os << std::fixed << std::setprecision(2);
os << std::setw(50) << name_;
- os << std::setw(8) << time_ << "ms ";
+ os << std::setw(10) << static_cast<double>(time_) / 1000 << "ms ";
os << std::setw(6) << time_percent_ << "%";
os << std::setw(10) << count_ << " ";
os << std::setw(6) << count_percent_ << "%";
@@ -246,10 +246,10 @@ class RuntimeCallStatEntries {
}
void SetTotal(base::TimeDelta total_time, uint64_t total_count) {
- if (total_time.InMilliseconds() == 0) {
+ if (total_time.InMicroseconds() == 0) {
time_percent_ = 0;
} else {
- time_percent_ = 100.0 * time_ / total_time.InMilliseconds();
+ time_percent_ = 100.0 * time_ / total_time.InMicroseconds();
}
count_percent_ = 100.0 * count_ / total_count;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698