Skip to contentSkip to conversation

perf test: check if cpu_map__new() return NULL

PATCH In review Han Pingtian 2 participants 3 messages Jan 14, 2011 – Jan 26, 2011 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: check if cpu_map__new() return NULL

It looks like we should check if cpus is NULL after

	cpus = cpu_map__new(NULL);

in test__open_syscall_event_on_all_cpus().

---
 tools/perf/builtin-test.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-test.c +2 -2
index 419ce20..e7f098b 100644
@@ -348,8 +348,8 @@ static int test__open_syscall_event_on_all_cpus(void)
 	}
 
 	cpus = cpu_map__new(NULL);
-	if (threads == NULL) {
-		pr_debug("thread_map__new\n");
+	if (cpus == NULL) {
+		pr_debug("cpu_map__new\n");
 		return -1;
 	}
 
Signature · 1 line
1.7.3.4
#1 lore raw

Em Sat, Jan 15, 2011 at 07:00:50AM +0800, Han Pingtian escreveu:

Quoted 5 lines

It looks like we should check if cpus is NULL after

	cpus = cpu_map__new(NULL);

in test__open_syscall_event_on_all_cpus().

Right, thanks,

- Arnaldo

#2 lore raw
In reply to Han Pingtian
Commit-ID:  98d77b78504a423fca911a26a17bee00ef2fdda2
Gitweb:     http://git.kernel.org/tip/98d77b78504a423fca911a26a17bee00ef2fdda2
Author:     Han Pingtian <[email protected]>
AuthorDate: Sat, 15 Jan 2011 07:00:50 +0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sat, 22 Jan 2011 19:56:30 -0200

perf test: check if cpu_map__new() return NULL

It looks like we should check if cpus is NULL after

	cpus = cpu_map__new(NULL);

in test__open_syscall_event_on_all_cpus().

LKML-Reference: <20110114230050.GA7011@localhost>

---
 tools/perf/builtin-test.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/builtin-test.c +3 -3
index 7cc6b20..5a50e47 100644
@@ -347,9 +347,9 @@ static int test__open_syscall_event_on_all_cpus(void)
 	}
 
 	cpus = cpu_map__new(NULL);
-	if (threads == NULL) {
-		pr_debug("thread_map__new\n");
-		return -1;
+	if (cpus == NULL) {
+		pr_debug("cpu_map__new\n");
+		goto out_thread_map_delete;
 	}