/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include #include #include namespace facebook::react::jsinspector_modern::tracing { /// Arbitrary data structure, which represents payload of the "ProfileChunk" /// Trace Event. struct TraceEventProfileChunk { /// Deltas between timestamps of chronolocigally sorted samples. /// Will be sent as part of the "ProfileChunk" trace event. using TimeDeltas = std::vector; /// Contains Profile information that will be emitted in this chunk: nodes and /// sample root node ids. struct CPUProfile { /// Unique node in the profile tree, has unique id, call frame and /// optionally /// id of its parent node. Only root node has no parent. struct Node { /// Unique call frame in the call stack. struct CallFrame { std::string codeType; uint32_t scriptId; std::string functionName; std::optional url; std::optional lineNumber; std::optional columnNumber; }; uint32_t id; CallFrame callFrame; std::optional parentId; }; std::vector nodes; std::vector samples; }; CPUProfile cpuProfile; TimeDeltas timeDeltas; }; } // namespace facebook::react::jsinspector_modern::tracing