Re: [2.6.39-rc2] perf top fails to mmap

From: Arnaldo Carvalho de Melo
Date: Wed Apr 06 2011 - 13:52:30 EST


Em Wed, Apr 06, 2011 at 09:20:53AM -0600, David Ahern escreveu:
>
>
> On 04/06/11 04:51, Tim Blechmann wrote:
> > hi all,
> >
> > when trying to profile a process with `perf top -p $PID', perf exits with:
> > Failed to mmap with 22 (Invalid argument)
>
> Works fine for me with latest kernel tree (this morning). Short lived
> process?
>
> David
>
> >
> > this happens when running perf as the same process as the process and when
> > running perf as root.

yep, works for me as well:

[acme@emilia ~]$ cat vsyscall.c
#include <time.h>

int main(void)
{
struct timespec t;
//int i;
//for(i = 0; i < 10000000; i++)
while (1) {
clock_gettime(CLOCK_MONOTONIC, &t);
usleep(10);
}
return 0;
}
[acme@emilia ~]$ cc -lrt vsyscall.c -o vsyscall
[acme@emilia ~]$ ./vsyscall &
[acme@emilia linux]$ perf top -p `pidof vsyscall` -F 10000
PerfTop: 230 irqs/sec kernel:88.3% exact: 0.0% [10000Hz cycles], (target_pid: 2728)
----------------------------------------------------------------------------------------

samples pcnt function DSO
_______ _____ ____________________ ____________________

21.00 44.7% __nanosleep_nocancel /lib64/libc-2.12.so
13.00 27.7% usleep /lib64/libc-2.12.so
6.00 12.8% __GI_clock_gettime /lib64/librt-2.12.so
6.00 12.8% main /home/acme/vsyscall
^C
[acme@emilia linux]$ su -
Password:
[root@emilia ~]# perf top -p `pidof vsyscall` -F 10000 --hide_kernel_symbols
PerfTop: 428 irqs/sec kernel:90.2% exact: 0.0% [10000Hz cycles], (target_pid: 2728)
-------------------------------------------------------------------------------------------

samples pcnt function DSO
_______ _____ ____________________ ____________________

15.00 29.4% __nanosleep_nocancel /lib64/libc-2.12.so
14.00 27.5% usleep /lib64/libc-2.12.so
9.00 17.6% __GI_clock_gettime /lib64/librt-2.12.so
8.00 15.7% main /home/acme/vsyscall
^C
[root@emilia ~]#

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/