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

Unified Diff: base/debug/profiler.h

Issue 9477002: Support the Syzygy instrumenting profiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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 | « no previous file | base/debug/profiler.cc » ('j') | base/debug/profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/profiler.h
diff --git a/base/debug/profiler.h b/base/debug/profiler.h
index 69795a507853a83321cf6645ba62e70db71f5ea9..e88d6715b85c11a5cbf746b012136e959d3e33de 100644
--- a/base/debug/profiler.h
+++ b/base/debug/profiler.h
@@ -34,6 +34,26 @@ BASE_EXPORT bool BeingProfiled();
// Reset profiling after a fork, which disables timers.
BASE_EXPORT void RestartProfilingAfterFork();
+// Returns true iff this executable is instrumented with the Syzygy profiler.
+BASE_EXPORT bool IsBinaryInstrumented();
+
+// A return address resolution function is used to resolve the location
+// on stack where a return address originally resided, to the location where
+// the profiler stashed the original return address.
jar (doing other things) 2012/02/27 22:44:10 I couldn't understand this comment. Specifically,
Sigurður Ásgeirsson 2012/02/28 16:31:40 Reworked comment with a lot more detail.
+// This is necessary for V8 and any other code that looks at the return address
+// to see where a call originated and/or rewrites the return address. V8 looks
+// at the return address to identify the JavaScript function that invoked it,
+// and may rewrite return addresses when it garbage collects or optimizes the
+// JIT code.
+typedef uintptr_t (*ReturnAddressLocationResolver)(
+ uintptr_t return_addr_location);
+
+// If this binary is instrumented and the instrumentation supplies a return
+// address resolution function, finds and returns the address resolution
+// function. Otherwise returns NULL.
+BASE_EXPORT ReturnAddressLocationResolver
+ GetProfilerReturnAddrResolutionFunc();
+
} // namespace debug
} // namespace base
« no previous file with comments | « no previous file | base/debug/profiler.cc » ('j') | base/debug/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698