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

Unified Diff: src/tracing/trace-event.h

Issue 2052523002: Add a trace-event for each runtime-stats timer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: "Function" --> #Function Created 4 years, 6 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/objects.cc ('k') | src/tracing/trace-event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tracing/trace-event.h
diff --git a/src/tracing/trace-event.h b/src/tracing/trace-event.h
index 2b3bf9bf92cca8fc5524ee1e644057d43795a0f1..9c3977e50527bc4e2665a796f3c6e51ba21258cc 100644
--- a/src/tracing/trace-event.h
+++ b/src/tracing/trace-event.h
@@ -292,6 +292,8 @@ const int kZeroNumArgs = 0;
const decltype(nullptr) kGlobalScope = nullptr;
const uint64_t kNoId = 0;
+extern int kRuntimeCallsTracingEnabled;
+
class TraceEventHelper {
public:
static v8::Platform* GetCurrentPlatform();
@@ -594,4 +596,25 @@ class TraceEventSamplingStateScope {
} // namespace internal
} // namespace v8
+// V8 Specific macros
+#define TRACE_IS_RUNTIME_CALLS_TRACING_ENABLED() \
+ v8::internal::tracing::kRuntimeCallsTracingEnabled == 1
+
+#define TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING() \
+ do { \
+ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO( \
+ TRACE_DISABLED_BY_DEFAULT("v8.runtime")); \
+ v8::internal::tracing::kRuntimeCallsTracingEnabled = \
+ INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() ? 1 \
+ : 0; \
+ } while (0)
+
+#define TRACE_RUNTIME_CALL(name) \
+ do { \
+ if (V8_UNLIKELY(TRACE_IS_RUNTIME_CALLS_TRACING_ENABLED())) { \
+ INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
+ name); \
+ } \
+ } while (0)
+
#endif // SRC_TRACING_TRACE_EVENT_H_
« no previous file with comments | « src/objects.cc ('k') | src/tracing/trace-event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698