Skip to content

Commit

Permalink
Enable sampling profiler in Chrome Debug Server
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mattbfb authored and facebook-github-bot committed Aug 30, 2022
1 parent 9e169da commit 4f486c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ReactCommon/hermes/inspector/chrome/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ static void runDebuggerLoop(

static void runScript(const std::string &scriptSource, const std::string &url) {
std::shared_ptr<fbhermes::HermesRuntime> runtime(
fbhermes::makeHermesRuntime());
fbhermes::makeHermesRuntime(::hermes::vm::RuntimeConfig::Builder()
.withEnableSampleProfiling(true)
.build()));
auto adapter =
std::make_unique<fbhermes::inspector::SharedRuntimeAdapter>(runtime);
fbhermes::inspector::chrome::Connection conn(
Expand Down

0 comments on commit 4f486c7

Please sign in to comment.