diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2020-09-03 15:29:37 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-09-04 22:11:16 +0300 |
commit | ee7fe31e6e264d748bec5378c4d5417e14019666 (patch) | |
tree | c0ae27125c8daa0e07eaf690100af1c9ce5d7cf6 /tools/perf/builtin-record.c | |
parent | 9818923634206b751192e8f1554ecb93874d7d9f (diff) | |
download | linux-ee7fe31e6e264d748bec5378c4d5417e14019666.tar.xz |
perf tools: Consolidate close_control_option()'s into one function
Consolidate control option fifo closing into one function.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Suggested-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200903122937.25691-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index d0f9f8107f47..adf311d15d3d 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -2253,16 +2253,6 @@ static int parse_control_option(const struct option *opt, return evlist__parse_control(str, &opts->ctl_fd, &opts->ctl_fd_ack, &opts->ctl_fd_close); } -static void close_control_option(struct record_opts *opts) -{ - if (opts->ctl_fd_close) { - opts->ctl_fd_close = false; - close(opts->ctl_fd); - if (opts->ctl_fd_ack >= 0) - close(opts->ctl_fd_ack); - } -} - static void switch_output_size_warn(struct record *rec) { u64 wakeup_size = evlist__mmap_size(rec->opts.mmap_pages); @@ -2849,7 +2839,7 @@ out: symbol__exit(); auxtrace_record__free(rec->itr); out_opts: - close_control_option(&rec->opts); + evlist__close_control(rec->opts.ctl_fd, rec->opts.ctl_fd_ack, &rec->opts.ctl_fd_close); return err; } |