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

Unified Diff: src/counters.h

Issue 827993003: Integrate Chrome tracing with V8 (WIP) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup Created 5 years, 11 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 | « include/v8-tracing.h ('k') | src/counters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.h
diff --git a/src/counters.h b/src/counters.h
index 41107cfc33b8c944496e37d269c4ba647ad260fc..afd139575db04467bb25d0a262bdb51d2ad44f44 100644
--- a/src/counters.h
+++ b/src/counters.h
@@ -9,6 +9,7 @@
#include "src/allocation.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/globals.h"
+#include "src/log.h"
#include "src/objects.h"
namespace v8 {
@@ -224,12 +225,9 @@ class Histogram {
class HistogramTimer : public Histogram {
public:
HistogramTimer() { }
- HistogramTimer(const char* name,
- int min,
- int max,
- int num_buckets,
- Isolate* isolate)
- : Histogram(name, min, max, num_buckets, isolate) {}
+ HistogramTimer(const char* name, int min, int max, int num_buckets,
+ Isolate* isolate, Logger::Overhead overhead)
+ : Histogram(name, min, max, num_buckets, isolate), overhead_(overhead) {}
// Start the timer.
void Start();
@@ -242,6 +240,8 @@ class HistogramTimer : public Histogram {
return Enabled() && timer_.IsStarted();
}
+ Logger::Overhead overhead() { return overhead_; }
+
// TODO(bmeurer): Remove this when HistogramTimerScope is fixed.
#ifdef DEBUG
base::ElapsedTimer* timer() { return &timer_; }
@@ -249,6 +249,7 @@ class HistogramTimer : public Histogram {
private:
base::ElapsedTimer timer_;
+ Logger::Overhead overhead_;
};
// Helper class for scoping a HistogramTimer.
@@ -297,25 +298,24 @@ class HistogramTimerScope BASE_EMBEDDED {
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) \
- /* Total 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)
-
+#define HISTOGRAM_TIMER_LIST(HT) \
+ /* Garbage collection timers. */ \
+ HT(gc_compactor, V8.GCCompactor, LOW) \
+ HT(gc_scavenger, V8.GCScavenger, LOW) \
+ HT(gc_context, V8.GCContext, NORMAL) /* GC context cleanup time */ \
+ HT(gc_idle_notification, V8.GCIdleNotification, LOW) \
+ HT(gc_incremental_marking, V8.GCIncrementalMarking, LOW) \
+ HT(gc_low_memory_notification, V8.GCLowMemoryNotification, NORMAL) \
+ /* Parsing timers. */ \
+ HT(parse, V8.Parse, NORMAL) \
+ HT(parse_lazy, V8.ParseLazy, NORMAL) \
+ HT(pre_parse, V8.PreParse, NORMAL) \
+ /* Total compilation times. */ \
+ HT(compile, V8.Compile, NORMAL) \
+ HT(compile_eval, V8.CompileEval, NORMAL) \
+ /* Serialization as part of compilation (code caching) */ \
+ HT(compile_serialize, V8.CompileSerialize, NORMAL) \
+ HT(compile_deserialize, V8.CompileDeserialize, NORMAL)
#define HISTOGRAM_PERCENTAGE_LIST(HP) \
/* Heap fragmentation. */ \
@@ -562,7 +562,7 @@ class Counters {
HISTOGRAM_RANGE_LIST(HR)
#undef HR
-#define HT(name, caption) \
+#define HT(name, caption, overhead) \
HistogramTimer* name() { return &name##_; }
HISTOGRAM_TIMER_LIST(HT)
#undef HT
@@ -614,7 +614,7 @@ class Counters {
#undef SC
enum Id {
-#define RATE_ID(name, caption) k_##name,
+#define RATE_ID(name, caption, overhead) k_##name,
HISTOGRAM_TIMER_LIST(RATE_ID)
#undef RATE_ID
#define PERCENTAGE_ID(name, caption) k_##name,
@@ -653,7 +653,7 @@ class Counters {
HISTOGRAM_RANGE_LIST(HR)
#undef HR
-#define HT(name, caption) \
+#define HT(name, caption, overhead) \
HistogramTimer name##_;
HISTOGRAM_TIMER_LIST(HT)
#undef HT
« no previous file with comments | « include/v8-tracing.h ('k') | src/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698