Skip to content

Conversation

@erieaton-amd
Copy link
Contributor

This PR accomplishes part of what #1155 does with fewer changes.

The work is split across three changes:

  • Replace GpuEvent with ZoneEvent: This is a smaller revision that accomplishes the removal of GpuEvent, while changing as little else as possible. It is hard to demonstrate the virtue of doing this without further changes; this patch does unify a few small functions.
  • Eliminate the function GetZoneCtx: This function turns out to be unnecessary, this patch introduces a helper struct to carry around the context which is also used in the next patch.
  • Merge the GetZoneColor functions: The GPU and CPU code is made to use the same code to determine zone color. The helper struct from the previous patch is used by the unified functions to distinguish CPU and GPU events. This allows GPU events to have a custom color (although the protocol doesn't allow it to be set yet).

Overall notes:

  • The file format is not changed.
  • The protocol is not changed.
  • The UI is changed because GPU zones now appear as a different color.
  • The original task of ensuring feature parity between GPU and CPU remains unfinished.
  • Compared to the previous PR, the ZoneExtra data is expanded only for GPU, saving some memory. Also, the previous PR eliminated the thread field but this doesn't. That uses more memory but avoids having to go search for the thread.

This replaces the GpuEvent struct with ZoneEvent and a GpuExtra data
type. This allows some common code to be merged, but since this is a
minimal implementation of the idea, only a few small things are merged
by this patch.
@wolfpld
Copy link
Owner

wolfpld commented Oct 8, 2025

How are GPU zone colors determined? With CPU zones thread id is used as a base for the color. What differentiates different GPU tracks?

@erieaton-amd
Copy link
Contributor Author

How are GPU zone colors determined? With CPU zones thread id is used as a base for the color. What differentiates different GPU tracks?

I realized there was an issue that was making the GPU zones always purple. I've posted a small change that makes the GPU zones' color match the CPU thread that is making the GPU calls.

Eric Eaton added 3 commits October 9, 2025 13:17
The function GetZoneCtx isn't needed. This patch introduces a small
structure to help transport the context around to avoid the expensive
search. The GPU timeline function take the context as a parameter now
instead of the thread ID, since the supplied thread ID is derived from
the context in every invocation.
This change has CPU and GPU use the same code to calculate zone
colors. This changes the UI because the GPU zones will have a different
color. The color of GPU zones will be set to match the CPU thread making
the GPU calls.
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