Index: src/counters.h |
diff --git a/src/counters.h b/src/counters.h |
index 1209b454643de30bbb986e0b7760335ca0756b0c..45ca6890be7035364a435a96af7e88d5432544c5 100644 |
--- a/src/counters.h |
+++ b/src/counters.h |
@@ -315,7 +315,7 @@ class AggregatableHistogramTimer : public Histogram { |
// Start/stop the "outer" scope. |
void Start() { time_ = base::TimeDelta(); } |
- void Stop() { AddSample(static_cast<int>(time_.InMilliseconds())); } |
+ void Stop() { AddSample(static_cast<int>(time_.InMicroseconds())); } |
// Add a time value ("inner" scope). |
void Add(base::TimeDelta other) { time_ += other; } |
@@ -360,26 +360,32 @@ class AggregatedHistogramTimerScope { |
HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ |
HR(gc_idle_time_limit_undershot, V8.GCIdleTimeLimit.Undershot, 0, 10000, 101) |
-#define HISTOGRAM_TIMER_LIST(HT) \ |
- /* Garbage collection timers. */ \ |
- HT(gc_compactor, V8.GCCompactor) \ |
- HT(gc_scavenger, V8.GCScavenger) \ |
- HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ |
- HT(gc_idle_notification, V8.GCIdleNotification) \ |
- HT(gc_incremental_marking, V8.GCIncrementalMarking) \ |
- HT(gc_low_memory_notification, V8.GCLowMemoryNotification) \ |
- /* Parsing timers. */ \ |
- HT(parse, V8.Parse) \ |
- HT(parse_lazy, V8.ParseLazy) \ |
- HT(pre_parse, V8.PreParse) \ |
- /* Compilation times. */ \ |
- HT(compile, V8.Compile) \ |
- HT(compile_eval, V8.CompileEval) \ |
- /* Serialization as part of compilation (code caching) */ \ |
- HT(compile_serialize, V8.CompileSerialize) \ |
- HT(compile_deserialize, V8.CompileDeserialize) \ |
- /* Total compilation time incl. caching/parsing */ \ |
- HT(compile_script, V8.CompileScript) |
+#define SECONDS *1000 * 1000 |
+#define MILLISECONDS *1000 |
vogelheim
2015/01/26 14:46:50
I'm not super fond of this style of macro meta pro
Yang
2015/01/26 15:09:07
Done.
|
+ |
+#define HISTOGRAM_TIMER_LIST(HT) \ |
+ /* Garbage collection timers. */ \ |
+ HT(gc_compactor, V8.GCCompactor, 10 SECONDS) \ |
+ HT(gc_scavenger, V8.GCScavenger, 10 SECONDS) \ |
+ HT(gc_context, V8.GCContext, 10 SECONDS) /* GC context cleanup time */ \ |
+ HT(gc_idle_notification, V8.GCIdleNotification, 10 SECONDS) \ |
+ HT(gc_incremental_marking, V8.GCIncrementalMarking, 10 SECONDS) \ |
+ HT(gc_low_memory_notification, V8.GCLowMemoryNotification, 10 SECONDS) \ |
+ /* Parsing timers. */ \ |
+ HT(parse, V8.Parse, 1000 MILLISECONDS) \ |
+ HT(parse_lazy, V8.ParseLazy, 1000 MILLISECONDS) \ |
+ HT(pre_parse, V8.PreParse, 1000 MILLISECONDS) \ |
+ /* Compilation times. */ \ |
+ HT(compile, V8.Compile, 1000 MILLISECONDS) \ |
+ HT(compile_eval, V8.CompileEval, 1000 MILLISECONDS) \ |
+ /* Serialization as part of compilation (code caching) */ \ |
+ HT(compile_serialize, V8.CompileSerialize, 100 MILLISECONDS) \ |
+ HT(compile_deserialize, V8.CompileDeserialize, 100 MILLISECONDS) \ |
+ /* Total compilation time incl. caching/parsing */ \ |
+ HT(compile_script, V8.CompileScript, 1000 MILLISECONDS) |
+ |
+#undef SECONDS |
+#undef MILLISECONDS |
#define AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) \ |
@@ -631,7 +637,7 @@ class Counters { |
HISTOGRAM_RANGE_LIST(HR) |
#undef HR |
-#define HT(name, caption) \ |
+#define HT(name, caption, scale) \ |
HistogramTimer* name() { return &name##_; } |
HISTOGRAM_TIMER_LIST(HT) |
#undef HT |
@@ -688,38 +694,38 @@ class Counters { |
#undef SC |
enum Id { |
-#define RATE_ID(name, caption) k_##name, |
+#define RATE_ID(name, caption, scale) k_##name, |
HISTOGRAM_TIMER_LIST(RATE_ID) |
#undef RATE_ID |
#define AGGREGATABLE_ID(name, caption) k_##name, |
- AGGREGATABLE_HISTOGRAM_TIMER_LIST(AGGREGATABLE_ID) |
+ AGGREGATABLE_HISTOGRAM_TIMER_LIST(AGGREGATABLE_ID) |
#undef AGGREGATABLE_ID |
#define PERCENTAGE_ID(name, caption) k_##name, |
- HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) |
+ HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) |
#undef PERCENTAGE_ID |
#define MEMORY_ID(name, caption) k_##name, |
- HISTOGRAM_MEMORY_LIST(MEMORY_ID) |
+ HISTOGRAM_MEMORY_LIST(MEMORY_ID) |
#undef MEMORY_ID |
#define COUNTER_ID(name, caption) k_##name, |
- STATS_COUNTER_LIST_1(COUNTER_ID) |
- STATS_COUNTER_LIST_2(COUNTER_ID) |
+ STATS_COUNTER_LIST_1(COUNTER_ID) STATS_COUNTER_LIST_2( |
+ COUNTER_ID) |
#undef COUNTER_ID |
#define COUNTER_ID(name) kCountOf##name, kSizeOf##name, |
- INSTANCE_TYPE_LIST(COUNTER_ID) |
+ INSTANCE_TYPE_LIST(COUNTER_ID) |
#undef COUNTER_ID |
#define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ |
kSizeOfCODE_TYPE_##name, |
- CODE_KIND_LIST(COUNTER_ID) |
+ CODE_KIND_LIST(COUNTER_ID) |
#undef COUNTER_ID |
#define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ |
kSizeOfFIXED_ARRAY__##name, |
- FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) |
+ FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) |
#undef COUNTER_ID |
#define COUNTER_ID(name) kCountOfCODE_AGE__##name, \ |
kSizeOfCODE_AGE__##name, |
- CODE_AGE_LIST_COMPLETE(COUNTER_ID) |
+ CODE_AGE_LIST_COMPLETE(COUNTER_ID) |
#undef COUNTER_ID |
- stats_counter_count |
+ stats_counter_count |
vogelheim
2015/01/26 14:46:50
This (and above) is a super strange indent.
I tak
Yang
2015/01/26 15:09:07
Done.
|
}; |
void ResetCounters(); |
@@ -730,8 +736,7 @@ class Counters { |
HISTOGRAM_RANGE_LIST(HR) |
#undef HR |
-#define HT(name, caption) \ |
- HistogramTimer name##_; |
+#define HT(name, caption, scale) HistogramTimer name##_; |
HISTOGRAM_TIMER_LIST(HT) |
#undef HT |