...
1
2
3
4
5 package pprof
6
7 import (
8 "errors"
9 )
10
11
12
13
14
15 func (b *profileBuilder) readMapping() {
16 if !machVMInfo(b.addMapping) {
17 b.addMappingEntry(0, 0, 0, "", "", true)
18 }
19 }
20
21 func readMainModuleMapping() (start, end uint64, exe, buildID string, err error) {
22 first := true
23 ok := machVMInfo(func(lo, hi, off uint64, file, build string) {
24 if first {
25 start, end = lo, hi
26 exe, buildID = file, build
27 }
28
29
30 first = false
31 })
32 if !ok {
33 return 0, 0, "", "", errors.New("machVMInfo failed")
34 }
35 return start, end, exe, buildID, nil
36 }
37
View as plain text