lkml.org 
[lkml]   [2014]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 22/24] perf tools: Fixup off-by-one comparision in maps__find
    Date
    From: Namhyung Kim <namhyung@kernel.org>

    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 | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
    index 186418ba18db..2137c4596ec7 100644
    --- a/tools/perf/util/map.c
    +++ b/tools/perf/util/map.c
    @@ -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;
    --
    1.9.3


    \
     
     \ /
      Last update: 2014-10-14 23:41    [W:8.894 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site