Skip to content

Conversation

@mangod9
Copy link
Member

@mangod9 mangod9 commented Sep 20, 2024

Fix an issue while collecting threadId which might not work for NativeAOT. This was included as part of the recent instrumentation changes.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

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

LGTM and thanks so much!

#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) && !defined(_DEBUG) && !defined(FEATURE_NATIVEAOT)
int bgc_thread_os_id = 0;

if (bgc_thread)
Copy link
Member

Choose a reason for hiding this comment

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

This magic 0x130 constant is going to break in number of different scenarios. For example, mix and match standalone GC scenarios are going to break too.

How long do we expect to keep it?

Copy link
Member

Choose a reason for hiding this comment

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

I'm planning to make this into a GCToEEInterface call in main and possibly backport to 9.0 in a servicing release.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should do the proper change now.

Copy link
Member

Choose a reason for hiding this comment

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

I'm only intending to use this with 9.0 so I'm fine not supporting mix/match standalone GC. other than coreclr actually changing the Thread object, how else can this break?

Copy link
Member Author

Choose a reason for hiding this comment

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

should we also consider instrumenting under a special config?

Copy link
Member

Choose a reason for hiding this comment

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

yep, we can put this under a config.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok I can add that, just this piece or the entire instrumentation change?

Copy link
Member

Choose a reason for hiding this comment

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

I would only do the config for this. thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

added a config check for it.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM.

@mangod9 mangod9 merged commit c582320 into dotnet:main Sep 20, 2024
88 of 90 checks passed
@mangod9
Copy link
Member Author

mangod9 commented Sep 20, 2024

/backport to release/9.0

@github-actions
Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10967167214

@mangod9
Copy link
Member Author

mangod9 commented Sep 20, 2024

/backport to release/9.0-rc2

@github-actions
Copy link
Contributor

Started backporting to release/9.0-rc2: https://github.com/dotnet/runtime/actions/runs/10967792225

sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
* dont try to capture threadId for NativeAOT

* add config to capture bgc threadid
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants