Merge tag 'samsung-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux...
[cascardo/linux.git] / tools / perf / util / evsel.c
index 5c28d82..8606175 100644 (file)
@@ -589,10 +589,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
        }
 
        /*
-        * We default some events to a 1 default interval. But keep
+        * We default some events to have a default interval. But keep
         * it a weak assumption overridable by the user.
         */
-       if (!attr->sample_period || (opts->user_freq != UINT_MAX &&
+       if (!attr->sample_period || (opts->user_freq != UINT_MAX ||
                                     opts->user_interval != ULLONG_MAX)) {
                if (opts->freq) {
                        perf_evsel__set_sample_bit(evsel, PERIOD);
@@ -659,6 +659,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
                perf_evsel__set_sample_bit(evsel, WEIGHT);
 
        attr->mmap  = track;
+       attr->mmap2 = track && !perf_missing_features.mmap2;
        attr->comm  = track;
 
        if (opts->sample_transaction)