From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH 09/21] perf tests: Fix leaks on PERF_RECORD_* test
Date: Wed, 30 Jan 2013 11:46:50 -0300 [thread overview]
Message-ID: <1359557222-17547-10-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1359557222-17547-1-git-send-email-acme@infradead.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
This test:
7: Validate PERF_RECORD_* events & perf_sample fields
needs to call perf_evlist__delete_maps().
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@gmail.com>
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-t3181qy15avffdacqjcxfku2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/perf-record.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 6ea66cf..1e8e512 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -96,7 +96,7 @@ int test__PERF_RECORD(void)
err = perf_evlist__prepare_workload(evlist, &opts, argv);
if (err < 0) {
pr_debug("Couldn't run the workload!\n");
- goto out_delete_evlist;
+ goto out_delete_maps;
}
/*
@@ -111,7 +111,7 @@ int test__PERF_RECORD(void)
err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask);
if (err < 0) {
pr_debug("sched__get_first_possible_cpu: %s\n", strerror(errno));
- goto out_delete_evlist;
+ goto out_delete_maps;
}
cpu = err;
@@ -121,7 +121,7 @@ int test__PERF_RECORD(void)
*/
if (sched_setaffinity(evlist->workload.pid, cpu_mask_size, &cpu_mask) < 0) {
pr_debug("sched_setaffinity: %s\n", strerror(errno));
- goto out_delete_evlist;
+ goto out_delete_maps;
}
/*
@@ -131,7 +131,7 @@ int test__PERF_RECORD(void)
err = perf_evlist__open(evlist);
if (err < 0) {
pr_debug("perf_evlist__open: %s\n", strerror(errno));
- goto out_delete_evlist;
+ goto out_delete_maps;
}
/*
@@ -142,7 +142,7 @@ int test__PERF_RECORD(void)
err = perf_evlist__mmap(evlist, opts.mmap_pages, false);
if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", strerror(errno));
- goto out_delete_evlist;
+ goto out_delete_maps;
}
/*
@@ -305,6 +305,8 @@ found_exit:
}
out_err:
perf_evlist__munmap(evlist);
+out_delete_maps:
+ perf_evlist__delete_maps(evlist);
out_delete_evlist:
perf_evlist__delete(evlist);
out:
--
1.8.1.1.361.gec3ae6e
next prev parent reply other threads:[~2013-01-30 14:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 14:46 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 01/21] tools lib traceevent: Handle dynamic array's element size properly Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 02/21] perf tools: Stop using 'self' in strlist Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 03/21] perf tools: Stop using 'self' in map.[ch] Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 04/21] perf tools: Use memdup in map__clone Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 05/21] perf kmem: Use memdup() Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 06/21] perf header: Stop using die() calls when processing tracing data Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 07/21] perf ui browser: Free browser->helpline() on ui_browser__hide() Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 08/21] perf tests: Call machine__exit in the vmlinux matches kallsyms test Arnaldo Carvalho de Melo
2013-01-30 14:46 ` Arnaldo Carvalho de Melo [this message]
2013-01-30 14:46 ` [PATCH 10/21] tools: Correct typo in tools Makefile Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 11/21] perf: Add 'perf bench numa mem' NUMA performance measurement suite Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 12/21] perf tools: Make numa benchmark optional Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 13/21] perf evsel: Add prev_raw_count field Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 14/21] perf stat: Add interval printing Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 15/21] perf evsel: Fix memory leaks on evsel->counts Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 16/21] perf tools, powerpc: Fix compile warnings in tests/attr.c Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 17/21] perf tools: Fix possible double free on error Arnaldo Carvalho de Melo
2013-01-30 14:46 ` [PATCH 18/21] perf sort: Use pclose() instead of fclose() on pipe stream Arnaldo Carvalho de Melo
2013-01-30 14:47 ` [PATCH 19/21] perf tools: Fix memory leak on error Arnaldo Carvalho de Melo
2013-01-30 14:47 ` [PATCH 20/21] perf header: Fix memory leak for the "Not caching a kptr_restrict'ed /proc/kallsyms" case Arnaldo Carvalho de Melo
2013-01-30 14:47 ` [PATCH 21/21] perf header: Fix double fclose() on do_write(fd, xxx) failure Arnaldo Carvalho de Melo
2013-01-31 9:27 ` [GIT PULL 00/21] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359557222-17547-10-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).