err = __cmd_record(&record, argc, argv);
perf_evlist__munmap(rec->evlist);
- perf_evlist__close(rec->evlist);
out_symbol_exit:
symbol__exit();
return err;
err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false);
if (err < 0) {
fprintf(trace->output, "Couldn't mmap the events: %s\n", strerror(errno));
- goto out_close_evlist;
+ goto out_delete_evlist;
}
perf_evlist__enable(evlist);
}
perf_evlist__munmap(evlist);
-out_close_evlist:
- perf_evlist__close(evlist);
out_delete_evlist:
perf_evlist__delete(evlist);
out:
out_err:
if (evlist) {
perf_evlist__munmap(evlist);
- perf_evlist__close(evlist);
perf_evlist__delete(evlist);
} else {
cpu_map__delete(cpus);
if (evlist) {
perf_evlist__disable(evlist);
perf_evlist__munmap(evlist);
- perf_evlist__close(evlist);
perf_evlist__delete(evlist);
} else {
cpu_map__delete(cpus);
evsels[i] = perf_evsel__newtp("syscalls", name);
if (evsels[i] == NULL) {
pr_debug("perf_evsel__new\n");
- goto out_free_evlist;
+ goto out_delete_evlist;
}
evsels[i]->attr.wakeup_events = 1;
pr_debug("failed to open counter: %s, "
"tweak /proc/sys/kernel/perf_event_paranoid?\n",
strerror(errno));
- goto out_close_fd;
+ goto out_delete_evlist;
}
nr_events[i] = 0;
if (perf_evlist__mmap(evlist, 128, true) < 0) {
pr_debug("failed to mmap events: %d (%s)\n", errno,
strerror(errno));
- goto out_close_fd;
+ goto out_delete_evlist;
}
for (i = 0; i < nsyscalls; ++i)
out_munmap:
perf_evlist__munmap(evlist);
-out_close_fd:
- for (i = 0; i < nsyscalls; ++i)
- perf_evsel__close_fd(evsels[i], 1, threads->nr);
-out_free_evlist:
+out_delete_evlist:
perf_evlist__delete(evlist);
cpus = NULL;
threads = NULL;
err = perf_evlist__mmap(evlist, UINT_MAX, false);
if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", strerror(errno));
- goto out_close_evlist;
+ goto out_delete_evlist;
}
perf_evlist__enable(evlist);
err = 0;
out_munmap:
perf_evlist__munmap(evlist);
-out_close_evlist:
- perf_evlist__close(evlist);
out_delete_evlist:
perf_evlist__delete(evlist);
out:
err = perf_evlist__mmap(evlist, opts.mmap_pages, false);
if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", strerror(errno));
- goto out_close_evlist;
+ goto out_delete_evlist;
}
/*
}
out_err:
perf_evlist__munmap(evlist);
-out_close_evlist:
- perf_evlist__close(evlist);
out_delete_evlist:
perf_evlist__delete(evlist);
out:
if (evlist) {
perf_evlist__disable(evlist);
perf_evlist__munmap(evlist);
- perf_evlist__close(evlist);
perf_evlist__delete(evlist);
}
if (err < 0) {
pr_debug("failed to mmap event: %d (%s)\n", errno,
strerror(errno));
- goto out_close_evlist;
+ goto out_delete_evlist;
}
perf_evlist__enable(evlist);
out_unmap_evlist:
perf_evlist__munmap(evlist);
-out_close_evlist:
- perf_evlist__close(evlist);
out_delete_evlist:
perf_evlist__delete(evlist);
return err;
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);
}
perf_evlist__munmap(evlist);
-out_close_evlist:
- perf_evlist__close(evlist);
out_delete_evlist:
perf_evlist__delete(evlist);
return err;
void perf_evlist__delete(struct perf_evlist *evlist)
{
+ perf_evlist__close(evlist);
cpu_map__delete(evlist->cpus);
thread_map__delete(evlist->threads);
evlist->cpus = NULL;