perf probe: Don't always consider EOF as an error when listing source code
authorFranck Bui-Huu <fbuihuu@gmail.com>
Mon, 20 Dec 2010 14:18:04 +0000 (15:18 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 21 Dec 2010 18:20:12 +0000 (16:20 -0200)
commitfde52dbd7f71934aba4e150f3d1d51e826a08850
tree1b96f7055ad29b37a25e2de748f128ae5d44fb77
parent9d95b580a8d64ef4d1660a21a9de0658fe29f041
perf probe: Don't always consider EOF as an error when listing source code

When listing a whole file or a function which is located at the end,
perf-probe -L output wrongly: "Source file is shorter than expected.".

This is because show_one_line() always consider EOF as an error.

This patch fixes this by not considering EOF as an error when dumping
the trailing lines. Otherwise it's still an error and perf-probe still
outputs its warning.

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <1292854685-8230-6-git-send-email-fbuihuu@gmail.com>
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c