Skip to contentSkip to conversation

perf/tests: Fix typo in sample-parsing.c

PATCH New Rasmus Villemoes 2 participants 2 messages Jan 22, 2015 – Jan 28, 2015 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf/tests: Fix typo in sample-parsing.c

I'm pretty sure this wasn't supposed to be dead code.

---
 tools/perf/tests/sample-parsing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/sample-parsing.c +1 -1
index 4908c648a597..30c02181e78b 100644
@@ -110,7 +110,7 @@ static bool samples_same(const struct perf_sample *s1,
 
 	if (type & PERF_SAMPLE_STACK_USER) {
 		COMP(user_stack.size);
-		if (memcmp(s1->user_stack.data, s1->user_stack.data,
+		if (memcmp(s1->user_stack.data, s2->user_stack.data,
 			   s1->user_stack.size)) {
 			pr_debug("Samples differ at 'user_stack'\n");
 			return false;
Signature · 1 line
2.1.3
#1 lore raw

[tip:perf/core] perf tests: Fix typo in sample-parsing.c

perf tests: Fix typo in sample-parsing.c
Commit-ID:  605a3069161dd966d6cea795133c673fb6706e52
Gitweb:     http://git.kernel.org/tip/605a3069161dd966d6cea795133c673fb6706e52
Author:     Rasmus Villemoes <[email protected]>
AuthorDate: Thu, 22 Jan 2015 18:01:23 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 22 Jan 2015 17:03:01 -0300

perf tests: Fix typo in sample-parsing.c

It was testing the same buffer for differences:

memcmp(s1->user_stack.data, s1->user_stack.data, s1->user_stack.size)

I'm pretty sure this wasn't supposed to be dead code.

---
 tools/perf/tests/sample-parsing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/sample-parsing.c +1 -1
index 4908c64..30c0218 100644
@@ -110,7 +110,7 @@ static bool samples_same(const struct perf_sample *s1,
 
 	if (type & PERF_SAMPLE_STACK_USER) {
 		COMP(user_stack.size);
-		if (memcmp(s1->user_stack.data, s1->user_stack.data,
+		if (memcmp(s1->user_stack.data, s2->user_stack.data,
 			   s1->user_stack.size)) {
 			pr_debug("Samples differ at 'user_stack'\n");
 			return false;