Lines Matching +full:stdout +full:- +full:path
6 * This is the main hub from which the sub-commands (perf stat,
14 #include "util/run-command.h"
15 #include "util/parse-events.h"
19 "perf [--version] [--help] COMMAND [ARGS]";
24 int use_browser = -1;
25 static int use_pager = -1;
35 if (!prefixcmp(var, "pager.") && !strcmp(var + 6, c->cmd)) in pager_command_config()
36 c->val = perf_config_bool(var, value); in pager_command_config()
40 /* returns 0 for "no pager", 1 for "use pager", and -1 for "not specified" */
45 c.val = -1; in check_pager_config()
53 if (!prefixcmp(var, "tui.") && !strcmp(var + 4, c->cmd)) in tui_command_config()
54 c->val = perf_config_bool(var, value); in tui_command_config()
58 /* returns 0 for "no tui", 1 for "use tui", and -1 for "not specified" */
63 c.val = -1; in check_tui_config()
88 if (cmd[0] != '-') in handle_options()
93 * commands can be written with "--" prepended in handle_options()
96 if (!strcmp(cmd, "--help") || !strcmp(cmd, "--version")) in handle_options()
110 } else if (!strcmp(cmd, "--html-path")) { in handle_options()
113 } else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) { in handle_options()
115 } else if (!strcmp(cmd, "--no-pager")) { in handle_options()
119 } else if (!strcmp(cmd, "--perf-dir")) { in handle_options()
121 fprintf(stderr, "No directory given for --perf-dir.\n"); in handle_options()
128 (*argc)--; in handle_options()
134 } else if (!strcmp(cmd, "--work-tree")) { in handle_options()
136 fprintf(stderr, "No directory given for --work-tree.\n"); in handle_options()
143 (*argc)--; in handle_options()
148 } else if (!strcmp(cmd, "--debugfs-dir")) { in handle_options()
150 fprintf(stderr, "No directory given for --debugfs-dir.\n"); in handle_options()
157 (*argc)--; in handle_options()
169 (*argc)--; in handle_options()
211 memmove(new_argv - option_count, new_argv, in handle_alias()
213 new_argv -= option_count; in handle_alias()
228 *argcp += count - 1; in handle_alias()
243 * require working tree to be present -- anything uses this needs
261 if (p->option & RUN_SETUP) in run_builtin()
264 if (use_browser == -1) in run_builtin()
265 use_browser = check_tui_config(p->cmd); in run_builtin()
267 if (use_pager == -1 && p->option & RUN_SETUP) in run_builtin()
268 use_pager = check_pager_config(p->cmd); in run_builtin()
269 if (use_pager == -1 && p->option & USE_PAGER) in run_builtin()
273 status = p->fn(argc, argv, prefix); in run_builtin()
279 /* Somebody closed stdout? */ in run_builtin()
280 if (fstat(fileno(stdout), &st)) in run_builtin()
287 if (fflush(stdout)) in run_builtin()
289 if (ferror(stdout)) in run_builtin()
291 if (fclose(stdout)) in run_builtin()
300 { "buildid-cache", cmd_buildid_cache, 0 }, in handle_internal_command()
301 { "buildid-list", cmd_buildid_list, 0 }, in handle_internal_command()
327 i = strlen(argv[0]) - strlen(ext); in handle_internal_command()
335 /* Turn "perf cmd --help" into "perf help cmd" */ in handle_internal_command()
336 if (argc > 1 && !strcmp(argv[1], "--help")) { in handle_internal_command()
343 if (strcmp(p->cmd, cmd)) in handle_internal_command()
355 strbuf_addf(&cmd, "perf-%s", argv[0]); in execv_dashed_external()
371 if (status != -ERR_RUN_COMMAND_EXEC) { in execv_dashed_external()
374 exit(-status); in execv_dashed_external()
394 /* It could be an alias -- this works around the insanity in run_argv()
430 cmd = "perf-help"; in main()
434 * "perf-xxxx" is the same as "perf xxxx", but we obviously: in main()
436 * - cannot take flags in between the "perf" and the "xxxx". in main()
437 * - cannot execute it externally (since it would just do in main()
443 if (!prefixcmp(cmd, "perf-")) { in main()
452 argc--; in main()
458 if (!prefixcmp(argv[0], "--")) in main()
470 * We use PATH to find perf commands, but we prepend some higher in main()
471 * precedence paths: the "--exec-path" option, the PERF_EXEC_PATH in main()
493 "'%s' is not a perf-command\n", in main()