Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllocationTick event is missing on NativeAOT #103198

Closed
noahfalk opened this issue Jun 8, 2024 · 2 comments · Fixed by #103200
Closed

AllocationTick event is missing on NativeAOT #103198

noahfalk opened this issue Jun 8, 2024 · 2 comments · Fixed by #103200
Assignees
Milestone

Comments

@noahfalk
Copy link
Member

noahfalk commented Jun 8, 2024

Description

For CLR and CoreCLR, .NET supports AllocationTick events. CoreCLR is currently on version 4 of the event though the docs only mention version 3 right now.

NativeAOT has the GC code ifdefed to only trigger the v1 version of AllocationTick:

#ifdef FEATURE_NATIVEAOT
FIRE_EVENT(GCAllocationTick_V1, (uint32_t)allocation_amount, (uint32_t)gen_to_oh (gen_number));
#else

However it also has an empty method body in the runtime code which receives this event so nothing is logged:
void GCToCLREventSink::FireGCAllocationTick_V1(uint32_t allocationAmount,
uint32_t allocationKind)
{
}

We discovered this while investigating for the new AllocationSampled event that is being added #100356

I'm mostly just filing the issue to document the absence of this event given other docs didn't appear specific about which events are supported and which are not. The event would generally be used by allocation profilers. In the future profilers may switch over to the new AllocationSampled event so I don't know that its particularly important to support AllocationTick, but its likely current allocation profilers don't work because of its absence. 

Reproduction Steps

Use an ETW or EventPipe profiler to listen to GC verbose events, run any NativeAOT app that does a bunch of allocation.

Expected behavior

AllocationTick events would be emitted

Actual behavior

AllocationTick events are not emitted

Regression?

Don't know, but probably not.

Known Workarounds

In the future, use the AllocationSampled event instead. For now you could try not compiling the app as NativeAOT, profile it with a tool that supports CoreCLR, and hope that it has a similar allocation pattern.

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jun 8, 2024
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@noahfalk
Copy link
Member Author

noahfalk commented Jun 8, 2024

fyi @brianrob

jkotas added a commit to jkotas/runtime that referenced this issue Jun 8, 2024
@agocke agocke added this to the 9.0.0 milestone Jun 10, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Jun 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants