aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/perf_counter/builtin-report.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-05-26 13:03:36 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-26 14:22:56 -0400
commitf49515b157e2d3ca3633eb0664fc46c42f6cb37e (patch)
tree54b20f6116353fcb098c45fa2c4130f898a3a0d1 /Documentation/perf_counter/builtin-report.c
parent3e70611460fe74ad32534fa9791774f6bbdd4159 (diff)
perf report: add more debugging
Add the offset of the file we are analyzing, and the size of the record. In case of problems it's easier to see where the parser lost track. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: John Kacur <jkacur@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/perf_counter/builtin-report.c')
-rw-r--r--Documentation/perf_counter/builtin-report.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 4b5ccc5bd0e6..2d4e4cc655a3 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -645,7 +645,7 @@ static int __cmd_report(void)
645 char *buf; 645 char *buf;
646 event_t *event; 646 event_t *event;
647 int ret, rc = EXIT_FAILURE; 647 int ret, rc = EXIT_FAILURE;
648 unsigned long total = 0, total_mmap = 0, total_comm = 0, total_unknown; 648 unsigned long total = 0, total_mmap = 0, total_comm = 0, total_unknown = 0;
649 649
650 input = open(input_name, O_RDONLY); 650 input = open(input_name, O_RDONLY);
651 if (input < 0) { 651 if (input < 0) {
@@ -699,8 +699,6 @@ more:
699 goto done; 699 goto done;
700 } 700 }
701 701
702 head += event->header.size;
703
704 if (event->header.misc & PERF_EVENT_MISC_OVERFLOW) { 702 if (event->header.misc & PERF_EVENT_MISC_OVERFLOW) {
705 char level; 703 char level;
706 int show = 0; 704 int show = 0;
@@ -709,7 +707,9 @@ more:
709 uint64_t ip = event->ip.ip; 707 uint64_t ip = event->ip.ip;
710 708
711 if (dump_trace) { 709 if (dump_trace) {
712 fprintf(stderr, "PERF_EVENT (IP, %d): %d: %p\n", 710 fprintf(stderr, "%p [%p]: PERF_EVENT (IP, %d): %d: %p\n",
711 (void *)(offset + head),
712 (void *)(long)(event->header.size),
713 event->header.misc, 713 event->header.misc,
714 event->ip.pid, 714 event->ip.pid,
715 (void *)event->ip.ip); 715 (void *)event->ip.ip);
@@ -753,7 +753,9 @@ more:
753 struct map *map = map__new(&event->mmap); 753 struct map *map = map__new(&event->mmap);
754 754
755 if (dump_trace) { 755 if (dump_trace) {
756 fprintf(stderr, "PERF_EVENT_MMAP: [%p(%p) @ %p]: %s\n", 756 fprintf(stderr, "%p [%p]: PERF_EVENT_MMAP: [%p(%p) @ %p]: %s\n",
757 (void *)(offset + head),
758 (void *)(long)(event->header.size),
757 (void *)event->mmap.start, 759 (void *)event->mmap.start,
758 (void *)event->mmap.len, 760 (void *)event->mmap.len,
759 (void *)event->mmap.pgoff, 761 (void *)event->mmap.pgoff,
@@ -771,7 +773,9 @@ more:
771 struct thread *thread = threads__findnew(event->comm.pid); 773 struct thread *thread = threads__findnew(event->comm.pid);
772 774
773 if (dump_trace) { 775 if (dump_trace) {
774 fprintf(stderr, "PERF_EVENT_COMM: %s:%d\n", 776 fprintf(stderr, "%p [%p]: PERF_EVENT_COMM: %s:%d\n",
777 (void *)(offset + head),
778 (void *)(long)(event->header.size),
775 event->comm.comm, event->comm.pid); 779 event->comm.comm, event->comm.pid);
776 } 780 }
777 if (thread == NULL || 781 if (thread == NULL ||
@@ -783,12 +787,16 @@ more:
783 break; 787 break;
784 } 788 }
785 default: { 789 default: {
786 fprintf(stderr, "skipping unknown header type: %d\n", 790 fprintf(stderr, "%p [%p]: skipping unknown header type: %d\n",
791 (void *)(offset + head),
792 (void *)(long)(event->header.size),
787 event->header.type); 793 event->header.type);
788 total_unknown++; 794 total_unknown++;
789 } 795 }
790 } 796 }
791 797
798 head += event->header.size;
799
792 if (offset + head < stat.st_size) 800 if (offset + head < stat.st_size)
793 goto more; 801 goto more;
794 802