profileShortcuts creates macros for convenience and backward compatibility.
(p *profile.Profile)
| 159 | |
| 160 | // profileShortcuts creates macros for convenience and backward compatibility. |
| 161 | func profileShortcuts(p *profile.Profile) shortcuts { |
| 162 | s := pprofShortcuts |
| 163 | // Add shortcuts for sample types |
| 164 | for _, st := range p.SampleType { |
| 165 | command := fmt.Sprintf("sample_index=%s", st.Type) |
| 166 | s[st.Type] = []string{command} |
| 167 | s["total_"+st.Type] = []string{"mean=0", command} |
| 168 | s["mean_"+st.Type] = []string{"mean=1", command} |
| 169 | } |
| 170 | return s |
| 171 | } |
| 172 | |
| 173 | func sampleTypes(p *profile.Profile) []string { |
| 174 | types := make([]string, len(p.SampleType)) |
no outgoing calls
no test coverage detected
searching dependent graphs…