diff options
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 17d1dcb3c667..0974f957b8fa 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -163,6 +163,7 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist) | |||
163 | struct perf_event_attr *attr = &evsel->attr; | 163 | struct perf_event_attr *attr = &evsel->attr; |
164 | int track = !evsel->idx; /* only the first counter needs these */ | 164 | int track = !evsel->idx; /* only the first counter needs these */ |
165 | 165 | ||
166 | attr->inherit = !no_inherit; | ||
166 | attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | | 167 | attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | |
167 | PERF_FORMAT_TOTAL_TIME_RUNNING | | 168 | PERF_FORMAT_TOTAL_TIME_RUNNING | |
168 | PERF_FORMAT_ID; | 169 | PERF_FORMAT_ID; |
@@ -251,6 +252,9 @@ static void open_counters(struct perf_evlist *evlist) | |||
251 | { | 252 | { |
252 | struct perf_evsel *pos; | 253 | struct perf_evsel *pos; |
253 | 254 | ||
255 | if (evlist->cpus->map[0] < 0) | ||
256 | no_inherit = true; | ||
257 | |||
254 | list_for_each_entry(pos, &evlist->entries, node) { | 258 | list_for_each_entry(pos, &evlist->entries, node) { |
255 | struct perf_event_attr *attr = &pos->attr; | 259 | struct perf_event_attr *attr = &pos->attr; |
256 | /* | 260 | /* |
@@ -271,8 +275,7 @@ static void open_counters(struct perf_evlist *evlist) | |||
271 | retry_sample_id: | 275 | retry_sample_id: |
272 | attr->sample_id_all = sample_id_all_avail ? 1 : 0; | 276 | attr->sample_id_all = sample_id_all_avail ? 1 : 0; |
273 | try_again: | 277 | try_again: |
274 | if (perf_evsel__open(pos, evlist->cpus, evlist->threads, group, | 278 | if (perf_evsel__open(pos, evlist->cpus, evlist->threads, group) < 0) { |
275 | !no_inherit) < 0) { | ||
276 | int err = errno; | 279 | int err = errno; |
277 | 280 | ||
278 | if (err == EPERM || err == EACCES) { | 281 | if (err == EPERM || err == EACCES) { |
@@ -424,7 +427,7 @@ static void mmap_read_all(void) | |||
424 | { | 427 | { |
425 | int i; | 428 | int i; |
426 | 429 | ||
427 | for (i = 0; i < evsel_list->cpus->nr; i++) { | 430 | for (i = 0; i < evsel_list->nr_mmaps; i++) { |
428 | if (evsel_list->mmap[i].base) | 431 | if (evsel_list->mmap[i].base) |
429 | mmap_read(&evsel_list->mmap[i]); | 432 | mmap_read(&evsel_list->mmap[i]); |
430 | } | 433 | } |