|
@@ -34,6 +34,7 @@ type source struct {
|
34
|
34
|
Timeout int
|
35
|
35
|
Symbolize string
|
36
|
36
|
HTTPHostport string
|
|
37
|
+ Comment string
|
37
|
38
|
}
|
38
|
39
|
|
39
|
40
|
// Parse parses the command lines through the specified flags package
|
|
@@ -43,9 +44,11 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
|
43
|
44
|
flag := o.Flagset
|
44
|
45
|
// Comparisons.
|
45
|
46
|
flagBase := flag.StringList("base", "", "Source for base profile for comparison")
|
46
|
|
- // Internal options.
|
|
47
|
+ // Source options.
|
47
|
48
|
flagSymbolize := flag.String("symbolize", "", "Options for profile symbolization")
|
48
|
49
|
flagBuildID := flag.String("buildid", "", "Override build id for first mapping")
|
|
50
|
+ flagTimeout := flag.Int("timeout", -1, "Timeout in seconds for fetching a profile")
|
|
51
|
+ flagAddComment := flag.String("add_comment", "", "Annotation string to record in the profile")
|
49
|
52
|
// CPU profile options
|
50
|
53
|
flagSeconds := flag.Int("seconds", -1, "Length of time for dynamic profiles")
|
51
|
54
|
// Heap profile options
|
|
@@ -59,7 +62,6 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
|
59
|
62
|
flagMeanDelay := flag.Bool("mean_delay", false, "Display mean delay at each region")
|
60
|
63
|
flagTools := flag.String("tools", os.Getenv("PPROF_TOOLS"), "Path for object tool pathnames")
|
61
|
64
|
|
62
|
|
- flagTimeout := flag.Int("timeout", -1, "Timeout in seconds for fetching a profile")
|
63
|
65
|
flagHTTP := flag.String("http", "", "Present interactive web based UI at the specified http host:port")
|
64
|
66
|
|
65
|
67
|
// Flags used during command processing
|
|
@@ -135,6 +137,7 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
|
135
|
137
|
Timeout: *flagTimeout,
|
136
|
138
|
Symbolize: *flagSymbolize,
|
137
|
139
|
HTTPHostport: *flagHTTP,
|
|
140
|
+ Comment: *flagAddComment,
|
138
|
141
|
}
|
139
|
142
|
|
140
|
143
|
for _, s := range *flagBase {
|
|
@@ -278,6 +281,8 @@ var usageMsgSrc = "\n\n" +
|
278
|
281
|
" -seconds Duration for time-based profile collection\n" +
|
279
|
282
|
" -timeout Timeout in seconds for profile collection\n" +
|
280
|
283
|
" -buildid Override build id for main binary\n" +
|
|
284
|
+ " -add_comment Free-form annotation to add to the profile\n" +
|
|
285
|
+ " Displayed on some reports or with pprof -comments\n" +
|
281
|
286
|
" -base source Source of profile to use as baseline\n" +
|
282
|
287
|
" profile.pb.gz Profile in compressed protobuf format\n" +
|
283
|
288
|
" legacy_profile Profile in legacy pprof format\n" +
|