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

Unified Diff: src/log-inl.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 | « src/log.cc ('k') | src/tracing/event-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log-inl.h
diff --git a/src/log-inl.h b/src/log-inl.h
index a96631d059d1a5dd0dffb7d3ebd9ec9d2cd64584..ac8903054f07f91f532a249442459af026257609 100644
--- a/src/log-inl.h
+++ b/src/log-inl.h
@@ -7,6 +7,7 @@
#include "src/log.h"
#include "src/isolate.h"
+#include "src/tracing/trace-event.h"
namespace v8 {
namespace internal {
@@ -28,12 +29,24 @@ Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
void Logger::CallEventLogger(Isolate* isolate, const char* name, StartEnd se,
- bool expose_to_api) {
- if (isolate->event_logger() != NULL) {
- if (isolate->event_logger() == DefaultEventLoggerSentinel) {
- LOG(isolate, TimerEvent(se, name));
- } else if (expose_to_api) {
- isolate->event_logger()(name, se);
+ Overhead overhead) {
+ if (overhead == Overhead::NORMAL) {
+ if (se == START) {
+ TRACE_EVENT_BEGIN0("V8", name);
+ } else {
+ TRACE_EVENT_END0("V8", name);
+ }
+ } else if (overhead == Overhead::LOW) {
+ if (se == START) {
+ TRACE_EVENT_BEGIN0("benchmark", name);
+ } else {
+ TRACE_EVENT_END0("benchmark", name);
+ }
+ } else {
+ if (se == START) {
+ TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("V8Disabled"), name);
+ } else {
+ TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("V8Disabled"), name);
}
}
}
« no previous file with comments | « src/log.cc ('k') | src/tracing/event-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698