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

Unified Diff: chrome/common/profiling.cc

Issue 9477002: Support the Syzygy instrumenting profiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move v8 deps exclusion above inclusion rule. 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 | « chrome/browser/DEPS ('k') | chrome/renderer/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/profiling.cc
diff --git a/chrome/common/profiling.cc b/chrome/common/profiling.cc
index b15cc963482625f8661fbb261dfdc6dc3eba50a9..bc678737e841f313f93199e1d0dc6fa3deed89c4 100644
--- a/chrome/common/profiling.cc
+++ b/chrome/common/profiling.cc
@@ -13,6 +13,7 @@
#include "base/string_util.h"
#include "base/threading/thread.h"
#include "chrome/common/chrome_switches.h"
+#include "v8/include/v8.h"
namespace {
std::string GetProfileName() {
@@ -102,6 +103,17 @@ void Profiling::ProcessStarted() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
+ // Establish the V8 return address resolution hook if we're
+ // an instrumented binary.
+ if (base::debug::IsBinaryInstrumented()) {
+ base::debug::ReturnAddressLocationResolver resolve_func =
+ base::debug::GetProfilerReturnAddrResolutionFunc();
+
+ if (resolve_func != NULL) {
+ v8::V8::SetReturnAddressLocationResolver(resolve_func);
+ }
+ }
+
if (command_line.HasSwitch(switches::kProfilingAtStart)) {
std::string process_type_to_start =
command_line.GetSwitchValueASCII(switches::kProfilingAtStart);
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698