* We can only do this for the default trace clock.
         */
        if (x86_pmu.intel_cap.pebs_format >= 3 &&
-               event->attr.use_clockid == 0)
+               event->attr.use_clockid == 0) {
                data->time = native_sched_clock_from_tsc(pebs->tsc);
+               data->sample_flags |= PERF_SAMPLE_TIME;
+       }
 
        if (has_branch_stack(event))
                data->br_stack = &cpuc->lbr_stack;
        perf_sample_data_init(data, 0, event->hw.last_period);
        data->period = event->hw.last_period;
 
-       if (event->attr.use_clockid == 0)
+       if (event->attr.use_clockid == 0) {
                data->time = native_sched_clock_from_tsc(basic->tsc);
+               data->sample_flags |= PERF_SAMPLE_TIME;
+       }
 
        /*
         * We must however always use iregs for the unwinder to stay sane; the