This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH -tip 8/9] perf probe: show more lines after last line
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Ingo Molnar <mingo at elte dot hu>, lkml<linux-kernel at vger dot kernel dot org>
- Cc: Paul Mackerras <paulus at samba dot org>, Arnaldo Carvalho de Melo <acme at redhat dot com>, Steven Rostedt <rostedt at goodmis dot org>, Jim Keniston <jkenisto at us dot ibm dot com>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Christoph Hellwig <hch at infradead dot org>, "Frank Ch. Eigler" <fche at redhat dot com>, Jason Baron <jbaron at redhat dot com>, "K.Prasad" <prasad at linux dot vnet dot ibm dot com>, Peter Zijlstra <peterz at infradead dot org>, Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>, Ulrich Drepper <drepper at redhat dot com>, Roland McGrath <roland at redhat dot com>, Mike Galbraith <efault at gmx dot de>, systemtap<systemtap at sources dot redhat dot com>, DLE<dle-develop at lists dot sourceforge dot net>
- Date: Thu, 18 Feb 2010 18:28:06 -0500
- Subject: [PATCH -tip 8/9] perf probe: show more lines after last line
- References: <20100218232701.21679.5195.stgit@dhcp-100-2-132.bos.redhat.com>
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 <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
---
tools/perf/util/probe-event.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 8f05688..bc70323 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -719,6 +719,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)
{
@@ -779,5 +780,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);
}
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com