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

Fetch thread names from ruby when outputting #1

Closed
wants to merge 1 commit into from

Conversation

dalehamel
Copy link
Owner

@dalehamel dalehamel commented Feb 23, 2024

Problem

It looks like nothing actually sets the thread name, so the tracks in firefox-profiler will not show any name:

Screenshot 2024-02-23 at 1 24 39 PM

Checking out the json file that is going into this, the thread name is "". If no name was every set, this is expected. However if a name was set, it is still not making it to the gecko output.

I originally suspected jhawthorn#46, but this is happening for me (on ruby 3.3.0) even with older gems (0.3.0, 0.3.1) that tried to get it from the pthread. In any case, the code to get this from the native extension is currently commented out and nothing seems to set it anywhere.

Proposed solution

Since we store the object id for the thread, we can use this to look up the thread and get its name.

If no name was ever set, I think it is still better to give the thread a name in the output so that the dropdown will be more intuitive. With this proposed change, here is what the output looks like:

Screenshot 2024-02-23 at 1 28 22 PM

The unnamed threads are distinguished by the thread's object id, which is kind of an arbitrary decision but seems like a reasonable default.

@dalehamel
Copy link
Owner Author

wrong base repo, see jhawthorn#54

@dalehamel dalehamel closed this Feb 23, 2024
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.

1 participant