Add async-profiler skill for Java profiling 🤖🤖🤖#1400
Add async-profiler skill for Java profiling 🤖🤖🤖#1400vetler wants to merge 30 commits intogithub:stagedfrom
Conversation
🔍 Skill Validator Results✅ All checks passed
Summary
Full validator output```text Found 1 skill(s) [async-profiler] 📊 async-profiler: 1,491 BPE tokens [chars/4: 1,589] (detailed ✓), 12 sections, 3 code blocks ✅ All checks passed (1 skill(s)) ``` |
There was a problem hiding this comment.
Pull request overview
Adds a new async-profiler skill under skills/async-profiler/ to guide Java developers through installing async-profiler, running profiling sessions (including agent-friendly background capture), and analyzing outputs (flamegraphs/JFR/collapsed stacks), and registers the skill in docs/README.skills.md.
Changes:
- Introduces async-profiler skill docs: setup, profiling workflows, and output analysis guidance.
- Adds helper scripts for install/run/background collection plus a Python collapsed-stack analyzer.
- Updates
docs/README.skills.mdto include the new skill entry.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/async-profiler/SKILL.md | Skill entry-point and routing to setup/profile/analyze sub-guides. |
| skills/async-profiler/README.md | Human-readable overview and installation notes. |
| skills/async-profiler/setup/SKILL.md | Installation/configuration instructions and troubleshooting. |
| skills/async-profiler/profile/SKILL.md | How to run profiles, including collect.sh background workflows. |
| skills/async-profiler/analyze/SKILL.md | How to interpret flamegraphs/JFR/collapsed stacks. |
| skills/async-profiler/scripts/install.sh | Platform-detecting async-profiler installer. |
| skills/async-profiler/scripts/run_profile.sh | Convenience wrapper for one-shot profiles + (intended) JFR splitting. |
| skills/async-profiler/scripts/collect.sh | Start/stop/timed background collection workflow with JFR splitting. |
| skills/async-profiler/scripts/analyze_collapsed.py | CLI analyzer for .collapsed files. |
| docs/README.skills.md | Adds the skill to the repository skills index. |
e97338d to
3fa7ee5
Compare
vetler
left a comment
There was a problem hiding this comment.
All 9 review comments have been addressed in an amended commit (3fa7ee5). Summary of changes:
python→python3inrun_profile.shpost-run guidancefrom __future__ import annotationsadded toanalyze_collapsed.pyto restore Python 3.7+ compatibility (PEP 585 generics)jfrconv --event alloc→jfrconv --allocinanalyze/SKILL.md- Install path comment in
install.shupdated to~/async-profiler-4.3 - Bash syntax in
collect.shsplit_jfr: separated& local pid_X=$!onto two lines asprof stopnow passes-f "$jfr_path"so on Linux the JFR lands at the expected path; macOS sentinel workaround is unchangedrun_profile.shcomprehensive mode fixed to use--cpu/--alloc/--wall/--lockinstead of--event cpuetc.collect.sh timeddocs corrected to-d 60 <PID>(flag before target)- Output filenames in
profile/SKILL.mdcorrected toprofile-cpu.html,profile-alloc.html, etc.
3fa7ee5 to
7204e5b
Compare
|
Fixed all 7 review comments:
|
7204e5b to
fd6e431
Compare
|
Fixed 3 of 4 review comments; the 4th is already handled:
|
|
@all-contributors add @vetler for skills |
|
I couldn't determine any contributions to add, did you specify any contributions? |
|
@all-contributors add @vetler for 🧰 |
|
I couldn't determine any contributions to add, did you specify any contributions? |
|
@all-contributors add @vetler for skill |
|
I couldn't determine any contributions to add, did you specify any contributions? |
fd6e431 to
b334294
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
skills/async-profiler/references/setup.md:1
- The manual install section hard-codes
v4.3URLs in multiple places. Sincescripts/install.shpins the version and will likely change over time, these URLs will become stale unless updated in lockstep. Consider either (a) using a<VERSION>placeholder and explicitly instructing readers to substitute the version used inscripts/install.sh, or (b) pointing readers to the GitHub Releases page for the current version rather than embedding version-specific URLs.
# async-profiler Setup
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| # Note: on macOS, -f is silently ignored by asprof stop — handled below. | ||
| "$asprof" stop -f "$jfr_path" "$TARGET" | ||
| # Session file is removed only after the JFR is confirmed written (see end of block). | ||
|
|
||
| # ── macOS JFR path workaround ──────────────────────────────────────────── | ||
| # On macOS, asprof stop ignores -f and writes the JFR to: | ||
| # /var/folders/<hash>/T/<timestamp>_<pid>/<timestamp>.jfr | ||
| # Use the sentinel (created at 'start') to find the file via find -newer. | ||
| if [[ "$(uname)" == "Darwin" ]] && [[ -n "$sentinel" ]] && [[ -f "$sentinel" ]]; then | ||
| echo "" | ||
| echo "⚠️ macOS: -f is ignored by asprof stop — locating JFR in /var/folders..." |
| if [[ -n "$found_jfr" ]]; then | ||
| cp "$found_jfr" "$jfr_path" | ||
| rm -f "$sentinel" | ||
| echo " Found: $found_jfr" | ||
| echo " Copied to: $jfr_path" |
| echo " Output : $OUTPUT" | ||
| $THREADS && echo " Threads : separate" | ||
| echo "" | ||
| echo "▶ ${CMD[*]}" |
What this adds
A skill for installing, running, and analyzing async-profiler for Java — a low-overhead sampling profiler that produces flamegraphs, JFR recordings, and allocation profiles.
Why it's useful
async-profiler is a niche, specialized tool with platform-specific quirks that frontier models don't reliably handle:
asprofCLI flags and syntaxasprof stop -foutput-path bug)-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints)Structure
Validation
npm run skill:validate✅npm run build✅