OLD | NEW |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Package pprof writes runtime profiling data in the format expected | 5 // Package pprof writes runtime profiling data in the format expected |
6 // by the pprof visualization tool. | 6 // by the pprof visualization tool. |
7 // For more information about pprof, see | 7 // For more information about pprof, see |
8 // http://code.google.com/p/google-perftools/. | 8 // http://code.google.com/p/google-perftools/. |
9 package pprof | 9 package pprof |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 fmt.Fprintf(b, "# Mallocs = %d\n", s.Mallocs) | 81 fmt.Fprintf(b, "# Mallocs = %d\n", s.Mallocs) |
82 | 82 |
83 fmt.Fprintf(b, "# HeapAlloc = %d\n", s.HeapAlloc) | 83 fmt.Fprintf(b, "# HeapAlloc = %d\n", s.HeapAlloc) |
84 fmt.Fprintf(b, "# HeapSys = %d\n", s.HeapSys) | 84 fmt.Fprintf(b, "# HeapSys = %d\n", s.HeapSys) |
85 fmt.Fprintf(b, "# HeapIdle = %d\n", s.HeapIdle) | 85 fmt.Fprintf(b, "# HeapIdle = %d\n", s.HeapIdle) |
86 fmt.Fprintf(b, "# HeapInuse = %d\n", s.HeapInuse) | 86 fmt.Fprintf(b, "# HeapInuse = %d\n", s.HeapInuse) |
87 | 87 |
88 fmt.Fprintf(b, "# Stack = %d / %d\n", s.StackInuse, s.StackSys) | 88 fmt.Fprintf(b, "# Stack = %d / %d\n", s.StackInuse, s.StackSys) |
89 fmt.Fprintf(b, "# MSpan = %d / %d\n", s.MSpanInuse, s.MSpanSys) | 89 fmt.Fprintf(b, "# MSpan = %d / %d\n", s.MSpanInuse, s.MSpanSys) |
90 fmt.Fprintf(b, "# MCache = %d / %d\n", s.MCacheInuse, s.MCacheSys) | 90 fmt.Fprintf(b, "# MCache = %d / %d\n", s.MCacheInuse, s.MCacheSys) |
91 fmt.Fprintf(b, "# MHeapMapSys = %d\n", s.MHeapMapSys) | |
92 fmt.Fprintf(b, "# BuckHashSys = %d\n", s.BuckHashSys) | 91 fmt.Fprintf(b, "# BuckHashSys = %d\n", s.BuckHashSys) |
93 | 92 |
94 fmt.Fprintf(b, "# NextGC = %d\n", s.NextGC) | 93 fmt.Fprintf(b, "# NextGC = %d\n", s.NextGC) |
95 fmt.Fprintf(b, "# PauseNs = %d\n", s.PauseNs) | 94 fmt.Fprintf(b, "# PauseNs = %d\n", s.PauseNs) |
96 fmt.Fprintf(b, "# NumGC = %d\n", s.NumGC) | 95 fmt.Fprintf(b, "# NumGC = %d\n", s.NumGC) |
97 fmt.Fprintf(b, "# EnableGC = %v\n", s.EnableGC) | 96 fmt.Fprintf(b, "# EnableGC = %v\n", s.EnableGC) |
98 fmt.Fprintf(b, "# DebugGC = %v\n", s.DebugGC) | 97 fmt.Fprintf(b, "# DebugGC = %v\n", s.DebugGC) |
99 | 98 |
100 fmt.Fprintf(b, "# BySize = Size * (Active = Mallocs - Frees)\n") | 99 fmt.Fprintf(b, "# BySize = Size * (Active = Mallocs - Frees)\n") |
101 fmt.Fprintf(b, "# (Excluding large blocks.)\n") | 100 fmt.Fprintf(b, "# (Excluding large blocks.)\n") |
102 for _, t := range s.BySize { | 101 for _, t := range s.BySize { |
103 if t.Mallocs > 0 { | 102 if t.Mallocs > 0 { |
104 fmt.Fprintf(b, "# %d * (%d = %d - %d)\n", t.Size, t.Ma
llocs-t.Frees, t.Mallocs, t.Frees) | 103 fmt.Fprintf(b, "# %d * (%d = %d - %d)\n", t.Size, t.Ma
llocs-t.Frees, t.Mallocs, t.Frees) |
105 } | 104 } |
106 } | 105 } |
107 return b.Flush() | 106 return b.Flush() |
108 } | 107 } |
OLD | NEW |