Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298319
b: refs/heads/master
c: 5090c6a
h: refs/heads/master
i:
  298317: 8a9fd01
  298315: 819d8e0
  298311: cd44ba1
  298303: 14f53e5
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Mar 16, 2012
1 parent 39dd280 commit d29c09c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c19ea453d81cf8bd9bd446e6b129998f79997e7
refs/heads/master: 5090c6aea84dcc474d0aabf9f66f1eab68a143eb
6 changes: 4 additions & 2 deletions trunk/tools/perf/util/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ struct perf_evlist *perf_evlist__new(struct cpu_map *cpus,
void perf_evlist__config_attrs(struct perf_evlist *evlist,
struct perf_record_opts *opts)
{
struct perf_evsel *evsel;
struct perf_evsel *evsel, *first;

if (evlist->cpus->map[0] < 0)
opts->no_inherit = true;

first = list_entry(evlist->entries.next, struct perf_evsel, node);

list_for_each_entry(evsel, &evlist->entries, node) {
perf_evsel__config(evsel, opts);
perf_evsel__config(evsel, opts, first);

if (evlist->nr_entries > 1)
evsel->attr.sample_type |= PERF_SAMPLE_ID;
Expand Down
6 changes: 4 additions & 2 deletions trunk/tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx)
return evsel;
}

void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts)
void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts,
struct perf_evsel *first)
{
struct perf_event_attr *attr = &evsel->attr;
int track = !evsel->idx; /* only the first counter needs these */
Expand Down Expand Up @@ -134,7 +135,8 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts)
attr->mmap = track;
attr->comm = track;

if (!opts->target_pid && !opts->target_tid && !opts->system_wide) {
if (!opts->target_pid && !opts->target_tid && !opts->system_wide &&
(!opts->group || evsel == first)) {
attr->disabled = 1;
attr->enable_on_exec = 1;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/tools/perf/util/evsel.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ void perf_evsel__exit(struct perf_evsel *evsel);
void perf_evsel__delete(struct perf_evsel *evsel);

void perf_evsel__config(struct perf_evsel *evsel,
struct perf_record_opts *opts);
struct perf_record_opts *opts,
struct perf_evsel *first);

int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads);
Expand Down

0 comments on commit d29c09c

Please sign in to comment.