public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Ingo Molnar <mingo@elte.hu>, lkml<linux-kernel@vger.kernel.org>
Cc: systemtap<systemtap@sources.redhat.com>,
	        DLE<dle-develop@lists.sourceforge.net>,
	        Masami Hiramatsu <mhiramat@redhat.com>,
	Ingo Molnar <mingo@elte.hu>,
	        Frederic Weisbecker <fweisbec@gmail.com>,
	        Arnaldo Carvalho de Melo <acme@redhat.com>,
	        Peter Zijlstra <peterz@infradead.org>,
	        Paul Mackerras <paulus@samba.org>,
	Mike Galbraith <efault@gmx.de>,
	        "K.Prasad" <prasad@linux.vnet.ibm.com>
Subject: [PATCH -tip v2 8/9] perf probe: show more lines after last line
Date: Mon, 22 Feb 2010 22:50:00 -0000	[thread overview]
Message-ID: <20100222225418.20686.9871.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20100222225320.20686.17645.stgit@localhost6.localdomain6>

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 01c229b..e7918e2 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -718,6 +718,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)
 {
@@ -778,5 +779,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

  parent reply	other threads:[~2010-02-22 22:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 22:49 [PATCH -tip v2 0/9] perf-probe updates - use elfutils and introduce lazy matching Masami Hiramatsu
2010-02-22 22:49 ` [PATCH -tip v2 2/9] perf probe: Update perf probe document Masami Hiramatsu
2010-02-22 22:49 ` [PATCH -tip v2 4/9] perf probe: Rename probe finder functions Masami Hiramatsu
2010-02-22 22:49 ` [PATCH -tip v2 3/9] perf probe: Fix bugs in line range finder Masami Hiramatsu
2010-02-22 22:49 ` [PATCH -tip v2 1/9] perf probe: Do not show --line option without dwarf support Masami Hiramatsu
2010-02-22 22:50 ` Masami Hiramatsu [this message]
2010-02-22 22:50 ` [PATCH -tip v2 6/9] perf probe: Use libdw callback routines Masami Hiramatsu
2010-02-22 22:50 ` [PATCH -tip v2 5/9] perf probe: Use elfutils-libdw for analyzing debuginfo Masami Hiramatsu
2010-02-22 23:08   ` Ulrich Drepper
2010-02-22 23:13     ` Masami Hiramatsu
2010-02-22 23:18       ` Masami Hiramatsu
2010-02-22 23:20         ` Ulrich Drepper
2010-02-22 23:19       ` Ulrich Drepper
2010-02-22 22:50 ` [PATCH -tip v2 7/9] perf probe: Check function address range strictly in line finder Masami Hiramatsu
2010-02-22 22:51 ` [PATCH -tip v2 9/9] perf probe: Add lazy line matching support Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100222225418.20686.9871.stgit@localhost6.localdomain6 \
    --to=mhiramat@redhat.com \
    --cc=acme@redhat.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).