(p *profile.Profile, ui plugin.UI)
| 179 | } |
| 180 | |
| 181 | func printCurrentOptions(p *profile.Profile, ui plugin.UI) { |
| 182 | var args []string |
| 183 | current := currentConfig() |
| 184 | for _, f := range configFields { |
| 185 | n := f.name |
| 186 | v := current.get(f) |
| 187 | comment := "" |
| 188 | switch { |
| 189 | case len(f.choices) > 0: |
| 190 | values := append([]string{}, f.choices...) |
| 191 | sort.Strings(values) |
| 192 | comment = "[" + strings.Join(values, " | ") + "]" |
| 193 | case n == "sample_index": |
| 194 | st := sampleTypes(p) |
| 195 | if v == "" { |
| 196 | // Apply default (last sample index). |
| 197 | v = st[len(st)-1] |
| 198 | } |
| 199 | // Add comments for all sample types in profile. |
| 200 | comment = "[" + strings.Join(st, " | ") + "]" |
| 201 | case n == "source_path": |
| 202 | continue |
| 203 | case n == "nodecount" && v == "-1": |
| 204 | comment = "default" |
| 205 | case v == "": |
| 206 | // Add quotes for empty values. |
| 207 | v = `""` |
| 208 | } |
| 209 | if n == "granularity" && v == "" { |
| 210 | v = "(default)" |
| 211 | } |
| 212 | if comment != "" { |
| 213 | comment = commentStart + " " + comment |
| 214 | } |
| 215 | args = append(args, fmt.Sprintf(" %-25s = %-20s %s", n, v, comment)) |
| 216 | } |
| 217 | sort.Strings(args) |
| 218 | ui.Print(strings.Join(args, "\n")) |
| 219 | } |
| 220 | |
| 221 | // parseCommandLine parses a command and returns the pprof command to |
| 222 | // execute and the configuration to use for the report. |
no test coverage detected
searching dependent graphs…