Skip to contentSkip to conversation

perf tool: Fix bug in thread__fork

PATCH New David Ahern 2 participants 2 messages Dec 11, 2013 – Dec 16, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tool: Fix bug in thread__fork

Commit 1902efe7f for the new comm infra added the wrong check for return code on thread__set_comm. err == 0 is normal, so don't return at that point unless err != 0.

Cc Frederic Weisbecker <[email protected]>
---
 tools/perf/util/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/thread.c +1 -1
index 49eaf1d7d89d..e3948612543e 100644
@@ -126,7 +126,7 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp)
 		if (!comm)
 			return -ENOMEM;
 		err = thread__set_comm(thread, comm, timestamp);
-		if (!err)
+		if (err)
 			return err;
 		thread->comm_set = true;
 	}
Signature · 1 line
1.8.3.4 (Apple Git-47)
#1 lore raw

[tip:perf/core] perf tools: Fix inverted error verification bug in thread__fork

perf tools: Fix inverted error verification bug in thread__fork
Commit-ID:  8d00be815c05ed0f0202f606bab4e54f98fd3b30
Gitweb:     http://git.kernel.org/tip/8d00be815c05ed0f0202f606bab4e54f98fd3b30
Author:     David Ahern <[email protected]>
AuthorDate: Tue, 10 Dec 2013 21:35:38 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 13 Dec 2013 10:30:21 -0300

perf tools: Fix inverted error verification bug in thread__fork

Commit 1902efe7f for the new comm infra added the wrong check for return code on thread__set_comm. err == 0 is normal, so don't return at that point unless err != 0.

---
 tools/perf/util/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/thread.c +1 -1
index 49eaf1d..e394861 100644
@@ -126,7 +126,7 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp)
 		if (!comm)
 			return -ENOMEM;
 		err = thread__set_comm(thread, comm, timestamp);
-		if (!err)
+		if (err)
 			return err;
 		thread->comm_set = true;
 	}