perf_events: Report the MMAP pgoff value in bytes
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 26 Feb 2010 09:33:41 +0000 (10:33 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 26 Feb 2010 09:56:52 +0000 (10:56 +0100)
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.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_event.c

index 087025fe3ba1c0f60c02e3a76d2fe68082a585ff..5a69abb05ac32b716bee539bc6c5cbd4fc984610 100644 (file)
@@ -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,
                },
        };