This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[tip:perf/probes] perf probe: Show more lines after last line
- From: tip-bot for Masami Hiramatsu <mhiramat at redhat dot com>
- To: linux-tip-commits at vger dot kernel dot org
- Cc: linux-kernel at vger dot kernel dot org, paulus at samba dot org, acme at redhat dot com, hpa at zytor dot com, mingo at redhat dot com, efault at gmx dot de, peterz at infradead dot org, ananth at in dot ibm dot com, dle-develop at lists dot sourceforge dot net, fweisbec at gmail dot com, tglx at linutronix dot de, mhiramat at redhat dot com, mingo at elte dot hu, prasad at linux dot vnet dot ibm dot com, systemtap at sources dot redhat dot com
- Date: Thu, 25 Feb 2010 19:32:11 GMT
- Subject: [tip:perf/probes] perf probe: Show more lines after last line
- Git-commit-id: 5c8d1cbbbed39dcab2ecf429d6e56ea548c0fda4
- References: <20100225133604.6725.76820.stgit@localhost6.localdomain6>
- Reply-to: mingo at redhat dot com, hpa at zytor dot com, acme at redhat dot com, paulus at samba dot org, linux-kernel at vger dot kernel dot org, peterz at infradead dot org, efault at gmx dot de, ananth at in dot ibm dot com, fweisbec at gmail dot com, dle-develop at lists dot sourceforge dot net, tglx at linutronix dot de, mhiramat at redhat dot com, systemtap at sources dot redhat dot com, prasad at linux dot vnet dot ibm dot com, mingo at elte dot hu
Commit-ID: 5c8d1cbbbed39dcab2ecf429d6e56ea548c0fda4
Gitweb: http://git.kernel.org/tip/5c8d1cbbbed39dcab2ecf429d6e56ea548c0fda4
Author: Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Thu, 25 Feb 2010 08:36:04 -0500
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 25 Feb 2010 17:49:30 +0100
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 <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
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>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
LKML-Reference: <20100225133604.6725.76820.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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 71b0dd5..91f55f2 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);
}