]> git.baikalelectronics.ru Git - kernel.git/commit
perf hist: fix objdump output parsing
authorKonstantin Stepanyuk <kostyas@cqg.com>
Wed, 26 May 2010 22:10:11 +0000 (02:10 +0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 1 Jun 2010 08:44:36 +0000 (05:44 -0300)
commitc5fdb118080ab24a41fb3d27ce66d11eec9bf350
treeb23265c9b0ad7fb042e3f472ca5fed7b0a0205d3
parent50fad7874d0def15659856e3eb450e822d1719f3
perf hist: fix objdump output parsing

hist_entry__annotate() runs objdump with -S option so the output may contain
lines of any format. If a line starts with a colon strtoull() returns 0 and
calculated offset will be negative. This causes perf annotate segfaults.

Make sure that strtoull() has parsed at least one digit.

Cc: David S. Miller <davem@davemloft.net>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Konstantin Stepanyuk <konstantin.stepanyuk@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/hist.c