Browse Source

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

They were thrashing pprof's output
Raul Silvera 9 years ago
parent
commit
ab2ad3d69d
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      internal/binutils/addr2liner_nm.go

+ 2
- 1
internal/binutils/addr2liner_nm.go View File

@@ -61,7 +61,7 @@ func newAddr2LinerNM(cmd, file string, base uint64) (*addr2LinerNM, error) {
61 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 65
 	// Skip lines we fail to parse.
66 66
 	buf := bufio.NewReader(&b)
67 67
 	for {
@@ -72,6 +72,7 @@ func newAddr2LinerNM(cmd, file string, base uint64) (*addr2LinerNM, error) {
72 72
 			}
73 73
 			return nil, err
74 74
 		}
75
+		line = strings.TrimSpace(line)
75 76
 		fields := strings.SplitN(line, " ", 3)
76 77
 		if len(fields) != 3 {
77 78
 			continue