linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gary Byers <gb@clozure.com>
To: linux-perf-users@vger.kernel.org
Subject: odd error from "perf record"
Date: Fri, 15 Jan 2016 13:35:05 -0700	[thread overview]
Message-ID: <569957F9.80700@clozure.com> (raw)

Hi.

I happen to be using Ubuntu 15.10

[~] gb@abq> uname -a
Linux abq 4.2.0-23-generic #28-Ubuntu SMP Sun Dec 27 17:47:31 UTC 2015 
x86_64 x86_64 x86_64 GNU/Linux


I am trying to use perf to profile a 64-bit x86 Linux program. The 
program maps a large (512gb) chunk
of address space, but "only" about 20mb of that are mapped with 
permissions that allow any of read,
write, or execute access. (The atypical memory mapping is done for what 
I believe to be very good
reasons and I don't think that those reasons are directly relevant here.)

Some of the code that I an trying to profile is on pages that have read 
and execute permissions
and atypically "high" addresses, often of the form 0000300000xxxxxx,  If 
anyone reading this would
find it helpful, I can certainly provide a copy of /proc/<pid>/maps or 
similar for a typical instance
of the process.  As far as I know, few (if any) pages in the process are 
locked via mlock() or variants.

For the sake of argument, it may be helpful to think of that code as 
having been "JITted" there.  it is
not mapped from an ELF executable or library, and my later questions may 
have to do with the .map file
that I am trying to use to provide symbolic information

I have other issues that I would like to discuss in a followup message, 
but first:

When I call "perf record" on a running instance of the process, I often 
get an error
  gb@abq> [~] gb@abq> perf record -p 18310
Permission error mapping pages.
Consider increasing /proc/sys/kernel/perf_event_mlock_kb,
or try again with a smaller value of -m/--mmap_pages.
(current value: 4294967295,0)
[~] gb@abq> cat /proc/sys/kernel/perf_event_mlock_kb
516

If I try again with an explicit -m argument,I get a similar but slightly 
different error:
[~] gb@abq> perf record -m 8 -p 18310

Permission error mapping pages.
Consider increasing /proc/sys/kernel/perf_event_mlock_kb,
or try again with a smaller value of -m/--mmap_pages.
(current value: 8,0)

If I run 'perf record ..." as root, I get past this point but run into 
other issues that
I will try to discuss in a later message and running as root is not 
always possible for my
uaers

The code in question (and its source) are freely available and the 
source is licensed under an LGPL variant.

I'd be glad to provide that and any other help that anyone needs, and 
thanks for any help
that anyone can provide,

             reply	other threads:[~2016-01-15 20:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 20:35 Gary Byers [this message]
2016-01-15 21:17 ` odd error from "perf record" Arnaldo Carvalho de Melo
2016-01-16 20:55   ` Gary Byers
2016-01-19 22:14     ` Arnaldo Carvalho de Melo
2016-01-20  1:31       ` Gary Byers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=569957F9.80700@clozure.com \
    --to=gb@clozure.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).