diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index d7a2b4b9801d8a0690b2114c2b5195c0b5179222..f4f427ce4d641446747bfa196c333020ef22644f 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -70,6 +70,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts, struct perf_event_attr *attr = &evsel->attr; int track = !evsel->idx; /* only the first counter needs these */ + attr->disabled = 1; attr->sample_id_all = opts->sample_id_all_missing ? 0 : 1; attr->inherit = !opts->no_inherit; attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | @@ -138,7 +139,6 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts, if (perf_target__none(&opts->target) && (!opts->group || evsel == first)) { - attr->disabled = 1; attr->enable_on_exec = 1; } }