Skip to content

Test case: for verifying main(String[]), run() method of Thread and its subclasses are marked entry frames - #742

Merged
zhengyu123 merged 2 commits into
mainfrom
zgu/entry_frame_test
Aug 19, 2026
Merged

Test case: for verifying main(String[]), run() method of Thread and its subclasses are marked entry frames#742
zhengyu123 merged 2 commits into
mainfrom
zgu/entry_frame_test

Conversation

@zhengyu123

@zhengyu123 zhengyu123 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?:
This PR is a test case for https://datadoghq.atlassian.net/browse/PROF-15782 and https://datadoghq.atlassian.net/browse/PROF-15781

Motivation:
Improve test coverage.

Additional Notes:

How to test the change?:
New test successfully verifies that void main(String[]), void run() of Thread and its subclasses are entry frames.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-15783

Unsure? Have a question? Request a review!

@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Scan-Build Report

User:runner@runnervmzvulz
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 all
Clang Version:Ubuntu clang version 18.1.3 (1ubuntu1)
Date:Tue Aug 18 14:24:55 2026

Bug Summary

Bug TypeQuantityDisplay?
All Bugs1
Logic error
Dereference of null pointer1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Logic errorDereference of null pointerprofiler.hfindLibraryByAddress52328

@zhengyu123 zhengyu123 changed the title Test case: for verifying main(String[]), run() method of Thread and i… Test case: for verifying main(String[]), run() method of Thread and its subclasses are marked entry frames Aug 18, 2026
@zhengyu123
zhengyu123 requested a lite review from Copilot August 18, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new integration-style JFR test to validate that stack traces are (not) marked truncated depending on whether the bottom Java frame is a recognized thread entry point, along with the supporting workload and clarifying stack-frame ordering docs.

Changes:

  • Added EntryFrameTest to assert truncation behavior for known entry points vs non-entry frames under shallow jstackdepth.
  • Extended ExternalLauncher with an entry-frames workload that burns CPU on three different thread entry paths.
  • Clarified JfrStackTrace.frames() Javadoc to document actual frame ordering as written by Recording::writeStackTraces.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
ddprof-test/src/test/java/com/datadoghq/profiler/jfr/EntryFrameTest.java New test validating truncated semantics by bottom frame across multiple entry points and a negative control.
ddprof-test/src/test/java/com/datadoghq/profiler/JfrStackTrace.java Updates documentation to match actual frame ordering used by the new test logic.
ddprof-test/src/test/java/com/datadoghq/profiler/ExternalLauncher.java Adds an entry-frames workload to generate samples rooted at specific entry frames for the new test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ddprof-test/src/test/java/com/datadoghq/profiler/jfr/EntryFrameTest.java Outdated
@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #32147945178 | Commit: 102fced | Duration: 14m 32s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-08-18 15:06:47 UTC

@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 570311d4

@zhengyu123
zhengyu123 marked this pull request as ready for review August 18, 2026 14:33
@zhengyu123
zhengyu123 requested a review from a team as a code owner August 18, 2026 14:33
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 570311d | Docs | View more details | Give us feedback!

@zhengyu123
zhengyu123 requested review from jbachorik and kaahos August 18, 2026 20:18

@kaahos kaahos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thanks!

@jbachorik jbachorik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

BTW, this is exactly the kind of PRs when it's ok to merge without going through formal review. Localized, low impact, easy to review with tools.

@zhengyu123
zhengyu123 merged commit dbd05f3 into main Aug 19, 2026
185 of 186 checks passed
@zhengyu123
zhengyu123 deleted the zgu/entry_frame_test branch August 19, 2026 14:21
@github-actions github-actions Bot added this to the 1.50.0 milestone Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants