aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-08-24 10:28:12 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-10-04 08:55:19 -0300
commitfeff0b61ffd831dbe4a7f28cfc8064b59c9f90c1 (patch)
treeb808ce7f9f6dcb6b9d5caded49751d5d4692fe86 /tools/perf/builtin-record.c
parentperf record: Fix done_fd wakeup event (diff)
downloadlinux-dev-feff0b61ffd831dbe4a7f28cfc8064b59c9f90c1.tar.xz
linux-dev-feff0b61ffd831dbe4a7f28cfc8064b59c9f90c1.zip
perf record: Change evlist->ctl_fd to use fdarray_flag__non_perf_event
Patch "perf record: Fix way of handling non-perf-event pollfds" added a generic way to handle non-perf-event file descriptors like evlist->ctl_fd. Use it instead of handling evlist->ctl_fd separately. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20220824072814.16422-4-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.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index bf6879a6ffa4..f6204b8f8a06 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1198,18 +1198,7 @@ static int record__alloc_thread_data(struct record *rec, struct evlist *evlist)
if (ret < 0)
goto out_free;
- if (evlist->ctl_fd.pos == -1)
- continue;
- ret = fdarray__dup_entry_from(&thread_data[t].pollfd, evlist->ctl_fd.pos,
- &evlist->core.pollfd);
- if (ret < 0) {
- pr_err("Failed to duplicate descriptor in main thread pollfd\n");
- goto out_free;
- }
- thread_data[t].ctlfd_pos = ret;
- pr_debug2("thread_data[%p]: pollfd[%d] <- ctl_fd=%d\n",
- thread_data, thread_data[t].ctlfd_pos,
- evlist->core.pollfd.entries[evlist->ctl_fd.pos].fd);
+ thread_data[t].ctlfd_pos = -1; /* Not used */
}
}
@@ -2614,8 +2603,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
err = record__update_evlist_pollfd_from_thread(rec, rec->evlist, thread);
if (err)
goto out_child;
- evlist__ctlfd_update(rec->evlist,
- &thread->pollfd.entries[thread->ctlfd_pos]);
}
if (evlist__ctlfd_process(rec->evlist, &cmd) > 0) {