mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Signed-off-by: Chengzhong Wu <legendecas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63066 Refs: https://github.com/nodejs/node/pull/62273 Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
39 lines
939 B
C++
39 lines
939 B
C++
#ifndef SRC_NODE_PROFILING_H_
|
|
#define SRC_NODE_PROFILING_H_
|
|
|
|
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#include "v8-profiler.h"
|
|
#include "v8.h"
|
|
|
|
#include <cstdint>
|
|
#include <sstream>
|
|
|
|
namespace node {
|
|
|
|
struct HeapProfileOptions {
|
|
uint64_t sample_interval = 512 * 1024;
|
|
int stack_depth = 16;
|
|
v8::HeapProfiler::SamplingFlags flags =
|
|
v8::HeapProfiler::SamplingFlags::kSamplingNoFlags;
|
|
};
|
|
|
|
HeapProfileOptions ParseHeapProfileOptions(
|
|
const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
bool SerializeHeapProfile(v8::Isolate* isolate, std::ostringstream& out_stream);
|
|
|
|
struct CpuProfileOptions {
|
|
int sampling_interval_us = 0;
|
|
uint32_t max_samples = v8::CpuProfilingOptions::kNoSampleLimit;
|
|
};
|
|
|
|
CpuProfileOptions ParseCpuProfileOptions(
|
|
const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
} // namespace node
|
|
|
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#endif // SRC_NODE_PROFILING_H_
|