|
@@ -32,11 +32,12 @@ type source struct {
|
32
|
32
|
DiffBase bool
|
33
|
33
|
Normalize bool
|
34
|
34
|
|
35
|
|
- Seconds int
|
36
|
|
- Timeout int
|
37
|
|
- Symbolize string
|
38
|
|
- HTTPHostport string
|
39
|
|
- Comment string
|
|
35
|
+ Seconds int
|
|
36
|
+ Timeout int
|
|
37
|
+ Symbolize string
|
|
38
|
+ HTTPHostport string
|
|
39
|
+ HTTPDisableBrowser bool
|
|
40
|
+ Comment string
|
40
|
41
|
}
|
41
|
42
|
|
42
|
43
|
// parseFlags parses the command lines through the specified flags package
|
|
@@ -65,7 +66,8 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
|
65
|
66
|
flagMeanDelay := flag.Bool("mean_delay", false, "Display mean delay at each region")
|
66
|
67
|
flagTools := flag.String("tools", os.Getenv("PPROF_TOOLS"), "Path for object tool pathnames")
|
67
|
68
|
|
68
|
|
- flagHTTP := flag.String("http", "", "Present interactive web based UI at the specified http host:port")
|
|
69
|
+ flagHTTP := flag.String("http", "", "Present interactive web UI at the specified http host:port")
|
|
70
|
+ flagNoBrowser := flag.Bool("no_browser", false, "Skip opening a browswer for the interactive web UI")
|
69
|
71
|
|
70
|
72
|
// Flags used during command processing
|
71
|
73
|
installedFlags := installFlags(flag)
|
|
@@ -118,6 +120,10 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
|
118
|
120
|
return nil, nil, errors.New("-http is not compatible with an output format on the command line")
|
119
|
121
|
}
|
120
|
122
|
|
|
123
|
+ if *flagNoBrowser && *flagHTTP == "" {
|
|
124
|
+ return nil, nil, errors.New("-no_browser only makes sense with -http")
|
|
125
|
+ }
|
|
126
|
+
|
121
|
127
|
si := pprofVariables["sample_index"].value
|
122
|
128
|
si = sampleIndex(flagTotalDelay, si, "delay", "-total_delay", o.UI)
|
123
|
129
|
si = sampleIndex(flagMeanDelay, si, "delay", "-mean_delay", o.UI)
|
|
@@ -133,14 +139,15 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
|
133
|
139
|
}
|
134
|
140
|
|
135
|
141
|
source := &source{
|
136
|
|
- Sources: args,
|
137
|
|
- ExecName: execName,
|
138
|
|
- BuildID: *flagBuildID,
|
139
|
|
- Seconds: *flagSeconds,
|
140
|
|
- Timeout: *flagTimeout,
|
141
|
|
- Symbolize: *flagSymbolize,
|
142
|
|
- HTTPHostport: *flagHTTP,
|
143
|
|
- Comment: *flagAddComment,
|
|
142
|
+ Sources: args,
|
|
143
|
+ ExecName: execName,
|
|
144
|
+ BuildID: *flagBuildID,
|
|
145
|
+ Seconds: *flagSeconds,
|
|
146
|
+ Timeout: *flagTimeout,
|
|
147
|
+ Symbolize: *flagSymbolize,
|
|
148
|
+ HTTPHostport: *flagHTTP,
|
|
149
|
+ HTTPDisableBrowser: *flagNoBrowser,
|
|
150
|
+ Comment: *flagAddComment,
|
144
|
151
|
}
|
145
|
152
|
|
146
|
153
|
if err := source.addBaseProfiles(*flagBase, *flagDiffBase); err != nil {
|
|
@@ -327,9 +334,10 @@ var usageMsgSrc = "\n\n" +
|
327
|
334
|
|
328
|
335
|
var usageMsgVars = "\n\n" +
|
329
|
336
|
" Misc options:\n" +
|
330
|
|
- " -http Provide web based interface at host:port.\n" +
|
|
337
|
+ " -http Provide web interface at host:port.\n" +
|
331
|
338
|
" Host is optional and 'localhost' by default.\n" +
|
332
|
339
|
" Port is optional and a randomly available port by default.\n" +
|
|
340
|
+ " -no_browser Skip opening a browser for the interactive web UI.\n" +
|
333
|
341
|
" -tools Search path for object tools\n" +
|
334
|
342
|
"\n" +
|
335
|
343
|
" Legacy convenience options:\n" +
|