diff options
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 9c640a8081c7..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, |