public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH tip 1/1] perf_counter tools: Fix off-by-one bug in symbol__new
@ 2009-06-03 17:49 Arnaldo Carvalho de Melo
  2009-06-03 19:48 ` [tip:perfcounters/core] " tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-06-03 17:49 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Linux Kernel Mailing List

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>

diff --git a/Documentation/perf_counter/util/symbol.c b/Documentation/perf_counter/util/symbol.c
index d52a1ae..35ee6de 100644
--- a/Documentation/perf_counter/util/symbol.c
+++ b/Documentation/perf_counter/util/symbol.c
@@ -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);
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-03 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03 17:49 [PATCH tip 1/1] perf_counter tools: Fix off-by-one bug in symbol__new Arnaldo Carvalho de Melo
2009-06-03 19:48 ` [tip:perfcounters/core] " tip-bot for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox