mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 05:58:22 +00:00
kcov: initial implementation
Implement a device (/dev/kcov) that exposes coverage info for the kernel. This will be especially useful for coverage-based fuzzing (e.g. syzkaller). Exclude a lot of functions which would crash/otherwise interfere in the coverage, including only processing coverage callbacks when not handling an irq.
This commit is contained in:
@@ -14,8 +14,12 @@ UACPIINCDIR=$(shell pwd)/io/acpi/uacpi/include
|
||||
U80211INCDIR=$(shell pwd)/io/net/u80211/include
|
||||
U80211DRVINCDIR=$(shell pwd)/io/net/u80211_drv/include
|
||||
UACPIOPTS=-DUACPI_OVERRIDE_LIBC -DUACPI_KERNEL_INITIALIZATION -DUACPI_NATIVE_ALLOC_ZEROED
|
||||
KCOV_ENABLED=n
|
||||
KERNELCONFIG=-DX86_64_ENABLE_E9 #-DSYSCALL_LOGGING #-DENABLE_PROFILING
|
||||
CFLAGS=-g -ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mgeneral-regs-only -mno-mmx -mno-sse -mno-sse2 -nostdlib -Wall -MMD -I "$(INCDIR)" -I "$(ARCHINCDIR)" -I "$(FLANTERMINCDIR)" -I "$(UACPIINCDIR)" -I "$(U80211INCDIR)" -I"$(U80211DRVINCDIR)" $(UACPIOPTS) $(PRINTFOPTS) $(KERNELCONFIG) $(FLANTERMOPTS) -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=gnu17 -Wno-error=implicit-function-declaration
|
||||
ifeq ($(KCOV_ENABLED),y)
|
||||
CFLAGS += -DKCOV_ENABLED -fsanitize-coverage=trace-pc,trace-cmp
|
||||
endif
|
||||
ASFLAGS=-felf64
|
||||
DEPS=$(CSOURCES:.c=.d)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user