WriteProfile writes a profile to a file at the given path.
(path string, prof *profile.Profile)
| 203 | |
| 204 | // WriteProfile writes a profile to a file at the given path. |
| 205 | func WriteProfile(path string, prof *profile.Profile) error { |
| 206 | w, err := os.Create(path) |
| 207 | if err != nil { |
| 208 | return err |
| 209 | } |
| 210 | defer w.Close() |
| 211 | return prof.Write(w) |
| 212 | } |
| 213 | |
| 214 | type symbolizer interface { |
| 215 | // Locations returns a list of function locations for a given program |