aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 971ff91b16cb..c859e59dfe3e 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -371,14 +371,16 @@ static int perf_session__check_output_opt(struct perf_session *session)
371 371
372 if (!no_callchain) { 372 if (!no_callchain) {
373 bool use_callchain = false; 373 bool use_callchain = false;
374 bool not_pipe = false;
374 375
375 evlist__for_each_entry(session->evlist, evsel) { 376 evlist__for_each_entry(session->evlist, evsel) {
377 not_pipe = true;
376 if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) { 378 if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) {
377 use_callchain = true; 379 use_callchain = true;
378 break; 380 break;
379 } 381 }
380 } 382 }
381 if (!use_callchain) 383 if (not_pipe && !use_callchain)
382 symbol_conf.use_callchain = false; 384 symbol_conf.use_callchain = false;
383 } 385 }
384 386
@@ -1690,8 +1692,13 @@ static int list_available_scripts(const struct option *opt __maybe_unused,
1690 snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path()); 1692 snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path());
1691 1693
1692 scripts_dir = opendir(scripts_path); 1694 scripts_dir = opendir(scripts_path);
1693 if (!scripts_dir) 1695 if (!scripts_dir) {
1694 return -1; 1696 fprintf(stdout,
1697 "open(%s) failed.\n"
1698 "Check \"PERF_EXEC_PATH\" env to set scripts dir.\n",
1699 scripts_path);
1700 exit(-1);
1701 }
1695 1702
1696 for_each_lang(scripts_path, scripts_dir, lang_dirent) { 1703 for_each_lang(scripts_path, scripts_dir, lang_dirent) {
1697 snprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path, 1704 snprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
@@ -2116,7 +2123,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
2116 "Valid types: hw,sw,trace,raw. " 2123 "Valid types: hw,sw,trace,raw. "
2117 "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," 2124 "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
2118 "addr,symoff,period,iregs,brstack,brstacksym,flags," 2125 "addr,symoff,period,iregs,brstack,brstacksym,flags,"
2119 "callindent", parse_output_fields), 2126 "bpf-output,callindent", parse_output_fields),
2120 OPT_BOOLEAN('a', "all-cpus", &system_wide, 2127 OPT_BOOLEAN('a', "all-cpus", &system_wide,
2121 "system-wide collection from all CPUs"), 2128 "system-wide collection from all CPUs"),
2122 OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]", 2129 OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]",