mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
perf evlist: Close fds on destructor
Since it is safe to call perf_evlist__close() multiple times, autoclose it and remove the calls to the close from existing tools, reducing the tooling boilerplate. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-2kq9v7p1rude1tqxa0aue2tk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
03ad9747c5
commit
f26e1c7cb2
11 changed files with 10 additions and 26 deletions
|
@ -89,7 +89,7 @@ int test__task_exit(void)
|
|||
if (perf_evlist__mmap(evlist, 128, true) < 0) {
|
||||
pr_debug("failed to mmap events: %d (%s)\n", errno,
|
||||
strerror(errno));
|
||||
goto out_close_evlist;
|
||||
goto out_delete_evlist;
|
||||
}
|
||||
|
||||
perf_evlist__start_workload(evlist);
|
||||
|
@ -113,8 +113,6 @@ retry:
|
|||
}
|
||||
|
||||
perf_evlist__munmap(evlist);
|
||||
out_close_evlist:
|
||||
perf_evlist__close(evlist);
|
||||
out_delete_evlist:
|
||||
perf_evlist__delete(evlist);
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue