26 lines
687 B
Go
26 lines
687 B
Go
package cachegrind
|
|
|
|
// Profile holds the parsed contents of a cachegrind file.
|
|
type Profile struct {
|
|
Cmd string
|
|
Events []string
|
|
Functions []*Function
|
|
ByName map[string][]*Function // one name may appear in multiple files
|
|
}
|
|
|
|
// Function represents a single profiled function with aggregated inclusive costs.
|
|
type Function struct {
|
|
Name string
|
|
File string
|
|
Costs []int64 // one entry per Profile.Events; inclusive (includes callees)
|
|
Calls []*Call // outgoing call edges
|
|
CalledBy []*Call // incoming call edges
|
|
}
|
|
|
|
// Call is a directed call edge between two functions.
|
|
type Call struct {
|
|
Caller *Function
|
|
Callee *Function
|
|
Count int64
|
|
Costs []int64
|
|
}
|