@@ -86,6 +86,7 @@ func main() {
86
86
fmt .Fprintf (os .Stderr , "%s: unknown command %s\n " , os .Args [0 ], cmd )
87
87
fmt .Fprintf (os .Stderr , "Run 'corelib help' for usage.\n " )
88
88
os .Exit (2 )
89
+
89
90
case "overview" :
90
91
t := tabwriter .NewWriter (os .Stdout , 0 , 0 , 1 , ' ' , 0 )
91
92
fmt .Fprintf (t , "arch\t %s\n " , p .Arch ())
@@ -96,6 +97,7 @@ func main() {
96
97
}
97
98
fmt .Fprintf (t , "memory\t %.1f MB\n " , float64 (total )/ (1 << 20 ))
98
99
t .Flush ()
100
+
99
101
case "mappings" :
100
102
t := tabwriter .NewWriter (os .Stdout , 0 , 0 , 1 , ' ' , tabwriter .AlignRight )
101
103
fmt .Fprintf (t , "min\t max\t perm\t source\t original\t \n " )
@@ -125,6 +127,7 @@ func main() {
125
127
fmt .Fprintf (t , "\t \n " )
126
128
}
127
129
t .Flush ()
130
+
128
131
case "goroutines" :
129
132
130
133
for _ , g := range c .Goroutines () {
@@ -144,6 +147,7 @@ func main() {
144
147
fmt .Printf (" %016x %016x %s%s\n " , f .Min (), f .Max (), f .Func ().Name (), adj )
145
148
}
146
149
}
150
+
147
151
case "histogram" :
148
152
// Produce an object histogram (bytes per type).
149
153
type bucket struct {
@@ -188,17 +192,6 @@ func main() {
188
192
t .Flush ()
189
193
190
194
case "breakdown" :
191
- var total int64
192
- c .ForEachObject (func (x * gocore.Object ) bool {
193
- total += x .Size
194
- return true
195
- })
196
- alloc := c .Stats ().Child ("heap" ).Child ("in use spans" ).Child ("alloc" )
197
- alloc .Children = []* gocore.Stats {
198
- & gocore.Stats {"live" , total , nil },
199
- & gocore.Stats {"garbage" , alloc .Size - total , nil },
200
- }
201
-
202
195
t := tabwriter .NewWriter (os .Stdout , 0 , 8 , 1 , ' ' , tabwriter .AlignRight )
203
196
all := c .Stats ().Size
204
197
var printStat func (* gocore.Stats , string )
@@ -217,8 +210,8 @@ func main() {
217
210
}
218
211
printStat (c .Stats (), "" )
219
212
t .Flush ()
220
- case "objgraph" :
221
213
214
+ case "objgraph" :
222
215
// Dump object graph to output file.
223
216
w , err := os .Create ("tmp.dot" )
224
217
if err != nil {
@@ -273,6 +266,7 @@ func main() {
273
266
})
274
267
fmt .Fprintf (w , "}" )
275
268
w .Close ()
269
+
276
270
case "objects" :
277
271
c .ForEachObject (func (x * gocore.Object ) bool {
278
272
fmt .Printf ("%16x %s\n " , x .Addr , typeName (x ))
0 commit comments