Skip to content

Commit

Permalink
perf_counter tools: Fix off-by-one bug in symbol__new
Browse files Browse the repository at this point in the history
The end is really (start + len - 1). Noticed when synthesizing
the PLT symbols, that are small (16 bytes), and hot on the
start RIP.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <20090603174921.GG7805@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jun 3, 2009
1 parent 095b3a6 commit 18374ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/perf_counter/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static struct symbol *symbol__new(uint64_t start, uint64_t len,
self = ((void *)self) + priv_size;
}
self->start = start;
self->end = start + len;
self->end = start + len - 1;
memcpy(self->name, name, namelen);
}

Expand Down

0 comments on commit 18374ab

Please sign in to comment.