Lines Matching refs:argv
170 static int handle_options(const char ***argv, int *argc, int *envchanged) in handle_options() argument
175 const char *cmd = (*argv)[0]; in handle_options()
192 (*argv)[0] = "--help"; in handle_options()
197 (*argv)[0] = "--version"; in handle_options()
202 (*argv)[0] = "version"; in handle_options()
232 tracing_path_set((*argv)[1]); in handle_options()
235 (*argv)++; in handle_options()
242 set_buildid_dir((*argv)[1]); in handle_options()
245 (*argv)++; in handle_options()
275 if (perf_debug_option((*argv)[1])) in handle_options()
278 (*argv)++; in handle_options()
285 (*argv)++; in handle_options()
295 static int run_builtin(struct cmd_struct *p, int argc, const char **argv) in run_builtin() argument
311 perf_env__set_cmdline(&perf_env, argc, argv); in run_builtin()
312 status = p->fn(argc, argv); in run_builtin()
349 static void handle_internal_command(int argc, const char **argv) in handle_internal_command() argument
351 const char *cmd = argv[0]; in handle_internal_command()
355 if (argc > 1 && !strcmp(argv[1], "--help")) { in handle_internal_command()
356 argv[1] = argv[0]; in handle_internal_command()
357 argv[0] = cmd = "help"; in handle_internal_command()
364 exit(run_builtin(p, argc, argv)); in handle_internal_command()
368 static void execv_dashed_external(const char **argv) in execv_dashed_external() argument
374 if (asprintf(&cmd, "perf-%s", argv[0]) < 0) in execv_dashed_external()
383 tmp = argv[0]; in execv_dashed_external()
384 argv[0] = cmd; in execv_dashed_external()
390 status = run_command_v_opt(argv, 0); in execv_dashed_external()
394 pr_err("FATAL: unable to run '%s'", argv[0]); in execv_dashed_external()
401 argv[0] = tmp; in execv_dashed_external()
405 static int run_argv(int *argcp, const char ***argv) in run_argv() argument
408 handle_internal_command(*argcp, *argv); in run_argv()
411 execv_dashed_external(*argv); in run_argv()
439 int main(int argc, const char **argv) in main() argument
451 cmd = extract_argv0_path(argv[0]); in main()
479 argv[0] = cmd; in main()
480 handle_internal_command(argc, argv); in main()
486 argv[0] = cmd; in main()
491 argv[0] = "trace"; in main()
492 return cmd_trace(argc, argv); in main()
500 argv++; in main()
502 handle_options(&argv, &argc, NULL); in main()
506 if (strstarts(argv[0], "--")) in main()
507 argv[0] += 2; in main()
515 cmd = argv[0]; in main()
538 run_argv(&argc, &argv); in main()
544 cmd = argv[0] = help_unknown_cmd(cmd); in main()