From 4f486c7e4e12d04e551ee1776e5708b15750f890 Mon Sep 17 00:00:00 2001 From: Matt Blagden Date: Tue, 30 Aug 2022 06:25:11 -0700 Subject: [PATCH] Enable sampling profiler in Chrome Debug Server Summary: Configure the runtime to allow use of the sampling profiler in the Chrome Debug Server. Note: this does not actually start and stop the profiler; this change just makes the sampling profiler available to the runtime. Changelog: [Internal] Reviewed By: neildhar Differential Revision: D39100833 fbshipit-source-id: 60d1f4e5ea2191fdf88b7f2e733557fa6128e205 --- ReactCommon/hermes/inspector/chrome/cli/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReactCommon/hermes/inspector/chrome/cli/main.cpp b/ReactCommon/hermes/inspector/chrome/cli/main.cpp index 4795231afd9..1dbeb999595 100644 --- a/ReactCommon/hermes/inspector/chrome/cli/main.cpp +++ b/ReactCommon/hermes/inspector/chrome/cli/main.cpp @@ -213,7 +213,9 @@ static void runDebuggerLoop( static void runScript(const std::string &scriptSource, const std::string &url) { std::shared_ptr runtime( - fbhermes::makeHermesRuntime()); + fbhermes::makeHermesRuntime(::hermes::vm::RuntimeConfig::Builder() + .withEnableSampleProfiling(true) + .build())); auto adapter = std::make_unique(runtime); fbhermes::inspector::chrome::Connection conn(