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: 3 additions & 1 deletion ddprof-lib/src/main/cpp/flightRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ int Recording::writeCpool(Buffer *buf, int *count_offset_in_cpool) {

void Recording::writeFrameTypes(Buffer *buf) {
buf->putVar32(T_FRAME_TYPE);
buf->putVar32(7);
buf->putVar32(8);
buf->putVar32(FRAME_INTERPRETED);
buf->putUtf8("Interpreted");
buf->putVar32(FRAME_JIT_COMPILED);
Expand All @@ -1741,6 +1741,8 @@ void Recording::writeFrameTypes(Buffer *buf) {
buf->putUtf8("Kernel");
buf->putVar32(FRAME_C1_COMPILED);
buf->putUtf8("C1 compiled");
buf->putVar32(FRAME_NATIVE_REMOTE);
buf->putUtf8("Native (remote)");
Comment thread
kaahos marked this conversation as resolved.
flushIfNeeded(buf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public String methodDescriptor() {
return method != null ? symbolString(method.get("descriptor")) : null;
}

/**
* The frame's {@code jdk.types.FrameType} description (e.g. {@code "Native (remote)"}), or
* {@code null} if the frame type has no entry in the constant pool.
*/
public String typeDescription() {
return symbolString(value.get("type"));
}

/** The full name (e.g. {@code java.lang.String}) of the method's declaring type, or {@code null}. */
@SuppressWarnings("unchecked")
public String className() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, Datadog, Inc.
* Copyright 2025, 2026, Datadog, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -18,6 +18,7 @@
import com.datadoghq.profiler.JfrEvents;
import com.datadoghq.profiler.JfrFrame;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
Expand Down Expand Up @@ -121,6 +122,10 @@ public void testRemoteSymbolicationEnabled(@CStack String cstack) throws Excepti
testLibFrameCount++;
foundTestLibFrame = true;

// Regression: FRAME_NATIVE_REMOTE must have a label in the FrameType constant pool
assertEquals("Native (remote)", frame.typeDescription(),
"Remote frame type is missing from the jdk.types.FrameType constant pool");

// Print first remote frame for debugging
if (printCount == 0) {
System.out.println("=== First remote symbolication frame ===");
Expand Down Expand Up @@ -171,4 +176,4 @@ public void testRemoteSymbolicationEnabled(@CStack String cstack) throws Excepti
protected String getProfilerCommand() {
return "cpu=10ms,remotesym=true";
}
}
}
Loading