GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JFR to OTLP converter by fandreuz · Pull Request #1336 · async-profiler/async-profiler

Conversation

@fandreuz

@fandreuz fandreuz commented Jun 11, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description

In this PR I add a JFR to OTLP converter.

Motivation and context

This piece of work was scheduled as part of the ongoing effort to integrate Async-Profiler with OTLP. Having an OTLP converter will allow our users to work with historical data.

How has this been tested?

Local testing: out_otlp.txt


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fandreuz added 5 commits June 11, 2025 16:36
@fandreuz
wip
cbf06ef
@fandreuz
cc
4720772
@fandreuz
wip
938f157
@fandreuz
fix bug
2785c1a
@fandreuz
fix original payload
1d86245
@fandreuz
fandreuz marked this pull request as ready for review June 12, 2025 16:03
@fandreuz
fandreuz requested a review from apangin June 12, 2025 16:03
fandreuz added 7 commits June 12, 2025 16:04
@fandreuz
fmt
3914121
@fandreuz
docs
a5e71ab
@fandreuz
cc
b8afbd9
@fandreuz
nn
f683168
@fandreuz
prettier
f66788a
@fandreuz
cc
09db68b
@fandreuz
final
2c9cead
apangin
apangin reviewed Jun 13, 2025
View reviewed changes
Comment thread src/converter/one/convert/Arguments.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/jfr/JfrReader.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/Otlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

fandreuz and others added 3 commits June 13, 2025 08:39
@fandreuz
move get*units to jfrconverter
97cbf40
Francesco Andreuzzi
enums for otlp stuff
abcbfbe
Francesco Andreuzzi
handle line number
e704de3
@fandreuz
fandreuz marked this pull request as draft June 13, 2025 09:31
Francesco Andreuzzi and others added 11 commits June 13, 2025 10:46
Francesco Andreuzzi
cc
4720354
Francesco Andreuzzi
handle emtpy
e67a4b7
Francesco Andreuzzi
OtlpConstants
da5e16f
Francesco Andreuzzi
add abort-marker frame type
25a545c
Francesco Andreuzzi
java 8
a79a96d
Francesco Andreuzzi
java 8
bcb2135
Francesco Andreuzzi
cc
73f3bb0
@fandreuz
ops
6d31d2a
@fandreuz
fix
3ad7857
@fandreuz
wip
8aeb5e1
Francesco Andreuzzi
nn
880b0ee
@fandreuz

fandreuz commented Jun 30, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Before this is merged, I'd like to tackle the problem which @Baraa-Hasheesh mentioned during the last demo. Moving to draft again.

I thought about this, I think we could have a flag allEvents which forces the JFR collector to collect all events. Then, each event from a given type will be part of a separate profile. This could be implemented in another PR. The current implementation handles only one type per call.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fandreuz
fandreuz marked this pull request as ready for review June 30, 2025 10:10
Baraa-Hasheesh
Baraa-Hasheesh reviewed Jul 2, 2025
View reviewed changes
Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

fandreuz
fandreuz commented Jul 2, 2025
View reviewed changes
Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

fandreuz added 2 commits July 2, 2025 09:03
@fandreuz
comment by bara
21dfb9b
Signed-off-by: Francesco Andreuzzi <[email protected]>
@fandreuz
Merge branch 'master' into jfr-to-otlp-converter
dbc5ecd
@fandreuz fandreuz mentioned this pull request Jul 2, 2025
Simplify location handling in OTLP #1361
Merged
apangin
apangin reviewed Jul 2, 2025
View reviewed changes
Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Outdated

proto.field(
SAMPLE_attribute_indices,
attributesPool.index(new KeyValue("thread.name", getThreadName(event.tid))));

@apangin apangin Jul 2, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

My gut feeling tells me this can be a bottleneck due to lots of garbage created on the hot path.
I'm not asking you to rewrite it, though: it will be an interesting exercise to profile this later on.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fandreuz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@fandreuz fandreuz Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sure will do, do you know any low overhead sampling profiler for Java that does not suffer from the Safepoint bias problem?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apangin and visheshruparelia reacted with laugh emoji
All reactions
  • 😄 2 reactions
fandreuz added 6 commits July 4, 2025 14:33
@fandreuz
nn
a5ae70a
@fandreuz
small large
fd01276
@fandreuz
fmt
fac1d97
@fandreuz
nanos
5b46e44
@fandreuz
comment
78c1f4e
@fandreuz
trigger
22f583f
apangin
apangin reviewed Jul 4, 2025
View reviewed changes
Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/JfrToOtlp.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/jfr/JfrReader.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

