Documentation
¶
Overview ¶
Package profiling provides statistics typs for helping to record the amount of load a source function, line, etc. has over a period of one frame. It also keeps track of the average load and maximum load over an extended period of time.
In addition, package profiling defines a Focus type and values. Useful in helping to understand when a function or line of code (for example) has executed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FocusOptions = []string{"All", "VBLANK", "Screen", "Overscan"}
List of Focus values as strings
Functions ¶
This section is empty.
Types ¶
type Focus ¶
type Focus int
Focus values are used to indicate when (very broadly) a function, a line of code, etc. has executed
type Load ¶
type Load struct {
// cycle count
FrameCount float32
AverageCount float32
MaxCount float32
// cycle count expressed as a percentage
Frame float32
Average float32
Max float32
// whether the corresponding values are valid
FrameValid bool
AverageValid bool
MaxValid bool
}
Load records the frame (or current) load as well as the average and maximum load.
type Stats ¶
type Stats struct {
OverProgram Load
OverFunction Load
// cycle count this frame
Count float32
// contains filtered or unexported fields
}
Stats records the cycle count over time and can be used to the frame (or current) load as well as average and maximum load.
The actual percentage values are accessed through the OverProgram and OverFunction fields. These fields provide the necessary scale by which the load is measured.
The validity of the OverProgram and OverFunction fields depends on context. For instance, for the SourceFunction type, the corresponding OverFunction field is invalid. For the Source type meanwhile, neither field is valid.
For the SourceLine type however, both OverProgram and OverFunction can be used to provide a different scaling to the load values.
func (*Stats) HasExecuted ¶
HasExecuted returns true if the statistics have ever been updated. ie. the source associated with this statistic has ever executed.
Not to be confused with the FrameValid, AverageValid and MaxValid fields of the Load type.
type StatsGroup ¶
type StatsGroup struct {
// cycle statistics for the entire program
Overall Stats
// kernel specific cycle statistics for the program. accumulated only once TV is stable
VBLANK Stats
Screen Stats
Overscan Stats
}
StatsGroup collates the Stats instance for all kernel views of the program.