-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kcov tweaking #213
Labels
enhancement
New feature or request
Comments
Here is some raw perf data, though I stopped writing these down after a while
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After #207, I tried tweaking kcov settings further on, to understand how they work. I was running kcov on my local machine, using
perf stat ./kcov-script.sh
.--{include,exclude}-{path,pattern}=
options are used for filtering source files. Per kcov man page, they take comma-separated list of patterns. When no such options are present, all files are used (that includes dependencies downloaded in$HOME/.cargo
). Include and exclude are filtering list of files kcov finds in DWARF informations. They kinda work like this (Rust pseudocode):{include,exclude}_path
are much slower than{include,exclude}_pattern
.--include_path=components
adds 60 seconds to kcov process on my machine, and it would probably be more on Travis.Since we use
include_pattern=components
, only files which path containscomponents
are picked. If any dependency of offst ever happens to havecomponents
directory, its test coverage would influence ours. That's why--exclude-path=/usr,~/.cargo
may be a good idea.--exclude-pattern=/usr/,/.cargo/
may be an even better one (see paragraph above), as long as we don't create folder called "usr" in offst codebase.--verify
flag makes kcov 3-4 times slower, but it was needed to prevent it from segfaulting when working with Rust binaries. I tried removing it and nothing broke. I'm using the latest version of kcov (CI is not). This may be worth investigating.kcov runs single-threaded. I tried using GNU parallel like this:
-j0
means "spawn as many threads as there are CPUs". This was not a good idea - kcov crashes a lot when multiple processes try to accesstarget/kcov
at once.So, given these pieces of information, I would suggest trying:
Or maybe
--exclude-pattern=/.cargo/
in case we ever createusr
directory. Or maybe just--exclude-path=/usr --exclude-pattern=/.cargo/
, it is costly, but it still should be better than what we have now, especially without--verify
.For now I'm just writing what I know, asking for opinion.
The text was updated successfully, but these errors were encountered: