microsoft / microsoft/perfview
ThreadID is uint64 in nettrace v4, but handled as int in EventPipeEventSource.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.7k
- Forks
- 775
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 9
Description
There is currently a downcast of ThreadID read from nettrace v4 into a int. On platforms using pointers as thread id's, there is a risk we will get negative thread id's showing up in SpeedScope and Perfview. It doesn't seem to break anything, but looks "wrong" when displayed and could in theory cause collisions on 64-bit systems (below is from a 32-bit Arm Android trace):

What we probably need to do is changing ThreadID to a long (unlong to match nettrace v4) from here, https://github.com/microsoft/perfview/blob/8a34d2d64bc958902b2fa8ea5799437df57d8de2/src/TraceEvent/EventPipe/EventPipeEventSource.cs#L1485 and all the way up the parsing logic.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/TraceEvent/EventPipe/EventPipeEventSource.cs around line 1485 and follow the ThreadID parsing logic upward and downstream. Trace the type through the relevant EventPipe and display paths, then verify that nettrace v4 thread IDs remain representable without negative values or collisions in SpeedScope and PerfView.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100