kcov-example: Print helpful error if kcov feature is missing

This commit is contained in:
Ben Wiederhake 2021-11-21 03:35:20 +01:00 committed by Andreas Kling
commit d5c687b50f
Notes: sideshowbarker 2024-07-18 00:54:35 +09:00

View file

@ -21,6 +21,7 @@ int main(void)
int fd = open("/dev/kcov0", O_RDWR);
if (fd == -1) {
perror("open");
fprintf(stderr, "Could not open /dev/kcov0 - is ENABLE_KERNEL_COVERAGE_COLLECTION enabled?\n");
return 1;
}
if (ioctl(fd, KCOV_SETBUFSIZE, num_entries) == -1) {