Repository navigation
native: count frames on the pprof server - #1010
Merged
Merged
Conversation
A CPU profile of a real window shows where a frame's time goes, never how many frames there are, and the window's cost is frames times that. /debug/vars on the LICH_NATIVE_PPROF address now carries the frames drawn since the window opened; two reads apart give the rate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Measuring the window's GPU and CPU cost this week, the one number a profile never gave was the frame rate: a CPU profile says where a frame's time goes,
nvidia-smisays what the process costs, and neither says how many frames per second the window is drawing. Every rig run needed a throwaway counter patched intomain.go; the real window could not be measured at all.What
/debug/varson theLICH_NATIVE_PPROFaddress servesframes, anexpvarcounting the frames drawn since the window opened. Two reads a few seconds apart give the rate:Nothing listens unless
LICH_NATIVE_PPROFis set, as before.docs/native-window.mdnames it.Test plan
TestPprofServesTheFrameCountnative/: gofmt,go vet ./...,go test ./...