MCP cdp_profile_start

Description

Start a CPU profiling capture on the debugged Roku app via CDP Profiler.start.

Requires rk server mode: this tool talks to the server's owned CDP connection, not a private socket. The capture is written to a .cpuprofile file on disk under the project root; the response is metadata only (a handle to the started capture), not the profile itself -- read the file, or use cdp_profile_stop's response, for the data.

CPU frames only decode to readable function names on an unminified/debug build. Build with --no-minify (or use the --debug preset) if you need meaningful names in the resulting .cpuprofile; a minified build still profiles, but every frame reads as an anonymous/renamed symbol.

Optional parameters:

  • sessionId (string): Session id returned by cdp_session_create. Uses the active session when omitted.
  • samplingHz (number): Sampling frequency in Hz. Defaults to 100 Hz.
  • durationMs (number): If set, the server automatically stops and writes the capture after this
    many milliseconds -- a single fire-and-forget call to "profile the next N ms." Omit to capture
    until an explicit cdp_profile_stop.
  • output (string): Output .cpuprofile file path (must stay within project root). Auto-generated
    under the project root when omitted.

Response:

  • captureId (string): Handle used by cdp_profile_stop.
  • filePath (string): Absolute path the capture will be written to.
  • samplingHz (number): Requested sampling frequency; older firmware may ignore it and sample at the device default.

Notes:

  • Only one active CPU capture per session is allowed. Duplicate start returns 409 CAPTURE_ALREADY_ACTIVE.

See also

Parameters

additionalProperties: false

NameTypeRequiredValues
sessionIdstringNo
samplingHznumberNo
durationMsnumberNo
outputstringNo

sessionId

Session id returned by cdp_session_create. Uses the active session when omitted.

samplingHz

Sampling frequency in Hz (default 100)

durationMs

Auto-stop and write the capture after this many milliseconds

output

Output .cpuprofile file path (must stay within project root when provided)


Did this page help you?