summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-04-19 07:55:58 +0200
committerIngo Molnar <mingo@elte.hu>2011-04-19 07:56:17 +0200
commit68d2cf25d39324c54b5e42de7915c623a0917abe (patch)
treeff1291450d7e6630bc77ec1363c3db8d74fa58b0 /tools/perf/builtin-record.c
parent176fcc5c5f0131504a55e1e1d35389c49a9177c2 (diff)
parent5d2cd90922c778908bd0cd669e572a5b5eafd737 (diff)
downloadlinux-68d2cf25d39324c54b5e42de7915c623a0917abe.tar.gz
linux-68d2cf25d39324c54b5e42de7915c623a0917abe.tar.bz2
linux-68d2cf25d39324c54b5e42de7915c623a0917abe.zip
Merge branch 'perf/urgent' into perf/core
Merge reason: we'll be queueing up dependent changes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index db6adecf46f1..416538248a4b 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -41,7 +41,7 @@ static u64 user_interval = ULLONG_MAX;
static u64 default_interval = 0;
static unsigned int page_size;
-static unsigned int mmap_pages = 128;
+static unsigned int mmap_pages = UINT_MAX;
static unsigned int user_freq = UINT_MAX;
static int freq = 1000;
static int output;
@@ -163,6 +163,7 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist)
struct perf_event_attr *attr = &evsel->attr;
int track = !evsel->idx; /* only the first counter needs these */
+ attr->inherit = !no_inherit;
attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
PERF_FORMAT_TOTAL_TIME_RUNNING |
PERF_FORMAT_ID;
@@ -251,6 +252,9 @@ static void open_counters(struct perf_evlist *evlist)
{
struct perf_evsel *pos;
+ if (evlist->cpus->map[0] < 0)
+ no_inherit = true;
+
list_for_each_entry(pos, &evlist->entries, node) {
struct perf_event_attr *attr = &pos->attr;
/*
@@ -271,8 +275,7 @@ static void open_counters(struct perf_evlist *evlist)
retry_sample_id:
attr->sample_id_all = sample_id_all_avail ? 1 : 0;
try_again:
- if (perf_evsel__open(pos, evlist->cpus, evlist->threads, group,
- !no_inherit) < 0) {
+ if (perf_evsel__open(pos, evlist->cpus, evlist->threads, group) < 0) {
int err = errno;
if (err == EPERM || err == EACCES) {
@@ -513,6 +516,10 @@ static int __cmd_record(int argc, const char **argv)
if (have_tracepoints(&evsel_list->entries))
perf_header__set_feat(&session->header, HEADER_TRACE_INFO);
+ /* 512 kiB: default amount of unprivileged mlocked memory */
+ if (mmap_pages == UINT_MAX)
+ mmap_pages = (512 * 1024) / page_size;
+
if (forks) {
child_pid = fork();
if (child_pid < 0) {