perf tools: Fixup off-by-one comparision in maps__find
authorNamhyung Kim <namhyung@kernel.org>
Tue, 14 Oct 2014 19:05:38 +0000 (16:05 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 14 Oct 2014 20:50:56 +0000 (17:50 -0300)
map->end is the first addr _outside_ the a map, following the convention
of vm_area_struct->vm_end.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/8761fwh1nc.fsf@sejong.aot.lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/map.c

index 186418ba18dbefcbb4d3fab67fd068fcca0a849d..2137c4596ec79aa49b3fc0d9e58f2a6aaea1b920 100644 (file)
@@ -752,7 +752,7 @@ struct map *maps__find(struct rb_root *maps, u64 ip)
                m = rb_entry(parent, struct map, rb_node);
                if (ip < m->start)
                        p = &(*p)->rb_left;
-               else if (ip > m->end)
+               else if (ip >= m->end)
                        p = &(*p)->rb_right;
                else
                        return m;