commit
efc768ada6
|
@ -576,7 +576,8 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M
|
||||||
if len(field) < 2 {
|
if len(field) < 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
v := strings.Trim(field[1], " kB") // remove last "kB"
|
v := strings.Trim(field[1], "kB") // remove last "kB"
|
||||||
|
v = strings.TrimSpace(v)
|
||||||
t, err := strconv.ParseUint(v, 10, 64)
|
t, err := strconv.ParseUint(v, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return m, err
|
return m, err
|
||||||
|
@ -610,11 +611,11 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M
|
||||||
|
|
||||||
blocks := make([]string, 16)
|
blocks := make([]string, 16)
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
field := strings.Split(line, " ")
|
fields := strings.Fields(line)
|
||||||
if strings.HasSuffix(field[0], ":") == false {
|
if len(fields) > 0 && !strings.HasSuffix(fields[0], ":") {
|
||||||
// new block section
|
// new block section
|
||||||
if len(blocks) > 0 {
|
if len(blocks) > 0 {
|
||||||
g, err := getBlock(field, blocks)
|
g, err := getBlock(fields, blocks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &ret, err
|
return &ret, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue