X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tools%2Fperf%2Fbuiltin-report.c;h=95a47719aec302318defcb8de17fd8789012b819;hb=8f6644ca9737d118d80bffacc9ae940e713959c4;hp=32626ea3e2276b11279db88207e42c29eeed391a;hpb=0890a264794f33df540fbaf274699146903b4e6b;p=cascardo%2Flinux.git diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 32626ea3e227..95a47719aec3 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -742,6 +742,17 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) argc = parse_options(argc, argv, options, report_usage, 0); + if (symbol_conf.vmlinux_name && + access(symbol_conf.vmlinux_name, R_OK)) { + pr_err("Invalid file: %s\n", symbol_conf.vmlinux_name); + return -EINVAL; + } + if (symbol_conf.kallsyms_name && + access(symbol_conf.kallsyms_name, R_OK)) { + pr_err("Invalid file: %s\n", symbol_conf.kallsyms_name); + return -EINVAL; + } + if (report.use_stdio) use_browser = 0; else if (report.use_tui) @@ -828,8 +839,10 @@ repeat: if (report.header || report.header_only) { perf_session__fprintf_info(session, stdout, report.show_full_info); - if (report.header_only) - return 0; + if (report.header_only) { + ret = 0; + goto error; + } } else if (use_browser == 0) { fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n", stdout);