aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/probe-event.c7
1 files changed, 7 insertions, 0 deletions
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)
716} 716}
717 717
718#define LINEBUF_SIZE 256 718#define LINEBUF_SIZE 256
719#define NR_ADDITIONAL_LINES 2
719 720
720static void show_one_line(FILE *fp, unsigned int l, bool skip, bool show_num) 721static void show_one_line(FILE *fp, unsigned int l, bool skip, bool show_num)
721{ 722{
@@ -776,5 +777,11 @@ void show_line_range(struct line_range *lr)
776 show_one_line(fp, (l++) - lr->offset, false, false); 777 show_one_line(fp, (l++) - lr->offset, false, false);
777 show_one_line(fp, (l++) - lr->offset, false, true); 778 show_one_line(fp, (l++) - lr->offset, false, true);
778 } 779 }
780
781 if (lr->end == INT_MAX)
782 lr->end = l + NR_ADDITIONAL_LINES;
783 while (l < lr->end && !feof(fp))
784 show_one_line(fp, (l++) - lr->offset, false, false);
785
779 fclose(fp); 786 fclose(fp);
780} 787}