Skip to content

Update async-profiler to v3.0g2#1044

Open
mlim19 wants to merge 3 commits into
masterfrom
async-profiler-v3.0g2
Open

Update async-profiler to v3.0g2#1044
mlim19 wants to merge 3 commits into
masterfrom
async-profiler-v3.0g2

Conversation

@mlim19

@mlim19 mlim19 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Update async-profiler from v3.0g1 to v3.0g2
  • Adds support for tracking Java thread renames in samples

This allows accurate thread name attribution when threads are renamed during profiling (e.g., in thread pools, reactive frameworks like Netty/Project Reactor).

Changes in async-profiler v3.0g2:

  • Enable capturing thread names for every sample
  • Use atomic builtins for thread-safe name index access
  • Add compile-time checks for encoding constraints
  • Log warning when thread name table capacity is reached

Test plan

  • Build gprofiler with the new async-profiler version
  • Profile a Java application that uses thread pools
  • Verify thread names are correctly attributed in flame graphs

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 16, 2026 00:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the pinned async-profiler build version used by gprofiler’s shared-library build script to pick up async-profiler v3.0g2, enabling improved thread-name attribution when Java threads are renamed during profiling.

Changes:

  • Bump async-profiler version from v3.0g1 to v3.0g2.
  • Update the pinned async-profiler git revision to the corresponding commit SHA.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dkorlovs dkorlovs force-pushed the async-profiler-v3.0g2 branch from af581ec to 1d57fc5 Compare June 16, 2026 00:26
This version adds support for tracking Java thread renames in samples,
allowing accurate thread name attribution when threads are renamed
during profiling (e.g., in thread pools).

Changes in async-profiler v3.0g2:
- Enable capturing thread names for every sample
- Use atomic builtins for thread-safe name index access
- Add compile-time checks for encoding constraints
- Log warning when thread name table capacity is reached

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mlim19

mlim19 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/rerun

dkorlovs
dkorlovs previously approved these changes Jun 16, 2026
Copilot AI review requested due to automatic review settings June 16, 2026 18:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread gprofiler/profilers/java.py Outdated
Comment on lines +1068 to +1072
ProfilerArgument(
"--java-collect-thread-names",
dest="java_collect_thread_names",
action="store_true",
default=False,
@dkorlovs dkorlovs force-pushed the async-profiler-v3.0g2 branch from 71a11a2 to c95c29f Compare June 16, 2026 18:43
Copilot AI review requested due to automatic review settings June 16, 2026 18:53
@dkorlovs dkorlovs force-pushed the async-profiler-v3.0g2 branch from c95c29f to c491f8b Compare June 16, 2026 18:53
Signed-off-by: Min Yeol Lim <min.yeol.lim@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment on lines 39 to 45
lower_profiler_name = profiler_name.lower()
profiler_mode = user_args.get(f"{lower_profiler_name}_mode")
if is_profiler_disabled(cast(str, profiler_mode)):
# Warn if Java-specific options are set but Java profiling is disabled
if profiler_name == "Java" and user_args.get("java_collect_thread_names"):
logger.warning("--java-collect-thread-names is ignored because Java profiling is disabled")
continue
self._collect_meminfo = collect_meminfo
self._include_method_modifiers = ",includemm" if include_method_modifiers else ""
self._include_line_numbers = ",includeln" if java_line_numbers == "line-of-function" else ""
self._threads_enabled = ",threads" if collect_thread_names else ""
Comment on lines +1001 to +1009
ProfilerArgument(
"--java-collect-thread-names",
dest="java_collect_thread_names",
action="store_true",
default=False,
help="Enable per-sample thread name tracking. When enabled, each stack trace sample records "
"the thread name at sample time, allowing accurate attribution when threads are renamed "
"(e.g., in thread pools). Adds ~256KB memory and periodic thread name polling overhead.",
),
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.

3 participants