/* * This file adds a test for Media Controller API. * This test should be run as root and should not be * included in the Kselftest run. This test should be * run when hardware and driver that makes use Media * Controller API are present in the system. * * This test opens user specified Media Device and calls * MEDIA_IOC_DEVICE_INFO ioctl in a loop once every 10 * seconds. * * Usage: * sudo ./media_device_test -d /dev/mediaX * * While test is running, remove the device and * ensure there are no use after free errors and * other Oops in the dmesg. Enable KaSan kernel * config option for use-after-free error detection.
*/
if (getuid() != 0)
ksft_exit_skip("Please run the test as root - Exiting.\n");
/* Generate random number of interations */
srand((unsignedint) time(NULL));
count = rand();
/* Open Media device and keep it open */
fd = open(media_device, O_RDWR); if (fd == -1) {
printf("Media Device open errno %s\n", strerror(errno)); exit(-1);
}
printf("\nNote:\n" "While test is running, remove the device and\n" "ensure there are no use after free errors and\n" "other Oops in the dmesg. Enable KaSan kernel\n" "config option for use-after-free error detection.\n\n");
printf("Running test for %d iterations\n", count);
while (count > 0) {
ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi); if (ret < 0)
printf("Media Device Info errno %s\n", strerror(errno)); else
printf("Media device model %s driver %s - count %d\n",
mdi.model, mdi.driver, count);
sleep(10);
count--;
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.