/* *Checkremainingflags.
*/ if (strstarts(cmd, CMD_EXEC_PATH)) {
cmd += strlen(CMD_EXEC_PATH); if (*cmd == '=')
set_argv_exec_path(cmd + 1); else {
puts(get_argv_exec_path()); exit(0);
}
} elseif (!strcmp(cmd, "--html-path")) {
puts(system_path(PERF_HTML_PATH)); exit(0);
} elseif (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
use_pager = 1;
} elseif (!strcmp(cmd, "--no-pager")) {
use_pager = 0; if (envchanged)
*envchanged = 1;
} elseif (!strcmp(cmd, "--debugfs-dir")) { if (*argc < 2) {
fprintf(stderr, "No directory given for --debugfs-dir.\n");
usage(perf_usage_string);
}
tracing_path_set((*argv)[1]); if (envchanged)
*envchanged = 1;
(*argv)++;
(*argc)--;
} elseif (!strcmp(cmd, "--buildid-dir")) { if (*argc < 2) {
fprintf(stderr, "No directory given for --buildid-dir.\n");
usage(perf_usage_string);
}
set_buildid_dir((*argv)[1]); if (envchanged)
*envchanged = 1;
(*argv)++;
(*argc)--;
} elseif (strstarts(cmd, CMD_DEBUGFS_DIR)) {
tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR));
fprintf(stderr, "dir: %s\n", tracing_path_mount()); if (envchanged)
*envchanged = 1;
} elseif (!strcmp(cmd, "--list-cmds")) { unsignedint i;
for (i = 0; i < ARRAY_SIZE(commands); i++) { struct cmd_struct *p = commands+i;
printf("%s ", p->cmd);
}
putchar('\n'); exit(0);
} elseif (!strcmp(cmd, "--list-opts")) { unsignedint i;
for (i = 0; i < ARRAY_SIZE(options)-1; i++) { struct option *p = options+i;
printf("--%s ", p->long_name);
}
putchar('\n'); exit(0);
} elseif (!strcmp(cmd, "--debug")) { if (*argc < 2) {
fprintf(stderr, "No variable specified for --debug.\n");
usage(perf_usage_string);
} if (perf_debug_option((*argv)[1]))
usage(perf_usage_string);
(*argv)++;
(*argc)--;
} elseif (!strcmp(cmd, "--debug-file")) { if (*argc < 2) {
fprintf(stderr, "No path given for --debug-file.\n");
usage(perf_usage_string);
}
if (set_debug_file((*argv)[1]))
usage(perf_usage_string);
status = p->fn(argc, argv);
perf_config__exit();
exit_browser(status);
if (status) return status & 0xff;
/* Somebody closed stdout? */ if (fstat(fileno(stdout), &st)) return0; /* Ignore write errors for pipes and sockets.. */ if (S_ISFIFO(st.st_mode) || S_ISSOCK(st.st_mode)) return0;
status = 1; /* Check for ENOSPC and EIO errors.. */ if (fflush(stdout)) {
fprintf(stderr, "write failure on standard output: %s",
str_error_r(errno, sbuf, sizeof(sbuf))); goto out;
} if (ferror(stdout)) {
fprintf(stderr, "unknown write failure on standard output"); goto out;
} if (fclose(stdout)) {
fprintf(stderr, "close failed on standard output: %s",
str_error_r(errno, sbuf, sizeof(sbuf))); goto out;
}
status = 0;
out: return status;
}
/* *ifwefailbecausethecommandisnotfound,itis *OKtoreturn.Otherwise,wejustpassalongthestatuscode.
*/
status = run_command_v_opt(argv, 0); if (status != -ERR_RUN_COMMAND_EXEC) { if (IS_RUN_COMMAND_ERR(status)) {
do_die:
pr_err("FATAL: unable to run '%s'", argv[0]);
status = -128;
} exit(-status);
}
errno = ENOENT; /* as if we called execvp */
argv[0] = tmp;
zfree(&cmd);
}
staticint run_argv(int *argcp, constchar ***argv)
{ /* See if it's an internal command */
handle_internal_command(*argcp, *argv);
/* .. then try the external ones */
execv_dashed_external(*argv); return0;
}
if (argc > 0) { if (strstarts(argv[0], "--"))
argv[0] += 2;
} else { /* The user didn't specify a command; give them help */
printf("\n usage: %s\n\n", perf_usage_string);
list_common_cmds_help();
printf("\n %s\n\n", perf_more_info_string); goto out;
}
cmd = argv[0];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.