From: Masami Hiramatsu Date: Thu, 25 Feb 2010 13:36:04 +0000 (-0500) Subject: perf probe: Show more lines after last line X-Git-Tag: v2.6.34-rc1~197^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5c8d1cbbbed39dcab2ecf429d6e56ea548c0fda4;p=karo-tx-linux.git perf probe: Show more lines after last line Show 2 more lines after the last probe-able line. This will clearly show the last closed-brace of inline functions. Signed-off-by: Masami Hiramatsu Cc: systemtap Cc: DLE Cc: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Mike Galbraith Cc: K.Prasad Cc: Frederic Weisbecker Cc: Ananth N Mavinakayanahalli LKML-Reference: <20100225133604.6725.76820.stgit@localhost6.localdomain6> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 71b0dd590a37..91f55f24fa9d 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -716,6 +716,7 @@ void del_trace_kprobe_events(struct strlist *dellist) } #define LINEBUF_SIZE 256 +#define NR_ADDITIONAL_LINES 2 static void show_one_line(FILE *fp, unsigned int l, bool skip, bool show_num) { @@ -776,5 +777,11 @@ void show_line_range(struct line_range *lr) show_one_line(fp, (l++) - lr->offset, false, false); show_one_line(fp, (l++) - lr->offset, false, true); } + + if (lr->end == INT_MAX) + lr->end = l + NR_ADDITIONAL_LINES; + while (l < lr->end && !feof(fp)) + show_one_line(fp, (l++) - lr->offset, false, false); + fclose(fp); }