]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gprofng/src/Command.cc
2.41 Release sources
[thirdparty/binutils-gdb.git] / gprofng / src / Command.cc
1 /* Copyright (C) 2021-2023 Free Software Foundation, Inc.
2 Contributed by Oracle.
3
4 This file is part of GNU Binutils.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
20
21 #include "config.h"
22 #include <string.h>
23 #include <stdlib.h>
24 #include <sys/param.h>
25
26 #include "gp-defs.h"
27 #include "Command.h"
28 #include "DbeSession.h"
29 #include "MemorySpace.h"
30 #include "i18n.h"
31 #include "StringBuilder.h"
32
33 const char *Command::DEFAULT_CMD = "default"; // token for default
34 const char *Command::ALL_CMD = "all"; // token for all
35 const char *Command::ANY_CMD = "any"; // token for any
36 const char *Command::NONE_CMD = "none"; // token for none
37 const char *Command::HWC_CMD = "hwc"; // token for all HWC
38 const char *Command::BIT_CMD = "bit"; // token for any bit-generated metric
39 const char *Command::DEFAULT_METRICS = "ei.user:name"; // if no .rc files read
40 const char *Command::DEFAULT_SORT = "e.user:name"; // if no .rc files read
41
42 static char *fhdr, *cchdr, *lahdr, *iohdr, *sdhdr, *lsthdr, *lohdr;
43 static char *methdr, *othdr, *mischdr, *deflthdr;
44 static char *selhdr, *filthdr, *outhdr, *exphdr, *obj_allhdr;
45 static char *unsuphdr, *indxobjhdr;
46 static char *helphdr, *rahdr, *ddhdr, *typehdr, *typehdr2;
47
48 // This is the list of commands, which governs the parser scan, as
49 // well as the help command.
50 // A line with the tag NO_CMD is skipped in parsing, but is used
51 // to provide subheadings for the help
52 // The HELP line must be the last one in the list of commands
53 // to be shown by "-help"; The HHELP line must be the
54 // last one to be shown by "-xhelp"
55 // The LAST_CMD line must be the last one recognized by the parser
56 //
57 // The ordering of this list should match the ordering in the man
58 // page, and the subheader lines should match the subheadings in
59 // the man page.
60
61 static char *desc[LAST_CMD];
62
63 static Cmdtable cmd_lst[] = { // list of commands
64 // User Commands
65 { NO_CMD, "", NULL, NULL, 0, &fhdr},
66 { FUNCS, "functions", NULL, NULL, 0, &desc[FUNCS]},
67 { METRICS, "metrics", NULL, "metric_spec", 1, &desc[METRICS]},
68 { SORT, "sort", NULL, "metric_spec", 1, &desc[SORT]},
69 { FDETAIL, "fsummary", NULL, NULL, 0, &desc[FDETAIL]},
70 { FSINGLE, "fsingle", NULL, "function_name #", 2, &desc[FSINGLE]},
71
72 { NO_CMD, "", NULL, NULL, 0, &cchdr},
73 { GPROF, "callers-callees", "gprof", NULL, 0, &desc[GPROF]},
74 { CSINGLE, "csingle", NULL, "function_name #", 2, &desc[CSINGLE]},
75 { CPREPEND, "cprepend", NULL, "function_name #", 2, &desc[CPREPEND]},
76 { CAPPEND, "cappend", NULL, "function_name #", 2, &desc[CAPPEND]},
77 { CRMFIRST, "crmfirst", NULL, NULL, 0, &desc[CRMFIRST]},
78 { CRMLAST, "crmlast", NULL, NULL, 0, &desc[CRMLAST]},
79 { CALLTREE, "calltree", "ctree", NULL, 0, &desc[CALLTREE]},
80
81 { NO_CMD, "", NULL, NULL, 0, &lahdr},
82 { LEAKS, "leaks", NULL, NULL, 0, &desc[LEAKS]},
83 { ALLOCS, "allocs", NULL, NULL, 0, &desc[ALLOCS]},
84 { HEAP, "heap", NULL, NULL, 0, &desc[HEAP]},
85 { HEAPSTAT, "heapstat", NULL, NULL, 0, &desc[HEAPSTAT]},
86
87 { NO_CMD, "", NULL, NULL, 0, &iohdr},
88 { IOACTIVITY, "ioactivity", NULL, NULL, 0, &desc[IOACTIVITY]},
89 { IOVFD, "iodetail", NULL, NULL, 0, &desc[IOVFD]},
90 { IOCALLSTACK, "iocallstack", NULL, NULL, 0, &desc[IOCALLSTACK]},
91 { IOSTAT, "iostat", NULL, NULL, 0, &desc[IOSTAT]},
92
93 // PC, line, source and dissassembly commands
94 { NO_CMD, "", NULL, NULL, 0, &sdhdr},
95 { HOTPCS, "pcs", NULL, NULL, 0, &desc[HOTPCS]},
96 { PDETAIL, "psummary", NULL, NULL, 0, &desc[PDETAIL]},
97 { HOTLINES, "lines", NULL, NULL, 0, &desc[HOTLINES]},
98 { LDETAIL, "lsummary", NULL, NULL, 0, &desc[LDETAIL]},
99 { SOURCE, "source", NULL, "func/file #", 2, &desc[SOURCE]},
100 { DISASM, "disasm", NULL, "func/file #", 2, &desc[DISASM]},
101 { SCOMPCOM, "scc", NULL, "com_spec", 1, &desc[SCOMPCOM]},
102 { STHRESH, "sthresh", NULL, "value", 1, &desc[STHRESH]},
103 { DCOMPCOM, "dcc", NULL, "com_spec", 1, &desc[DCOMPCOM]},
104 { COMPCOM, "cc", NULL, "com_spec", 1, &desc[COMPCOM]},
105 { DTHRESH, "dthresh", NULL, "value", 1, &desc[DTHRESH]},
106 { SETPATH, "setpath", NULL, "path_list", 1, &desc[SETPATH]},
107 { ADDPATH, "addpath", NULL, "path_list", 1, &desc[ADDPATH]},
108 { PATHMAP, "pathmap", NULL, "old_prefix new_prefix", 2, &desc[PATHMAP]},
109 { LIBDIRS, "preload_libdirs", NULL, NULL, 1, &desc[PATHMAP]},
110
111 // Index Object commands
112 { NO_CMD, "", NULL, NULL, 0, &indxobjhdr},
113 { INDXOBJ, "indxobj", NULL, "type", 1, &desc[INDXOBJ]},
114 { INDXOBJLIST, "indxobj_list", NULL, NULL, 0, &desc[INDXOBJLIST]},
115 { INDXOBJDEF, "indxobj_define", NULL, "type \"index-expr\"", 2, &desc[INDXOBJDEF]},
116
117 // Deadlock detection commands
118 { NO_CMD, "", NULL, NULL, 0, &ddhdr},
119 { DEADLOCK_EVNTS, "deadlocks", NULL, NULL, 0, &desc[DEADLOCK_EVNTS]},
120 { DEADLOCK_SUM, "dsummary", NULL, "{deadlock_id|all}", 1, &desc[DEADLOCK_SUM]},
121
122 { NO_CMD, "", NULL, NULL, 0, &lsthdr},
123 { EXP_LIST, "experiment_list", "exp_list", NULL, 0, &desc[EXP_LIST]},
124 { SAMPLE_LIST, "sample_list", NULL, NULL, 0, &desc[SAMPLE_LIST]},
125 { LWP_LIST, "lwp_list", NULL, NULL, 0, &desc[LWP_LIST]},
126 { THREAD_LIST, "thread_list", NULL, NULL, 0, &desc[THREAD_LIST]},
127 { CPU_LIST, "cpu_list", NULL, NULL, 0, &desc[CPU_LIST]},
128
129 { NO_CMD, "", NULL, NULL, 0, &filthdr},
130 { FILTERS, "filters", NULL, "filter-specification", 1, &desc[FILTERS]},
131 { DESCRIBE, "describe", NULL, NULL, 0, &desc[DESCRIBE]},
132
133 { NO_CMD, "", NULL, NULL, 0, &selhdr},
134 { SAMPLE_SELECT, "sample_select", NULL, "sample_spec", 1, &desc[SAMPLE_SELECT]},
135 { LWP_SELECT, "lwp_select", NULL, "lwp_spec", 1, &desc[LWP_SELECT]},
136 { THREAD_SELECT, "thread_select", NULL, "thread_spec", 1, &desc[THREAD_SELECT]},
137 { CPU_SELECT, "cpu_select", NULL, "cpu_spec", 1, &desc[CPU_SELECT]},
138
139 { NO_CMD, "", NULL, NULL, 0, &lohdr},
140 { OBJECT_LIST, "object_list", NULL, NULL, 0, &desc[OBJECT_LIST]},
141 { OBJECT_SHOW, "object_show", NULL, "obj1,...", 1, &desc[OBJECT_SHOW]},
142 { OBJECT_HIDE, "object_hide", NULL, "obj1,...", 1, &desc[OBJECT_HIDE]},
143 { OBJECT_API, "object_api", NULL, "obj1,...", 1, &desc[OBJECT_API]},
144 { DUMMY_CMD, " ", NULL, NULL, 0, &obj_allhdr},
145 { OBJECTS_DEFAULT, "objects_default", NULL, NULL, 1, &desc[OBJECTS_DEFAULT]},
146
147 { OBJECT_SELECT, "object_select", NULL, "obj1,...", 1, &desc[OBJECT_SELECT]},
148
149 { NO_CMD, "", NULL, NULL, 0, &methdr},
150 { METRIC_LIST, "metric_list", NULL, NULL, 0, &desc[METRIC_LIST]},
151 { GMETRIC_LIST, "cmetric_list", "gmetric_list", NULL, 0, &desc[GMETRIC_LIST]},
152 { INDX_METRIC_LIST, "indx_metric_list", NULL, NULL, 1, &desc[INDX_METRIC_LIST]},
153
154 { NO_CMD, "", NULL, NULL, 0, &outhdr},
155 { OUTFILE, "outfile", NULL, "filename", 1, &desc[OUTFILE]},
156 { APPENDFILE, "appendfile", NULL, "filename", 1, &desc[APPENDFILE]},
157 { LIMIT, "limit", NULL, "n", 1, &desc[LIMIT]},
158 { NAMEFMT, "name", NULL, "{long|short|mangled}[:{soname|nosoname}]", 1, &desc[NAMEFMT]},
159 { VIEWMODE, "viewmode", NULL, "{user|expert|machine}", 1, &desc[VIEWMODE]},
160 { COMPARE, "compare", NULL, "{on|off|delta|ratio}", 1, &desc[COMPARE]},
161 { PRINTMODE, "printmode", NULL, "string", 1, &desc[PRINTMODE]},
162
163 { NO_CMD, "", NULL, NULL, 0, &othdr},
164 { HEADER, "header", NULL, "exp_id", 1, &desc[HEADER]},
165 { OBJECTS, "objects", NULL, NULL, 0, &desc[OBJECTS]},
166 { OVERVIEW_NEW, "overview", NULL, NULL, 0, &desc[OVERVIEW_NEW]},
167 { SAMPLE_DETAIL, "sample_detail", NULL, "exp_id", 1, &desc[SAMPLE_DETAIL]},
168 { STATISTICS, "statistics", NULL, "exp_id", 1, &desc[STATISTICS]},
169
170 { NO_CMD, "", NULL, NULL, 0, &exphdr},
171 { OPEN_EXP, "open_exp", NULL, "experiment", 1, &desc[OPEN_EXP]},
172 { ADD_EXP, "add_exp", NULL, "experiment", 1, &desc[ADD_EXP]},
173 { DROP_EXP, "drop_exp", NULL, "experiment", 1, &desc[DROP_EXP]},
174
175 { NO_CMD, "", NULL, NULL, 0, &deflthdr},
176 { DMETRICS, "dmetrics", NULL, "metric_spec", 1, &desc[DMETRICS]},
177 { DSORT, "dsort", NULL, "metric_spec", 1, &desc[DSORT]},
178 { EN_DESC, "en_desc", NULL, "{on|off|=<regex>}", 1, &desc[EN_DESC]},
179
180 { NO_CMD, "", NULL, NULL, 0, &mischdr},
181 { DUMMY_CMD, "<type>", NULL, NULL, 0, &typehdr},
182 { DUMMY_CMD, " ", NULL, NULL, 0, &typehdr2},
183
184 { IFREQ, "ifreq", NULL, NULL, 0, &desc[IFREQ]},
185 { PROCSTATS, "procstats", NULL, NULL, 0, &desc[PROCSTATS]},
186 { SCRIPT, "script", NULL, "file", 1, &desc[SCRIPT]},
187 { VERSION_cmd, "version", NULL, NULL, 0, &desc[VERSION_cmd]},
188 { QUIT, "quit", "exit", NULL, 0, &desc[QUIT]},
189
190 { NO_CMD, "", NULL, NULL, 0, &helphdr},
191 { HELP, "help", NULL, NULL, 0, &desc[HELP]},
192
193 { NO_CMD, "", NULL, NULL, 0, &unsuphdr},
194 { HELP, "-help", NULL, NULL, 0, &desc[HELP]},
195 { DUMPFUNC, "dfuncs", NULL, "string", 1, &desc[DUMPFUNC]},
196 { DUMPDOBJS, "ddobjs", NULL, "string", 1, &desc[DUMPDOBJS]},
197 { DUMPNODES, "dnodes", NULL, NULL, 0, &desc[DUMPNODES]},
198 { DUMPSTACKS, "dstacks", NULL, NULL, 0, &desc[DUMPSTACKS]},
199 { DUMPUNK, "dunkpc", NULL, NULL, 0, &desc[DUMPUNK]},
200 { DUMPMAP, "dmap", NULL, NULL, 0, &desc[DUMPMAP]},
201 { DUMPENTITIES, "dentities", NULL, NULL, 0, &desc[DUMPENTITIES]},
202 { IGNORE_NO_XHWCPROF, "ignore_no_xhwcprof", NULL, NULL, 0, &desc[IGNORE_NO_XHWCPROF]},
203 { IGNORE_FS_WARN, "ignore_fs_warn", NULL, NULL, 0, &desc[IGNORE_FS_WARN]},
204
205 { DUMP_PROFILE, "dprofile", NULL, NULL, 0, &desc[DUMP_PROFILE]},
206 { DUMP_SYNC, "dsync", NULL, NULL, 0, &desc[DUMP_SYNC]},
207 { DUMP_IOTRACE, "diotrace", NULL, NULL, 0, &desc[DUMP_IOTRACE]},
208 { DUMP_HWC, "dhwc", NULL, NULL, 0, &desc[DUMP_HWC]},
209 { DUMP_HEAP, "dheap", NULL, NULL, 0, &desc[DUMP_HEAP]},
210 { RACE_ACCS, "r_accs", NULL, NULL, 0, &desc[RACE_ACCS]},
211
212 { DMPI_FUNCS, "dmpi_funcs", NULL, NULL, 0, &desc[DMPI_FUNCS]},
213 { DMPI_MSGS, "dmpi_msgs", NULL, NULL, 0, &desc[DMPI_MSGS]},
214 { DMPI_EVENTS, "dmpi_events", NULL, NULL, 0, &desc[DMPI_EVENTS]},
215
216 { DMEM, "dmem", NULL, NULL, 1, &desc[DMEM]},
217 { DUMP_GC, "dumpgc", NULL, NULL, 0, &desc[DUMP_GC]},
218 { DKILL, "dkill", NULL, NULL, 2, &desc[DKILL]},
219
220 { QQUIT, "xquit", NULL, NULL, 0, &desc[QQUIT]},
221 // use xquit for memory leak detection in dbe; it's
222 // like quit, but deletes all data loaded
223
224 { HHELP, "xhelp", NULL, NULL, 0, &desc[HHELP]},
225 { WHOAMI, "whoami", NULL, NULL, 0, NULL},
226
227 // these are not recognized at this point
228 { LOADOBJECT, "segments", "pmap", NULL, 0, &desc[LOADOBJECT]},
229 { LOADOBJECT_LIST, "segment_list", NULL, NULL, 0, &desc[LOADOBJECT_LIST]},
230 { LOADOBJECT_SELECT, "segment_select", NULL, "seg1,...", 1, &desc[LOADOBJECT_SELECT]},
231
232 { LAST_CMD, "xxxx", NULL, NULL, 0, NULL}
233 };
234
235 CmdType
236 Command::get_command (char *cmd, int &arg_count, int &cparam)
237 {
238 int i;
239 int len = (int) strlen (cmd);
240 bool got = false;
241 CmdType token = UNKNOWN_CMD;
242 arg_count = 0;
243 cparam = -1;
244 if (*cmd == '\0') // - command
245 return STDIN;
246 if (*cmd == '#') // comment
247 return COMMENT;
248 if (strcmp (cmd, "V") == 0 || strcmp (cmd, "-version") == 0)
249 return VERSION_cmd;
250 if (strcmp (cmd, "-help") == 0)
251 return HELP;
252 if (strncmp (cmd, NTXT ("-whoami="), 8) == 0)
253 {
254 cparam = 8;
255 return WHOAMI;
256 }
257
258 if (*cmd == '-')
259 cmd++;
260 for (i = 0;; i++)
261 {
262 if (cmd_lst[i].token == LAST_CMD)
263 break;
264 if (!strncasecmp (cmd, cmd_lst[i].str, len) ||
265 (cmd_lst[i].alt && !strncasecmp (cmd, cmd_lst[i].alt, len)))
266 {
267 // Is it unambiguous?
268 if (!strcasecmp (cmd, cmd_lst[i].str)
269 || (cmd_lst[i].alt && !strcasecmp (cmd, cmd_lst[i].alt)))
270 {
271 // exact, full-length match
272 token = cmd_lst[i].token;
273 arg_count = cmd_lst[i].arg_count;
274 return token;
275 }
276 if (got)
277 return AMBIGUOUS_CMD;
278 got = true;
279 token = cmd_lst[i].token;
280 arg_count = cmd_lst[i].arg_count;
281 }
282 }
283
284 // Did we find it?
285 if (token != UNKNOWN_CMD)
286 return token;
287
288 // See if it's the name of a index object
289 if (dbeSession)
290 {
291 int indxtype = dbeSession->findIndexSpaceByName (cmd);
292 if (indxtype >= 0)
293 {
294 // found it
295 cparam = indxtype;
296 return INDXOBJ;
297 }
298 }
299 return token;
300 }
301
302 const char *
303 Command::get_cmd_str (CmdType type)
304 {
305 for (int i = 0;; i++)
306 {
307 if (cmd_lst[i].token == LAST_CMD)
308 break;
309 if (type == cmd_lst[i].token)
310 return cmd_lst[i].str;
311 }
312 return "xxxx";
313 }
314
315 char *
316 Command::get_err_string (Cmd_status err)
317 {
318 switch (err)
319 {
320 case CMD_OK:
321 return NULL;
322 case CMD_BAD:
323 return GTXT ("command bad");
324 case CMD_AMBIGUOUS:
325 return GTXT ("command ambiguous");
326 case CMD_BAD_ARG:
327 return GTXT ("Invalid argument to command");
328 case CMD_OUTRANGE:
329 return GTXT ("argument to command is out-of-range");
330 case CMD_INVALID:
331 return GTXT ("invalid command");
332 }
333 return NULL;
334 }
335
336 void
337 Command::print_help (char *prog_name, bool cmd_line, bool usermode, FILE *outf)
338 {
339 char *fmt, *msg;
340 int i;
341 StringBuilder sb;
342 enum CmdType nc;
343 init_desc ();
344 if (usermode) // show the hidden ones, too
345 nc = HELP;
346 else
347 nc = HHELP;
348
349 if (cmd_line)
350 fprintf (outf, GTXT ("Usage: %s [ -script script | -command | - ] exper_1 ... exper_n\n"),
351 prog_name);
352 fprintf (outf, GTXT ("An alternate spelling for a command is shown in [], where applicable.\n\n"
353 "Those commands followed by a * may appear in .rc files.\n\n"
354 "Those commands followed by a $ can only appear in .rc files.\n\n"));
355 fmt = fmt_help (nc, ' ');
356 for (i = 0;; i++)
357 {
358 // check for end of list
359 if (cmd_lst[i].token == LAST_CMD)
360 break;
361 if (cmd_lst[i].token == NO_CMD) // this is a header line
362 fprintf (outf, NTXT (" %s\n"), *cmd_lst[i].desc);
363 else
364 {
365 if (strlen (cmd_lst[i].str) == 0)
366 continue;
367 // this is a real command line
368 sb.setLength (0);
369 sb.append (cmd_lst[i].str);
370 if (cmd_lst[i].alt)
371 {
372 sb.append ('[');
373 sb.append (cmd_lst[i].alt);
374 sb.append (']');
375 }
376 if (cmd_lst[i].arg)
377 {
378 sb.append (' ');
379 sb.append (cmd_lst[i].arg);
380 }
381 msg = sb.toString ();
382 fprintf (outf, fmt, msg, *cmd_lst[i].desc);
383 free (msg);
384 }
385 // check for end of list
386 if (cmd_lst[i].token == nc)
387 break;
388 }
389 }
390
391 // construct format for printing help
392 char *
393 Command::fmt_help (int nc, char head)
394 {
395 int len, max_len, i;
396 static char fmt[BUFSIZ];
397
398 max_len = 0;
399 for (i = 0; i < nc; i++)
400 {
401 len = (int) strlen (cmd_lst[i].str);
402 if (cmd_lst[i].alt)
403 len += (int) strlen (cmd_lst[i].alt) + 2;
404 if (cmd_lst[i].arg)
405 len += (int) strlen (cmd_lst[i].arg) + 2;
406 if (max_len < len)
407 max_len = len;
408 }
409 snprintf (fmt, sizeof (fmt), NTXT (" %c%%-%ds %%s\n"), head, max_len + 1);
410 return fmt;
411 }
412
413 void
414 Command::init_desc ()
415 {
416 if (desc[0] != NULL)
417 return;
418 desc[FUNCS] = GTXT ("display functions with current metrics");
419 desc[HOTPCS] = GTXT ("display hot PC's with current metrics");
420 desc[HOTLINES] = GTXT ("display hot lines with current metrics");
421 desc[FDETAIL] = GTXT ("display summary metrics for each function");
422 desc[OBJECTS] = GTXT ("display object list with errors or warnings");
423 desc[COMPARE] = GTXT ("enable comparison mode for experiments *");
424 desc[PRINTMODE] = GTXT ("set the mode for printing tables *");
425 desc[LDETAIL] = GTXT ("display summary metrics for each hot line");
426 desc[PDETAIL] = GTXT ("display summary metrics for each hot PC");
427 desc[SOURCE] = GTXT ("display annotated source for function/file");
428 desc[DISASM] = GTXT ("display annotated disassembly for function/file");
429 desc[SCOMPCOM] = GTXT ("set compiler commentary classes for source *");
430 desc[STHRESH] = GTXT ("set highlight threshold for source *");
431 desc[DCOMPCOM] = GTXT ("set compiler commentary classes for disasm *");
432 desc[COMPCOM] = GTXT ("set compiler commentary classes for both source and disasm *");
433 desc[DTHRESH] = GTXT ("set highlight threshold for disasm *");
434 desc[METRIC_LIST] = GTXT ("display the available metrics and dmetrics keywords");
435 desc[METRICS] = GTXT ("set a new list of metrics");
436 desc[SORT] = GTXT ("sort tables by the specified metric");
437 desc[GPROF] = GTXT ("display the callers-callees for each function");
438 desc[CALLTREE] = GTXT ("display the tree of function calls");
439 desc[CALLFLAME] = GTXT ("request calltree flame chart -- not a command, but used in the tabs command");
440 desc[GMETRIC_LIST] = GTXT ("display the available callers-callees metrics");
441 desc[FSINGLE] = GTXT ("display the summary metrics for specified function");
442 desc[CSINGLE] = GTXT ("display the callers-callees for the specified function");
443 desc[CPREPEND] = GTXT ("add specified function to the head of the callstack fragment");
444 desc[CAPPEND] = GTXT ("add specified function to the end of the callstack fragment");
445 desc[CRMFIRST] = GTXT ("remove the first function from the callstack fragment");
446 desc[CRMLAST] = GTXT ("remove the last function from the callstack fragment");
447 desc[LEAKS] = GTXT ("display memory leaks, aggregated by callstack");
448 desc[ALLOCS] = GTXT ("display allocations, aggregated by callstack");
449 desc[HEAP] = GTXT ("display memory allocations and leaks, aggregated by callstack");
450 desc[HEAPSTAT] = GTXT ("display heap statistics report");
451 desc[IOACTIVITY] = GTXT ("display I/O activity report, aggregated by file name");
452 desc[IOVFD] = GTXT ("display I/O activity report, aggregated by file descriptor");
453 desc[IOCALLSTACK] = GTXT ("display I/O activity report, aggregated by callstack");
454 desc[IOSTAT] = GTXT ("display I/O statistics report");
455 desc[RACE_ACCS] = GTXT ("dump race access events");
456 desc[DMPI_MSGS] = GTXT ("dump mpi messages");
457 desc[DMPI_FUNCS] = GTXT ("dump mpi function calls");
458 desc[DMPI_EVENTS] = GTXT ("dump mpi trace events");
459 desc[DMEM] = GTXT ("debug command for internal use");
460 desc[DUMP_GC] = GTXT ("dump Java garbage collector events");
461 desc[DKILL] = GTXT ("send process p signal s");
462 desc[DEADLOCK_EVNTS] = GTXT ("display deadlock events");
463 desc[DEADLOCK_SUM] = GTXT ("display summary for the deadlock event");
464 desc[HEADER] = GTXT ("display information about the experiment");
465 desc[OVERVIEW_NEW] = GTXT ("display the overview of all loaded experiments");
466 desc[SAMPLE_DETAIL] = GTXT ("display the current sample list with data");
467 desc[STATISTICS] = GTXT ("display the execution statistics data");
468 desc[EXP_LIST] = GTXT ("display the existing experiments");
469 desc[DESCRIBE] = GTXT ("describe recorded data and tokens available for filtering data");
470 desc[OBJECT_SHOW] = GTXT ("set load objects to show all functions *");
471 desc[OBJECT_HIDE] = GTXT ("set load objects to hide functions *");
472 desc[OBJECT_API] = GTXT ("set load objects to show API (entry point) only *");
473 desc[OBJECTS_DEFAULT] = GTXT ("reset load objects show to defaults");
474 desc[OBJECT_LIST] = GTXT ("display load objects, functions-shown flag");
475 desc[OBJECT_SELECT] = GTXT ("set list of load objects whose functions are shown");
476 desc[SAMPLE_LIST] = GTXT ("display the list of existing samples");
477 desc[SAMPLE_SELECT] = GTXT ("set a new list of samples");
478 desc[THREAD_LIST] = GTXT ("display the list of existing threads");
479 desc[THREAD_SELECT] = GTXT ("set a new list of threads");
480 desc[LWP_LIST] = GTXT ("display the list of existing LWPs");
481 desc[LWP_SELECT] = GTXT ("set a new list of LWPs");
482 desc[CPU_LIST] = GTXT ("display the list of CPUs");
483 desc[CPU_SELECT] = GTXT ("set a new list of CPUs");
484 desc[OUTFILE] = GTXT ("open filename for subsequent output");
485 desc[APPENDFILE] = GTXT ("open filename for subsequent appended output");
486 desc[LIMIT] = GTXT ("limit output to the first n entries (n=0 for no limit)");
487 desc[NAMEFMT] = GTXT ("set long/short/mangled names for functions *");
488 desc[VIEWMODE] = GTXT ("set viewmode user|expert|machine *");
489 desc[EN_DESC] = GTXT ("enable descendant processes on|off|regex matches lineage or program name $");
490 desc[SETPATH] = GTXT ("set search path for annotated src/dis");
491 desc[ADDPATH] = GTXT ("add search path for annotated src/dis *");
492 desc[PATHMAP] = GTXT ("remap path prefix for annotated src/dis *");
493 desc[LIBDIRS] = GTXT ("set path where the gprofng libraries are installed");
494 desc[SCRIPT] = GTXT ("read er_print commands from script file");
495 desc[PROCSTATS] = GTXT ("display processing statistics");
496 desc[ADD_EXP] = GTXT ("add experiment or group");
497 desc[DROP_EXP] = GTXT ("drop experiment");
498 desc[OPEN_EXP] = GTXT ("open experiment or group (drops all loaded experiments first)");
499 desc[VERSION_cmd] = GTXT ("display the current release version");
500 desc[HELP] = GTXT ("display the list of available commands");
501 desc[QUIT] = GTXT ("terminate processing and exit");
502 desc[DMETRICS] = GTXT ("set default function list metrics $");
503 desc[DSORT] = GTXT ("set default function list sort metric $");
504 desc[TLMODE] = GTXT ("set default timeline mode, align, depth $");
505 desc[TLDATA] = GTXT ("set default timeline visible data $");
506 desc[TABS] = GTXT ("set default visible tabs $");
507 desc[RTABS] = GTXT ("set default visible tabs for Thread Analyzer Experiment $");
508 desc[INDXOBJ] = GTXT ("display index objects of a specified type with current metrics");
509 desc[INDXOBJLIST] = GTXT ("display list of index objects");
510 desc[INDXOBJDEF] = GTXT ("define a new index object type *");
511 desc[INDX_METRIC_LIST] = GTXT ("display the available index object metrics");
512 desc[IFREQ] = GTXT ("display instruction-frequency report");
513 desc[TIMELINE] = GTXT ("request timeline -- not a command, but used in the tabs command");
514 desc[MPI_TIMELINE] = GTXT ("request mpi-timeline -- not a command, but used in the tabs command");
515 desc[MPI_CHART] = GTXT ("request mpi chart -- not a command, but used in the tabs command");
516 desc[DUALSOURCE] = GTXT ("request dualsource tab -- not a command, but used in the tabs command");
517 desc[SOURCEDISAM] = GTXT ("request source/disassembly tab -- not a command, but used in the tabs command");
518 desc[DUMPNODES] = GTXT ("dump pathtree node table");
519 desc[DUMPSTACKS] = GTXT ("dump Experiment callstack tables");
520 desc[DUMPUNK] = GTXT ("dump <Unknown> PCs");
521 desc[DUMPFUNC] = GTXT ("dump functions whose name matches string");
522 desc[DUMPDOBJS] = GTXT ("dump dataobjects whose name matches string");
523 desc[DUMPMAP] = GTXT ("dump load-object map");
524 desc[DUMPENTITIES] = GTXT ("dump threads, lwps, cpus");
525 desc[DUMP_PROFILE] = GTXT ("dump clock profile events");
526 desc[DUMP_SYNC] = GTXT ("dump synchronization trace events");
527 desc[DUMP_IOTRACE] = GTXT ("dump IO trace events");
528 desc[DUMP_HWC] = GTXT ("dump HWC profile events");
529 desc[DUMP_HEAP] = GTXT ("dump heap trace events");
530 desc[IGNORE_NO_XHWCPROF] = GTXT ("ignore absence of -xhwcprof info in dataspace profiling $");
531 desc[IGNORE_FS_WARN] = GTXT ("ignore filesystem (nfs, ...) warning $");
532 desc[HHELP] = GTXT ("display help including unsupported commands");
533 desc[QQUIT] = GTXT ("terminate processing and exit");
534 desc[LOADOBJECT] = GTXT ("display the address map with current metrics");
535 desc[LOADOBJECT_LIST] = GTXT ("display segments, indicating which are selected");
536 desc[LOADOBJECT_SELECT] = GTXT ("set a new list of segments");
537 desc[FILTERS] = GTXT ("define a filter");
538
539 fhdr = GTXT ("\nCommands controlling the function list:");
540 cchdr = GTXT ("\nCommands controlling the callers-callees and calltree lists:");
541 lahdr = GTXT ("\nCommands controlling the leak and allocation lists:");
542 iohdr = GTXT ("\nCommand controlling the I/O activity report:");
543 rahdr = GTXT ("\nCommands controlling the race events lists:");
544 ddhdr = GTXT ("\nCommands controlling the deadlock events lists:");
545 typehdr = GTXT ("equivalent to \"memobj type\", or \"indxobj type\"");
546 typehdr2 = GTXT (" where type is a memory object or index object type");
547 sdhdr = GTXT ("\nCommands controlling the source and disassembly listings:");
548 lsthdr = GTXT ("\nCommands listing experiments, samples and threads:");
549 lohdr = GTXT ("\nCommands controlling load object selection:");
550 obj_allhdr = GTXT (" the special object name `all' refers to all load objects");
551 methdr = GTXT ("\nCommands that list metrics:");
552 othdr = GTXT ("\nCommands that print other displays:");
553 outhdr = GTXT ("\nCommands that control output:");
554 mischdr = GTXT ("\nMiscellaneous commands:");
555 exphdr = GTXT ("\nCommands for experiments (scripts and interactive mode only):");
556 deflthdr = GTXT ("\nDefault-setting commands:");
557 selhdr = GTXT ("\nCommands controlling old-style filters/selection:");
558 filthdr = GTXT ("\nCommands controlling filters:");
559 indxobjhdr = GTXT ("\nCommands controlling the index objects:");
560 unsuphdr = GTXT ("\nUnsupported commands:");
561 helphdr = GTXT ("\nHelp command:");
562 }