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

Unified Diff: include/v8-platform.h

Issue 988893003: Implement tracing interface for v8 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update BUILD.gn to include trace_event_common.h Created 5 years 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 | « build/standalone.gypi ('k') | src/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-platform.h
diff --git a/include/v8-platform.h b/include/v8-platform.h
index c6cba0f982929aa8795e214c89f9fc1adc4ffb11..4fbef0f5d96bb49ce6a473d715145f614023224a 100644
--- a/include/v8-platform.h
+++ b/include/v8-platform.h
@@ -5,6 +5,8 @@
#ifndef V8_V8_PLATFORM_H_
#define V8_V8_PLATFORM_H_
+#include <stdint.h>
+
namespace v8 {
class Isolate;
@@ -107,6 +109,51 @@ class Platform {
* the epoch.
**/
virtual double MonotonicallyIncreasingTime() = 0;
+
+ /**
+ * Called by TRACE_EVENT* macros, don't call this directly.
+ * The name parameter is a category group for example:
+ * TRACE_EVENT0("v8,parse", "V8.Parse")
+ * The pointer returned points to a value with zero or more of the bits
+ * defined in CategoryGroupEnabledFlags.
+ **/
+ virtual const uint8_t* GetCategoryGroupEnabled(const char* name) {
+ static uint8_t no = 0;
+ return &no;
+ }
+
+ /**
+ * Gets the category group name of the given category_enabled_flag pointer.
+ * Usually used while serliazing TRACE_EVENTs.
+ **/
+ virtual const char* GetCategoryGroupName(
+ const uint8_t* category_enabled_flag) {
+ static const char dummy[] = "dummy";
+ return dummy;
+ }
+
+ /**
+ * Adds a trace event to the platform tracing system. This function call is
+ * usually the result of a TRACE_* macro from trace_event_common.h when
+ * tracing and the category of the particular trace are enabled. It is not
+ * advisable to call this function on its own; it is really only meant to be
+ * used by the trace macros. The returned handle can be used by
+ * UpdateTraceEventDuration to update the duration of COMPLETE events.
+ */
+ virtual uint64_t AddTraceEvent(
+ char phase, const uint8_t* category_enabled_flag, const char* name,
+ uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names,
+ const uint8_t* arg_types, const uint64_t* arg_values,
+ unsigned int flags) {
+ return 0;
+ }
+
+ /**
+ * Sets the duration field of a COMPLETE trace event. It must be called with
+ * the handle returned from AddTraceEvent().
+ **/
+ virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
+ const char* name, uint64_t handle) {}
};
} // namespace v8
« no previous file with comments | « build/standalone.gypi ('k') | src/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698