Skip to contentSkip to conversation

perf_events: Report the MMAP pgoff value in bytes

tip:perf/core tip-bot for Peter Zijlstra 1 participant 1 message Feb 26, 2010

lore
Share & tools
lore
#0 lore raw
Commit-ID:  3a0304e90aa5a2c0c308a05d28f7d109a48d8539
Gitweb:     http://git.kernel.org/tip/3a0304e90aa5a2c0c308a05d28f7d109a48d8539
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Fri, 26 Feb 2010 10:33:41 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 26 Feb 2010 10:56:52 +0100

perf_events: Report the MMAP pgoff value in bytes

DaveM reported that currently perf interprets the pgoff value reported by the MMAP events as a byte range, but the kernel reports it as a page offset.

Since its broken (and unusable) anyway, change the kernel behaviour (ABI) to report bytes indeed, avoiding the need for userspace to deal with PAGE_SIZE things.

LKML-Reference: <new-submission>

---
 kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/perf_event.c +1 -1
index 087025f..5a69abb 100644
@@ -3749,7 +3749,7 @@ void __perf_event_mmap(struct vm_area_struct *vma)
 			/* .tid */
 			.start  = vma->vm_start,
 			.len    = vma->vm_end - vma->vm_start,
-			.pgoff  = vma->vm_pgoff,
+			.pgoff  = (u64)vma->vm_pgoff << PAGE_SHIFT,
 		},
 	};