Skip to contentSkip to conversation

perf tools: bad lookup in perf_evlist__equal()?

PATCH In review roel 2 participants 2 messages Dec 12, 2011 – Dec 13, 2011 perf events

lore
Share & tools
lore

roel

author
#0 lore raw

PATCH 1/1 perf tools: bad lookup in perf_evlist__equal()?

Fix lookup in perf_evlist__equal()

---
 tools/perf/builtin-record.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Unless this was a feature, but then a comment might be nice This was introduced in a91e5431d54f5

tools/perf/builtin-record.c +1 -1
index 6ab58cc..4ccb7d0 100644
@@ -252,7 +252,7 @@ static bool perf_evlist__equal(struct perf_evlist *evlist,
 	pair = list_entry(other->entries.next, struct perf_evsel, node);
 
 	list_for_each_entry(pos, &evlist->entries, node) {
-		if (memcmp(&pos->attr, &pair->attr, sizeof(pos->attr) != 0))
+		if (memcmp(&pos->attr, &pair->attr, sizeof(pos->attr)) != 0)
 			return false;
 		pair = list_entry(pair->node.next, struct perf_evsel, node);
 	}
#1 lore raw

Em Mon, Dec 12, 2011 at 08:48:51PM +0100, roel escreveu:

Quoted 3 lines

Fix lookup in perf_evlist__equal()

That wasn't intentional at all, it was just comparing the first byte, duh.

Eagle eyes!

I'm pushing this thru perf/urgent.

Thanks,

- Arnaldo

Quoted 20 lines
---
 tools/perf/builtin-record.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Unless this was a feature, but then a comment might be nice This was introduced in a91e5431d54f5

tools/perf/builtin-record.c +1 -1
index 6ab58cc..4ccb7d0 100644
@@ -252,7 +252,7 @@ static bool perf_evlist__equal(struct perf_evlist *evlist,
 	pair = list_entry(other->entries.next, struct perf_evsel, node);
 
 	list_for_each_entry(pos, &evlist->entries, node) {
-		if (memcmp(&pos->attr, &pair->attr, sizeof(pos->attr) != 0))
+		if (memcmp(&pos->attr, &pair->attr, sizeof(pos->attr)) != 0)
 			return false;
 		pair = list_entry(pair->node.next, struct perf_evsel, node);
 	}