memset(&attr, 0, sizeof(attr));
attr.config = event_id[counter];
attr.sample_period = event_count[counter];
- attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
- attr.freq = freq;
+ attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_PERIOD;
+ if (freq) {
+ attr.freq = 1;
+ attr.sample_freq = freq;
+ }
attr.mmap = track;
attr.comm = track;
attr.inherit = (cpu < 0) && inherit;
event_id[0] = 0;
}
- if (freq) {
- default_interval = freq;
- freq = 1;
- }
for (counter = 0; counter < nr_counters; counter++) {
if (event_count[counter])
continue;