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

Unified Diff: src/counters.h

Issue 2313193002: [Tracing] Fix runtime call stats tracing for GC. (Closed)
Patch Set: Remove duplicate runtime call stats in counters Created 4 years, 3 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 | « src/api.cc ('k') | src/counters-inl.h » ('j') | src/counters-inl.h » ('J')
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 85d709f0ea1ce99d28a4768e2fdda47aa4adb9e8..939e8cfcf059d82c5bf3434a059f3efd27cd74bd 100644
--- a/src/counters.h
+++ b/src/counters.h
@@ -808,18 +808,14 @@ class RuntimeCallStats {
bool in_use_;
};
-#define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
- do { \
- if (FLAG_runtime_call_stats) { \
- RuntimeCallStats::CorrectCurrentCounterId( \
- isolate->counters()->runtime_call_stats(), \
- &RuntimeCallStats::counter_name); \
- } \
- if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED())) { \
- RuntimeCallStats::CorrectCurrentCounterId( \
- isolate->counters()->tracing_runtime_call_stats(), \
- &RuntimeCallStats::counter_name); \
- } \
+#define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
+ do { \
+ if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || \
+ FLAG_runtime_call_stats)) { \
+ RuntimeCallStats::CorrectCurrentCounterId( \
+ isolate->counters()->runtime_call_stats(), \
+ &RuntimeCallStats::counter_name); \
+ } \
} while (false)
#define TRACE_HANDLER_STATS(isolate, counter_name) \
@@ -1170,9 +1166,6 @@ class Counters {
void ResetCounters();
void ResetHistograms();
RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; }
- RuntimeCallStats* tracing_runtime_call_stats() {
- return &tracing_runtime_call_stats_;
- }
private:
#define HR(name, caption, min, max, num_buckets) Histogram name##_;
@@ -1235,7 +1228,6 @@ class Counters {
#undef SC
RuntimeCallStats runtime_call_stats_;
- RuntimeCallStats tracing_runtime_call_stats_;
friend class Isolate;
@@ -1249,45 +1241,22 @@ class Counters {
class RuntimeCallTimerScope {
public:
inline RuntimeCallTimerScope(Isolate* isolate,
- RuntimeCallStats::CounterId counter_id) {
- if (V8_UNLIKELY(FLAG_runtime_call_stats)) {
- isolate_ = isolate;
- RuntimeCallStats::Enter(isolate_->counters()->runtime_call_stats(),
- &timer_, counter_id);
- }
- if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED())) {
- isolate_for_tracing_ = isolate;
- RuntimeCallStats::Enter(
- isolate_for_tracing_->counters()->tracing_runtime_call_stats(),
- &trace_event_timer_, counter_id);
- }
- }
+ RuntimeCallStats::CounterId counter_id);
// This constructor is here just to avoid calling GetIsolate() when the
// stats are disabled and the isolate is not directly available.
inline RuntimeCallTimerScope(HeapObject* heap_object,
RuntimeCallStats::CounterId counter_id);
inline ~RuntimeCallTimerScope() {
- if (V8_UNLIKELY(FLAG_runtime_call_stats)) {
+ if (V8_UNLIKELY(isolate_ != nullptr)) {
RuntimeCallStats::Leave(isolate_->counters()->runtime_call_stats(),
&timer_);
}
- if (V8_UNLIKELY(isolate_for_tracing_ != nullptr)) {
- RuntimeCallStats::Leave(
- isolate_for_tracing_->counters()->tracing_runtime_call_stats(),
- &trace_event_timer_);
- isolate_for_tracing_ = nullptr;
- }
}
private:
- Isolate* isolate_;
- // TODO(lpy): --runtime-call-stats and tracing should be mutually exclusive
- // with tracing taking precendence. We need to add checks, and use a single
- // isolate reference and a timer for both.
- Isolate* isolate_for_tracing_ = nullptr;
+ Isolate* isolate_ = nullptr;
RuntimeCallTimer timer_;
- RuntimeCallTimer trace_event_timer_;
};
} // namespace internal
« no previous file with comments | « src/api.cc ('k') | src/counters-inl.h » ('j') | src/counters-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698