fandreuz added 5 commits July 4, 2025 17:09
@fandreuz
ops
13ebaae
@fandreuz
equals
a5a48ce
@fandreuz
no accessor
c1d2fb7
@fandreuz
overflow
1ce3213
@fandreuz
no boxing
0e1d0fa
apangin
apangin reviewed Jul 4, 2025
View reviewed changes
Comment thread src/converter/one/convert/JfrToOtlp.java Outdated

public JfrToOtlp(JfrReader jfr, Arguments args) {
super(jfr, args);
ticksPerNanosecond = jfr.ticksPerSec / 1_000_000_000.0;

@apangin apangin Jul 4, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No, move this to OtlpEventToSampleVisitor. This should not be cached across chunks, since chunks may have different ticksPerSec

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fandreuz fandreuz Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Ouch, I thought this was unique per JFR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fandreuz fandreuz Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

93679fc

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/converter/one/convert/JfrToOtlp.java Outdated
proto.field(PROFILE_duration_nanos, jfr.chunkDurationNanos());
}

public void dump(OutputStream out) throws IOException {

@apangin apangin Jul 4, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The method is lost somewhere in the middle between private methods.
Move it next to other public methods, either after constructor or before convert.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fandreuz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@fandreuz fandreuz Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

93679fc

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/converter/one/convert/JfrToOtlp.java Outdated
}

// Write location table
for (Line l : linePool.keys()) {

@apangin apangin Jul 4, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

You took my suggestion about shortening variable names too literally :)
line would be perfect here. l is not good as identifier - it resembles 1 or I.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fandreuz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@fandreuz fandreuz Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

93679fc

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fandreuz and others added 2 commits July 4, 2025 20:20
@fandreuz
review comments
93679fc
@apangin
Initialize constant at declaration
cd4b97a
@apangin
apangin merged commit 2b8dfff into async-profiler:master Jul 4, 2025
@apangin

apangin commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator

Good job, thanks!
Merged

fandreuz reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

visheshruparelia pushed a commit to visheshruparelia/async-profiler that referenced this pull request Jul 9, 2025
@fandreuz Vishesh Ruparelia
JFR to OTLP converter (async-profiler#1336)
1326362
visheshruparelia pushed a commit to visheshruparelia/async-profiler that referenced this pull request Jul 9, 2025
Vishesh Ruparelia
refactor to use hasDwarfTable()
08ee9c1
Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)

Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)
visheshruparelia pushed a commit to visheshruparelia/async-profiler that referenced this pull request Jul 9, 2025
Vishesh Ruparelia
refactor to use hasDwarfTable()
4ae1986
Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)

Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)
visheshruparelia pushed a commit to visheshruparelia/async-profiler that referenced this pull request Jul 9, 2025
Vishesh Ruparelia
refactor to use hasDwarfTable()
aa9aa5c
Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)

Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)
visheshruparelia pushed a commit to visheshruparelia/async-profiler that referenced this pull request Jul 9, 2025
Vishesh Ruparelia
refactor to use hasDwarfTable()
3c4c589
Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)

Disable JFR OldObjectSample event in jfrsync mode (async-profiler#1350)

Fix invalid alignment in mallocTracer and zero-init buf in getTotalCpuTime (async-profiler#1351)

C++ linting via clang-tidy (async-profiler#1338)

Allow cstack=vmx for native applications (async-profiler#1354)

Correctly unwind stack for malloc events in VM stack walking mode (async-profiler#1357)

Simplify location handling in OTLP (async-profiler#1361)

Suppress javac warnings when compiling tests

Do not include excess files in test.jar

Fix nonjava test failure on Alpine

Auto-generated clang-tidy review comments (async-profiler#1360)

JFR to OTLP converter (async-profiler#1336)

Cancel redundant in-progress GHA runs (async-profiler#1363)

Ensure that only files under `src/` are checked in `cpp-lint-diff` (async-profiler#1365)

Publish clang-tidy comments only for non-draft PRs (async-profiler#1367)

Give tests unique suffix names (async-profiler#1371)

Test OTLP output format (async-profiler#1331)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@apangin apangin apangin left review comments
+1 more reviewer
@Baraa-Hasheesh Baraa-Hasheesh Baraa-Hasheesh left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@fandreuz @apangin @Baraa-Hasheesh
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.