Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
asan:
strategy:
matrix:
version: [16, 18, 20, 22, 23]
version: [18, 20, 22, 24]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -23,7 +23,7 @@ jobs:
valgrind:
strategy:
matrix:
version: [16, 18, 20, 22, 23]
version: [18, 20, 22, 24]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ benchmarks:
- ./steps/run-benchmarks.sh
parallel:
matrix:
- MAJOR_NODE_VERSION: 16
- MAJOR_NODE_VERSION: 18
- MAJOR_NODE_VERSION: 20
- MAJOR_NODE_VERSION: 22
- MAJOR_NODE_VERSION: 24
artifacts:
name: "reports"
paths:
Expand Down
2 changes: 2 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
'xcode_settings': {
'OTHER_CFLAGS+': [
"-Wno-deprecated-declarations",
"-Wno-cast-function-type-mismatch", # clang17 now warns about casts between incompatible function types and v8 has some of those
"-Wno-unknown-warning-option", # "-Wcast-function-type-mismatch" is not a valid warning option for clang < 17
"-Werror",
'-std=gnu++20',
],
Expand Down
15 changes: 14 additions & 1 deletion bindings/profilers/heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ struct HeapProfilerState {
explicit HeapProfilerState(v8::Isolate* isolate) : isolate(isolate) {}

~HeapProfilerState() {
auto profiler = isolate->GetHeapProfiler();
if (profiler) {
profiler->StopSamplingHeapProfiler();
}

UninstallNearHeapLimitCallback();
if (async) {
// defer deletion of async when uv_close callback is invoked
Expand Down Expand Up @@ -323,7 +328,7 @@ static int CreateTempFile(uv_loop_t& loop, std::string& filepath) {
}

static void ExportProfile(HeapProfilerState& state) {
const int64_t timeoutMs = 5000;
const int64_t timeoutMs = 15000;
uv_loop_t loop;
int r;

Expand Down Expand Up @@ -355,6 +360,14 @@ static void ExportProfile(HeapProfilerState& state) {
options.file = args[0];
options.args = args.data();
options.exit_cb = &OnExit;
uv_stdio_container_t child_stdio[3];
child_stdio[0].flags = UV_IGNORE;
child_stdio[1].flags = UV_INHERIT_FD;
child_stdio[1].data.fd = 2;
child_stdio[2].flags = UV_INHERIT_FD;
child_stdio[2].data.fd = 2;
options.stdio = child_stdio;
options.stdio_count = 3;
uv_process_t child_req;
uv_timer_t timer;
timer.data = &child_req;
Expand Down
14 changes: 7 additions & 7 deletions bindings/profilers/wall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ NAN_METHOD(WallProfiler::New) {

NAN_METHOD(WallProfiler::Start) {
WallProfiler* wallProfiler =
Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());

if (info.Length() != 0) {
return Nan::ThrowTypeError("Start must not have any arguments.");
Expand Down Expand Up @@ -766,7 +766,7 @@ NAN_METHOD(WallProfiler::Stop) {
bool restart = info[0].As<Boolean>()->Value();

WallProfiler* wallProfiler =
Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());

v8::Local<v8::Value> profile;
auto err = wallProfiler->StopImpl(restart, profile);
Expand Down Expand Up @@ -996,27 +996,27 @@ void WallProfiler::SetContext(Isolate* isolate, Local<Value> value) {
}

NAN_GETTER(WallProfiler::GetContext) {
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
info.GetReturnValue().Set(profiler->GetContext(info.GetIsolate()));
}

NAN_SETTER(WallProfiler::SetContext) {
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
profiler->SetContext(info.GetIsolate(), value);
}

NAN_GETTER(WallProfiler::SharedArrayGetter) {
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
info.GetReturnValue().Set(profiler->jsArray_.Get(v8::Isolate::GetCurrent()));
}

NAN_METHOD(WallProfiler::V8ProfilerStuckEventLoopDetected) {
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
info.GetReturnValue().Set(profiler->v8ProfilerStuckEventLoopDetected());
}

NAN_METHOD(WallProfiler::Dispose) {
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
delete profiler;
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@datadog/pprof",
"version": "5.7.1",
"version": "5.8.0",
"description": "pprof support for Node.js",
"repository": "datadog/pprof-nodejs",
"main": "out/src/index.js",
Expand Down Expand Up @@ -83,5 +83,7 @@
},
"engines": {
"node": ">=16"
}
},
"//": "Temporary fix to make nan@2.22.2 work with Node 24",
"postinstall": "sed -i '' 's/^.* Holder() const.*//' ./node_modules/nan/nan_callbacks_12_inl.h"
}