The NetBSD Project

CVS log for src/tests/modules/t_kcov.c

[BACK] Up to [cvs.NetBSD.org] / src / tests / modules

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.10.2.2: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:10:08 2019 UTC (5 years, 9 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.10.2.1: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.2.1: +576 -0 lines
Sync with HEAD

Revision 1.10.2.1
Sun May 26 01:44:34 2019 UTC (5 years, 9 months ago) by christos
Branches: phil-wifi
FILE REMOVED
Changes since revision 1.10: +0 -576 lines
file t_kcov.c was added on branch phil-wifi on 2019-06-10 22:10:08 +0000

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sun May 26 01:44:34 2019 UTC (5 years, 9 months ago) by kamil
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-9-base, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, HEAD
Branch point for: phil-wifi
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +7 -7 lines
Drop no longer needed macros KCOV_STORE() KCOV_LOAD() in kcov(4)

Corrently KCOV_STORE() and KCOV_LOAD() are equivalent to x=y.

Obtained from <R3x>

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Apr 4 10:53:20 2019 UTC (5 years, 11 months ago) by kamil
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +8 -0 lines
Fix flaky check for the /dev/kcov device in t_kcov

Add a top-level check for the KCOV device, instead of deferring it ot each
thread. The thread-based solution was flaky.

PR kern/54064 by Andreas Gustafsson

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Mar 10 22:34:14 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +69 -11 lines
Introduce enhancements to the kcov(4) code

Add new tests verifying dup2(2) scenarios:
 - kcov_dup2
 - kcov_basic_dup2_pc
 - kcov_basic_dup2_cmp

The dup2(2) trick is used by syzkaller and assert that it works.
All new tests pass.

While there add minor non-functional cleanup changes.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Mar 10 17:51:00 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +62 -17 lines
Add support for trace type selection in kcov(4)

Allow to specify mode in KCOV_IOC_ENABLE synchronizing the functionality
with Linux, FreeBSD and OpenBSD. As a NetBSD (and OpenBSD) specific of
the ioctl(2) interface, the mode argument has to be specified as &value
rather than value.

There are 3 modes available:
 1. KCOV_MODE_NONE       -- no trace specified, useful for testing purposes
 2. KCOV_MODE_TRACE_PC   -- trace the kernel program counter
 3. KCOV_MODE_TRACE_CMP  -- trace comparison instructions and switch statements

Adapt the ATF tests and documentation for new API.

The KCOV_MODE_TRACE_CMP mode is implemented but still awaits for the
GCC 8.x upgrade or selection of Clang/LLVM as the kernel compiler.

Obtained from OpenBSD and adapted for NetBSD by myself.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Mar 10 13:24:50 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +2 -2 lines
Fix bug in kcov_multiple_threads in t_kcov

Spawn the expected number of threads rather than hardcoding one value for
all tests.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sun Mar 10 12:54:39 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +164 -14 lines
Add support for multiple threads in kcov(4)

Reuse the fd_clone() API to associate kcov descriptors (KD) with a file
descriptor. Each fd (/dev/kcov) can be reused for a single LWP.

Add new ATF regression tests and cleanup existing code there. All tests
pass.

Refresh the kcov(4) man page documentation.

Developed with help from <maxv>.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Feb 25 10:23:01 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -6 lines
Fix build of t_kcov

Correct the syntax that used to work in earlier uncommitted version.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Feb 24 21:14:43 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +4 -6 lines
Add KCOV_LOAD() and KCOV_STORE() - new helper macros

New macros prefer 64-bit atomic operations whenever accessible.

As a fallback they use volatile move operations that are not known
to have negative effect in KCOV even if interrupted in the middle of
operation.

Enable kcov_basic and kcov_thread tests on targets without
__HAVE_ATOMIC64_OPS.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Feb 23 08:03:24 2019 UTC (6 years ago) by kamil
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +4 -0 lines
Fix build of kcov tests on CPUs without 64-bit atomics

Restrict the 64-bit atomics to ports defining __HAVE_ATOMIC64_OPS.

Using 64-bit atomics is still good for i586 fuzzing, but the tests are
build for earlier CPUs. This makes this code to be disabled in i386 builds.

There is a similar situation with few other ports that offer 64-bit atomics
in certain CPU models and ABIs.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Feb 23 03:10:06 2019 UTC (6 years, 1 month ago) by kamil
Branches: MAIN
Add KCOV - kernel code coverage tracing device

The KCOV driver implements collection of code coverage inside the kernel.
It can be enabled on a per process basis from userland, allowing the kernel
program counter to be collected during syscalls triggered by the same
process.

The device is oriented towards kernel fuzzers, in particular syzkaller.

Currently the only supported coverage type is -fsanitize-coverage=trace-pc.

The KCOV driver was initially developed in Linux. A driver based on the
same concept was then implemented in FreeBSD and OpenBSD.

Documentation is borrowed from OpenBSD and ATF tests from FreeBSD.

This patch has been prepared by Siddharth Muralee, improved by <maxv>
and polished by myself before importing into the mainline tree.

All ATF tests pass.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>