KEMBAR78
Add signal correlation API with thread-local buffer approach by adinazugravescu · Pull Request #1436 · async-profiler/async-profiler · GitHub
Skip to content

Conversation

@adinazugravescu
Copy link
Contributor

Description

Add API methods to correlate profiling samples with OpenTelemetry trace and span IDs.Not ready for review.

Related issues

N/A

Motivation and context

N/A

How has this been tested?

N/A


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

Adina Zugrvescu and others added 2 commits August 29, 2025 15:28
ProfilesData data = dumpAndGetProfile(profiler);
profiler.stop();

assert data.getDictionary().getLinkTableCount() == 1 : data.getDictionary().getLinkTableList().toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unexpected(?) Where is the link table coming from, since we restarted the profiler and the span context info is gone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should still have the empty link for samples without trace context

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, thanks

u64 Profiler::recordSample(void* ucontext, u64 counter, EventType event_type, Event* event) {
atomicInc(_total_samples);

if (_last_epoch != _epoch) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure this should be read with some level of synchronization, but you can leave it as it is for now.

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.

2 participants