浏览代码

Get rid of newlines at the end of function names from nm symbolization

They were thrashing pprof's output
Raul Silvera 9 年前
父节点
当前提交
ab2ad3d69d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      internal/binutils/addr2liner_nm.go

+ 2
- 1
internal/binutils/addr2liner_nm.go 查看文件

61
 		return nil, err
61
 		return nil, err
62
 	}
62
 	}
63
 
63
 
64
-	// Parse addr2line output and populate symbol map.
64
+	// Parse nm output and populate symbol map.
65
 	// Skip lines we fail to parse.
65
 	// Skip lines we fail to parse.
66
 	buf := bufio.NewReader(&b)
66
 	buf := bufio.NewReader(&b)
67
 	for {
67
 	for {
72
 			}
72
 			}
73
 			return nil, err
73
 			return nil, err
74
 		}
74
 		}
75
+		line = strings.TrimSpace(line)
75
 		fields := strings.SplitN(line, " ", 3)
76
 		fields := strings.SplitN(line, " ", 3)
76
 		if len(fields) != 3 {
77
 		if len(fields) != 3 {
77
 			continue
78
 			continue