diff options
author | Levi Yun <yeoreum.yun@arm.com> | 2024-09-25 14:20:21 +0100 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2024-09-25 15:58:42 -0700 |
commit | e880a70f8046df0dd9089fa60dcb866a2cc69194 (patch) | |
tree | 7f66c392be02be32cd60917a27585c041ab5fbc2 /tools/perf/util/evlist.h | |
parent | f115506d2ce4549df306746cd0b1c5d7bf6537f5 (diff) |
perf stat: Close cork_fd when create_perf_stat_counter() failed
When create_perf_stat_counter() failed, it doesn't close workload.cork_fd
open in evlist__prepare_workload(). This could make too many open file
error while __run_perf_stat() repeats.
Introduce evlist__cancel_workload to close workload.cork_fd and
wait workload.child_pid until exit to clear child process
when create_perf_stat_counter() is failed.
Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: nd@arm.com
Cc: howardchu95@gmail.com
Link: https://lore.kernel.org/r/20240925132022.2650180-2-yeoreum.yun@arm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/util/evlist.h')
-rw-r--r-- | tools/perf/util/evlist.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index bcc1c6984bb5..888fda751e1a 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -186,6 +186,7 @@ int evlist__prepare_workload(struct evlist *evlist, struct target *target, const char *argv[], bool pipe_output, void (*exec_error)(int signo, siginfo_t *info, void *ucontext)); int evlist__start_workload(struct evlist *evlist); +void evlist__cancel_workload(struct evlist *evlist); struct option; |