Lines Matching defs:period
181 /* Sample period value taken from perf sample must match with expected value. */
188 * Sample period value taken from perf sample must be >= minimum sample period
202 unsigned long period;
209 * { u64 period; } && PERF_SAMPLE_PERIOD
218 period = 0;
219 if (rb_read(rb, &period, sizeof(period)))
220 pr_debug("rb_read(period) error. [%m]");
221 ret |= callback(exp_period, period);
270 unsigned long period;
275 * Somehow first Fetch event with sample period = 0x10 causes 0
276 * samples. So start with large period and decrease it gradually.
279 { .config = 0xffff, .period = 0xffff0, .fd = FD_SUCCESS },
280 { .config = 0x1000, .period = 0x10000, .fd = FD_SUCCESS },
281 { .config = 0xff, .period = 0xff0, .fd = FD_SUCCESS },
282 { .config = 0x1, .period = 0x10, .fd = FD_SUCCESS },
283 { .config = 0x0, .period = -1, .fd = FD_ERROR },
284 { .config = 0x10000, .period = -1, .fd = FD_ERROR },
288 { .config = 0x0, .period = -1, .fd = FD_ERROR },
289 { .config = 0x1, .period = -1, .fd = FD_ERROR },
290 { .config = 0x8, .period = -1, .fd = FD_ERROR },
291 { .config = 0x9, .period = 0x90, .fd = FD_SUCCESS },
292 { .config = 0xf, .period = 0xf0, .fd = FD_SUCCESS },
293 { .config = 0x1000, .period = 0x10000, .fd = FD_SUCCESS },
294 { .config = 0xffff, .period = 0xffff0, .fd = FD_SUCCESS },
295 { .config = 0x10000, .period = -1, .fd = FD_ERROR },
296 { .config = 0x100000, .period = 0x100000, .fd = FD_SUCCESS },
297 { .config = 0xf00000, .period = 0xf00000, .fd = FD_SUCCESS },
298 { .config = 0xf0ffff, .period = 0xfffff0, .fd = FD_SUCCESS },
299 { .config = 0x1f0ffff, .period = 0x1fffff0, .fd = FD_SUCCESS },
300 { .config = 0x7f0ffff, .period = 0x7fffff0, .fd = FD_SUCCESS },
301 { .config = 0x8f0ffff, .period = -1, .fd = FD_ERROR },
302 { .config = 0x17f0ffff, .period = -1, .fd = FD_ERROR },
343 ret = rb_drain_samples(rb, config->period, nr_samples,
419 unsigned long period;
423 { .freq = 0, .sample_freq = 0, .ret = FD_ERROR, .period = -1 },
424 { .freq = 0, .sample_freq = 1, .ret = FD_ERROR, .period = -1 },
425 { .freq = 0, .sample_freq = 0xf, .ret = FD_ERROR, .period = -1 },
426 { .freq = 0, .sample_freq = 0x10, .ret = FD_SUCCESS, .period = 0x10 },
427 { .freq = 0, .sample_freq = 0x11, .ret = FD_SUCCESS, .period = 0x10 },
428 { .freq = 0, .sample_freq = 0x8f, .ret = FD_SUCCESS, .period = 0x80 },
429 { .freq = 0, .sample_freq = 0x90, .ret = FD_SUCCESS, .period = 0x90 },
430 { .freq = 0, .sample_freq = 0x91, .ret = FD_SUCCESS, .period = 0x90 },
431 { .freq = 0, .sample_freq = 0x4d2, .ret = FD_SUCCESS, .period = 0x4d0 },
432 { .freq = 0, .sample_freq = 0x1007, .ret = FD_SUCCESS, .period = 0x1000 },
433 { .freq = 0, .sample_freq = 0xfff0, .ret = FD_SUCCESS, .period = 0xfff0 },
434 { .freq = 0, .sample_freq = 0xffff, .ret = FD_SUCCESS, .period = 0xfff0 },
435 { .freq = 0, .sample_freq = 0x10010, .ret = FD_SUCCESS, .period = 0x10010 },
436 { .freq = 0, .sample_freq = 0x7fffff, .ret = FD_SUCCESS, .period = 0x7ffff0 },
437 { .freq = 0, .sample_freq = 0xfffffff, .ret = FD_SUCCESS, .period = 0xffffff0 },
438 { .freq = 1, .sample_freq = 0, .ret = FD_ERROR, .period = -1 },
439 { .freq = 1, .sample_freq = 1, .ret = FD_SUCCESS, .period = 0x10 },
440 { .freq = 1, .sample_freq = 0xf, .ret = FD_SUCCESS, .period = 0x10 },
441 { .freq = 1, .sample_freq = 0x10, .ret = FD_SUCCESS, .period = 0x10 },
442 { .freq = 1, .sample_freq = 0x11, .ret = FD_SUCCESS, .period = 0x10 },
443 { .freq = 1, .sample_freq = 0x8f, .ret = FD_SUCCESS, .period = 0x10 },
444 { .freq = 1, .sample_freq = 0x90, .ret = FD_SUCCESS, .period = 0x10 },
445 { .freq = 1, .sample_freq = 0x91, .ret = FD_SUCCESS, .period = 0x10 },
446 { .freq = 1, .sample_freq = 0x4d2, .ret = FD_SUCCESS, .period = 0x10 },
447 { .freq = 1, .sample_freq = 0x1007, .ret = FD_SUCCESS, .period = 0x10 },
448 { .freq = 1, .sample_freq = 0xfff0, .ret = FD_SUCCESS, .period = 0x10 },
449 { .freq = 1, .sample_freq = 0xffff, .ret = FD_SUCCESS, .period = 0x10 },
450 { .freq = 1, .sample_freq = 0x10010, .ret = FD_SUCCESS, .period = 0x10 },
452 { .freq = 1, .sample_freq = 0x7fffff, .ret = FD_ERROR, .period = -1 },
456 { .freq = 0, .sample_freq = 0, .ret = FD_ERROR, .period = -1 },
457 { .freq = 0, .sample_freq = 1, .ret = FD_ERROR, .period = -1 },
458 { .freq = 0, .sample_freq = 0xf, .ret = FD_ERROR, .period = -1 },
459 { .freq = 0, .sample_freq = 0x10, .ret = FD_ERROR, .period = -1 },
460 { .freq = 0, .sample_freq = 0x11, .ret = FD_ERROR, .period = -1 },
461 { .freq = 0, .sample_freq = 0x8f, .ret = FD_ERROR, .period = -1 },
462 { .freq = 0, .sample_freq = 0x90, .ret = FD_SUCCESS, .period = 0x90 },
463 { .freq = 0, .sample_freq = 0x91, .ret = FD_SUCCESS, .period = 0x90 },
464 { .freq = 0, .sample_freq = 0x4d2, .ret = FD_SUCCESS, .period = 0x4d0 },
465 { .freq = 0, .sample_freq = 0x1007, .ret = FD_SUCCESS, .period = 0x1000 },
466 { .freq = 0, .sample_freq = 0xfff0, .ret = FD_SUCCESS, .period = 0xfff0 },
467 { .freq = 0, .sample_freq = 0xffff, .ret = FD_SUCCESS, .period = 0xfff0 },
468 { .freq = 0, .sample_freq = 0x10010, .ret = FD_SUCCESS, .period = 0x10010 },
469 { .freq = 0, .sample_freq = 0x7fffff, .ret = FD_SUCCESS, .period = 0x7ffff0 },
470 { .freq = 0, .sample_freq = 0xfffffff, .ret = FD_SUCCESS, .period = 0xffffff0 },
471 { .freq = 1, .sample_freq = 0, .ret = FD_ERROR, .period = -1 },
472 { .freq = 1, .sample_freq = 1, .ret = FD_SUCCESS, .period = 0x90 },
473 { .freq = 1, .sample_freq = 0xf, .ret = FD_SUCCESS, .period = 0x90 },
474 { .freq = 1, .sample_freq = 0x10, .ret = FD_SUCCESS, .period = 0x90 },
475 { .freq = 1, .sample_freq = 0x11, .ret = FD_SUCCESS, .period = 0x90 },
476 { .freq = 1, .sample_freq = 0x8f, .ret = FD_SUCCESS, .period = 0x90 },
477 { .freq = 1, .sample_freq = 0x90, .ret = FD_SUCCESS, .period = 0x90 },
478 { .freq = 1, .sample_freq = 0x91, .ret = FD_SUCCESS, .period = 0x90 },
479 { .freq = 1, .sample_freq = 0x4d2, .ret = FD_SUCCESS, .period = 0x90 },
480 { .freq = 1, .sample_freq = 0x1007, .ret = FD_SUCCESS, .period = 0x90 },
481 { .freq = 1, .sample_freq = 0xfff0, .ret = FD_SUCCESS, .period = 0x90 },
482 { .freq = 1, .sample_freq = 0xffff, .ret = FD_SUCCESS, .period = 0x90 },
483 { .freq = 1, .sample_freq = 0x10010, .ret = FD_SUCCESS, .period = 0x90 },
485 { .freq = 1, .sample_freq = 0x7fffff, .ret = FD_ERROR, .period = -1 },
488 static int __ibs_period_constraint_test(int ibs_type, struct ibs_period *period,
496 if (period->freq && period->sample_freq > perf_event_max_sample_rate)
497 period->ret = FD_ERROR;
500 fetch_prepare_attr(&attr, 0, period->freq, period->sample_freq);
502 op_prepare_attr(&attr, 0, period->freq, period->sample_freq);
506 if (period->ret == FD_ERROR) {
527 if (period->freq) {
529 ret = rb_drain_samples(rb, period->period, nr_samples,
532 dummy_workload_1(period->sample_freq * 10);
533 ret = rb_drain_samples(rb, period->period, nr_samples,
550 pr_debug("\nIBS sample period constraint tests:\n");
607 unsigned long period;
614 { .freq = 0, .period = 0x0, .ret = FD_ERROR },
615 { .freq = 0, .period = 0x1, .ret = FD_ERROR },
616 { .freq = 0, .period = 0xf, .ret = FD_ERROR },
617 { .freq = 0, .period = 0x10, .ret = FD_SUCCESS },
618 { .freq = 0, .period = 0x11, .ret = FD_ERROR },
619 { .freq = 0, .period = 0x1f, .ret = FD_ERROR },
620 { .freq = 0, .period = 0x20, .ret = FD_SUCCESS },
621 { .freq = 0, .period = 0x80, .ret = FD_SUCCESS },
622 { .freq = 0, .period = 0x8f, .ret = FD_ERROR },
623 { .freq = 0, .period = 0x90, .ret = FD_SUCCESS },
624 { .freq = 0, .period = 0x91, .ret = FD_ERROR },
625 { .freq = 0, .period = 0x100, .ret = FD_SUCCESS },
626 { .freq = 0, .period = 0xfff0, .ret = FD_SUCCESS },
627 { .freq = 0, .period = 0xffff, .ret = FD_ERROR },
628 { .freq = 0, .period = 0x10000, .ret = FD_SUCCESS },
629 { .freq = 0, .period = 0x1fff0, .ret = FD_SUCCESS },
630 { .freq = 0, .period = 0x1fff5, .ret = FD_ERROR },
631 { .freq = 1, .period = 0x0, .ret = FD_ERROR },
632 { .freq = 1, .period = 0x1, .ret = FD_SUCCESS },
633 { .freq = 1, .period = 0xf, .ret = FD_SUCCESS },
634 { .freq = 1, .period = 0x10, .ret = FD_SUCCESS },
635 { .freq = 1, .period = 0x11, .ret = FD_SUCCESS },
636 { .freq = 1, .period = 0x1f, .ret = FD_SUCCESS },
637 { .freq = 1, .period = 0x20, .ret = FD_SUCCESS },
638 { .freq = 1, .period = 0x80, .ret = FD_SUCCESS },
639 { .freq = 1, .period = 0x8f, .ret = FD_SUCCESS },
640 { .freq = 1, .period = 0x90, .ret = FD_SUCCESS },
641 { .freq = 1, .period = 0x91, .ret = FD_SUCCESS },
642 { .freq = 1, .period = 0x100, .ret = FD_SUCCESS },
646 { .freq = 0, .period = 0x0, .ret = FD_ERROR },
647 { .freq = 0, .period = 0x1, .ret = FD_ERROR },
648 { .freq = 0, .period = 0xf, .ret = FD_ERROR },
649 { .freq = 0, .period = 0x10, .ret = FD_ERROR },
650 { .freq = 0, .period = 0x11, .ret = FD_ERROR },
651 { .freq = 0, .period = 0x1f, .ret = FD_ERROR },
652 { .freq = 0, .period = 0x20, .ret = FD_ERROR },
653 { .freq = 0, .period = 0x80, .ret = FD_ERROR },
654 { .freq = 0, .period = 0x8f, .ret = FD_ERROR },
655 { .freq = 0, .period = 0x90, .ret = FD_SUCCESS },
656 { .freq = 0, .period = 0x91, .ret = FD_ERROR },
657 { .freq = 0, .period = 0x100, .ret = FD_SUCCESS },
658 { .freq = 0, .period = 0xfff0, .ret = FD_SUCCESS },
659 { .freq = 0, .period = 0xffff, .ret = FD_ERROR },
660 { .freq = 0, .period = 0x10000, .ret = FD_SUCCESS },
661 { .freq = 0, .period = 0x1fff0, .ret = FD_SUCCESS },
662 { .freq = 0, .period = 0x1fff5, .ret = FD_ERROR },
663 { .freq = 1, .period = 0x0, .ret = FD_ERROR },
664 { .freq = 1, .period = 0x1, .ret = FD_SUCCESS },
665 { .freq = 1, .period = 0xf, .ret = FD_SUCCESS },
666 { .freq = 1, .period = 0x10, .ret = FD_SUCCESS },
667 { .freq = 1, .period = 0x11, .ret = FD_SUCCESS },
668 { .freq = 1, .period = 0x1f, .ret = FD_SUCCESS },
669 { .freq = 1, .period = 0x20, .ret = FD_SUCCESS },
670 { .freq = 1, .period = 0x80, .ret = FD_SUCCESS },
671 { .freq = 1, .period = 0x8f, .ret = FD_SUCCESS },
672 { .freq = 1, .period = 0x90, .ret = FD_SUCCESS },
673 { .freq = 1, .period = 0x91, .ret = FD_SUCCESS },
674 { .freq = 1, .period = 0x100, .ret = FD_SUCCESS },
696 r = ioctl(fd, PERF_EVENT_IOC_PERIOD, &ibs_ioctl->period);
720 fetch_ioctl[i].freq ? "freq " : "period",
721 fetch_ioctl[i].period, r ? "Fail" : "Ok");
730 op_ioctl[i].freq ? "freq " : "period",
731 op_ioctl[i].period, r ? "Fail" : "Ok");
917 * Bunch of IBS sample period fixes that this test exercise went in v6.15.
972 * 2 Sample period mode
973 * perf_event_attr->freq = 0, ->sample_period = <period>
975 * Instead of using above interface, IBS event in 'sample period mode'
976 * can also be opened by passing <period> value directly in a MaxCnt
984 * IBS Fetch and Op PMUs have HW constraints on minimum sample period.
985 * Also, sample period value must be in multiple of 0x10. Test that IBS
993 * Test ioctl() with various sample period values for IBS event.
1015 * With the freq mode event, the next sample period is calculated by
1020 * the sample period adjustment by kernel goes for a toes for freq mode
1021 * IBS events. Kernel will set very small period for the next sample if
1025 * Test that IBS sample period constraints are honored when L3MissOnly