kcov.rst (05909cd9a0c8811731b38697af13075e8954314f) | kcov.rst (e0a45cda66423e56d15b219e4da4f4d530cf9236) |
---|---|
1kcov: code coverage for fuzzing 2=============================== 3 4kcov exposes kernel code coverage information in a form suitable for coverage- 5guided fuzzing (randomized testing). Coverage data of a running kernel is 6exported via the "kcov" debugfs file. Coverage collection is enabled on a task 7basis, and thus it can capture precise coverage of a single system call. 8 --- 229 unchanged lines hidden (view full) --- 238Internally kcov stores handles as u64 integers. The top byte of a handle 239is used to denote the id of a subsystem that this handle belongs to, and 240the lower 4 bytes are used to denote the id of a thread instance within 241that subsystem. A reserved value 0 is used as a subsystem id for common 242handles as they don't belong to a particular subsystem. The bytes 4-7 are 243currently reserved and must be zero. In the future the number of bytes 244used for the subsystem or handle ids might be increased. 245 | 1kcov: code coverage for fuzzing 2=============================== 3 4kcov exposes kernel code coverage information in a form suitable for coverage- 5guided fuzzing (randomized testing). Coverage data of a running kernel is 6exported via the "kcov" debugfs file. Coverage collection is enabled on a task 7basis, and thus it can capture precise coverage of a single system call. 8 --- 229 unchanged lines hidden (view full) --- 238Internally kcov stores handles as u64 integers. The top byte of a handle 239is used to denote the id of a subsystem that this handle belongs to, and 240the lower 4 bytes are used to denote the id of a thread instance within 241that subsystem. A reserved value 0 is used as a subsystem id for common 242handles as they don't belong to a particular subsystem. The bytes 4-7 are 243currently reserved and must be zero. In the future the number of bytes 244used for the subsystem or handle ids might be increased. 245 |
246When a particular userspace proccess collects coverage via a common | 246When a particular userspace process collects coverage via a common |
247handle, kcov will collect coverage for each code section that is annotated 248to use the common handle obtained as kcov_handle from the current 249task_struct. However non common handles allow to collect coverage 250selectively from different subsystems. 251 252.. code-block:: c 253 254 struct kcov_remote_arg { --- 80 unchanged lines hidden --- | 247handle, kcov will collect coverage for each code section that is annotated 248to use the common handle obtained as kcov_handle from the current 249task_struct. However non common handles allow to collect coverage 250selectively from different subsystems. 251 252.. code-block:: c 253 254 struct kcov_remote_arg { --- 80 unchanged lines hidden --- |