Commit Graph

36 Commits

Author SHA1 Message Date
Dmitry Vyukov
c85e1c5be9 pkg/cover: hierarchical coverage reports
Better coverage reports with hierarchical coverage information,
number of programs covering each line,
handling of partially covered lines,
links to programs covering lines.

Fixes #682
2019-07-26 19:32:14 +02:00
Dmitry Vyukov
7bb222f7bc syz-manager: fix argument order in generateCoverHTML 2019-07-18 09:47:33 +02:00
Siddharth M
f613a7c41d pkg/cover: fix prefix computation
* pkg/cover: Modify parsing logic
1. Remove prefix computation
2. Add a mgrconfig for kernel build directory

* pkg/report: shorten reports with kernelBuildSrc instead of kernelSrc

* pkg/report: Fix failing tests

* pkg/report: fix formating issues

* tools/syz-cover: Fix unintended redefinition

* make changes to fix failing ci build

* pkg/report: fix issues
2019-07-17 11:58:23 +02:00
Michael Tuexen
3d85f48c14 syz-manager: Improve the computation of getVMOffset() on FreeBSD
On FreeBSD getVMOffset() always returned 0 instead of 0xffffffff.
This breaks the usage of addr2line. For now, just return always
0xffffffff on FreeBSD, since a more sophisticated logic doesn't
seem to be required by now.

Thanks to Dmitry for pointing out that this functions provides
the prefix address.
2018-12-31 19:36:13 +01:00
Dmitry Vyukov
5dd495422e syz-manager: move coverage report code to pkg/cover
This will allow better testing and make it possible to reuse this code.
2018-12-10 16:37:01 +01:00
Dmitry Vyukov
5adbd06eff syz-manager: improve coverage source file path generation
If we don't determine correct prefix (e.g. some paths are not full paths),
we can plumb kernel source path twice. It seems that it's not possible
to do the right thing in all possible combinations of what can be in
debug info, if the kernel sources were moved or not, if we have kernel_src
or not. But at least don't plumb kernel_src second time.
2018-09-20 11:22:57 +02:00
Anton Lindqvist
d0e00721b8 sys/targets: allow the name of kernel to be specified per target
Assuming the kernel is named vmlinux does not work for OpenBSD.
2018-09-01 21:46:58 -07:00
Jiangen Jiao
f69c5fcd76 syz-manager: Support kernelSrc and vmlinux from different tree
If vmlinux built from different tree from kernelSrc, cover page will failed to
show. So match only the path without prefix.
2018-07-23 09:52:04 +02:00
Dmitry Vyukov
2a075d57ab pkg/report: allow to specify suppressions per OS
Currently all (linux-specific) suppressions are hardcoded in mgrconfig.
This is very wrong. Move them to pkg/report and allow to specify per OS.
Add gvisor-specific suppressions.
This required a bit of refactoring. Introduce mgrconfig.KernelObj finally.
Make report.NewReporter and vm.Create accept mgrconfig directly
instead of passing it as multiple scattered args.
Remove tools/syz-parse and it always did the same as tools/syz-symbolize.
Simplify global vars in syz-manager/cover.go.
Create reporter eagerly in manager. Use sort.Slice more.
Overall -90 lines removed.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
9fe5658a1b gometalinter: check dot imports
Update #538
2018-05-03 14:41:34 +02:00
Dmitry Vyukov
476b8ca987 syz-manager: properly calculate previous instruction PC
We used to subtract 5 which is length of call instruction on amd64.
Do proper per-arch calculation.
2018-04-27 14:33:01 +02:00
Dmitry Vyukov
9b895661a9 syz-manager: fix coverage report for archs other than amd64 2018-04-20 20:14:10 +02:00
Dmitry Vyukov
36d1c4540a all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
2018-03-08 18:48:26 +01:00
Dmitry Vyukov
04cbdbd1ae syz-fuzzer: prioritize signal from successful syscalls
Signal on successful syscalls is more valuable than
signal on unsuccessful syscalls.y
2018-02-20 20:51:41 +01:00
Dmitry Vyukov
e5b101ddff syz-manager: fix coverage page refresh 2018-01-24 11:25:14 +01:00
Dmitry Vyukov
8b77d41235 syz-manager: show the same file after cover page reload
Handy when you are looking at a single file
and periodically reload page to get new coverage.
2017-12-12 09:13:35 +01:00
Dmitry Vyukov
d19770f1b9 syz-manager: fix up osutil.RunCmd call
Fixes #435
2017-11-24 13:41:28 +01:00
Dmitry Vyukov
c4d43f4773 pkg/osutil: don't leace runaway processes
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
2017-11-16 12:48:02 +01:00
Dmitry Vyukov
8f8cf20bd2 syz-manager: make vmlinux optional
It's currently both optional and non optional.
We require it to be non-empty, but at the same time allow fake "-"
which effectively means "no vmlinux". Make it optional.
2017-09-23 10:02:53 +02:00
Dmitry Vyukov
017b5dea53 pkg/symbolizer: move from symbolizer 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
ec95d17c32 pkg/cover: move from cover 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
23b94422d3 pkg/log: move from log 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
e33075c047 syz-manager: reformat 2017-05-25 11:36:19 +02:00
baishuai
6e254bdd13 manager: save and reuse allSymbols, vmOffset 2017-05-25 17:30:27 +08:00
Dmitry Vyukov
0e2608c229 syz-manager: speed up coverage report
Uncovered PCs were handled very badly:
we added PCs from the same function multiple times
and did not remove covered PCs. As the result total
number of uncovered PCs was terrific.
Fix that.
2017-01-17 17:14:11 +01:00
Dmitry Vyukov
43d5c364a2 syz-manager: move include files to the bottom of coverage report
They are usually less interesting than source files.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
222090e3b4 log: add package
Log is a simple wrapper around std log package.
It is meant to solve 2 main problems:
1. Logging from non-main packages (mainly, vm/* packages).
   Currently they can either always log or not log at all.
   But they can't respect program verbosity setting.
   Log package allows all packages to use the same verbosity setting.
2. Exposing recent logs in html UI.
   Namely we want to tee logs to console and html UI.
2016-10-09 11:27:48 +02:00
Dmitry Vyukov
9decc82111 manager: show uncovered PCs
Uncovered PCs in covered functions are shown in red.

Fixes #43
2016-09-06 19:35:48 +02:00
Dmitry Vyukov
54d923bb5d manager: mark covered lines with /*covered*/
Mark covered lines with /*covered*/ in coverage report,
so that it is possible to quickly find if there are few of them.
2016-08-31 19:20:27 +02:00
Dmitry Vyukov
365791764b symbolizer: move symbolizer to a separate package
Make it reusable.
Support several binaries (vmlinux, modules).
Support symbolization of individual PCs.
Add tests.
2016-08-31 19:20:21 +02:00
Alexander Potapenko
ed787856f2 Use readelf to obtain the upper 32 bits of addresses returned by kcov.
When executors send coverage data to the manager, they clamp the addresses
of covered blocks to 32 bits. Manager uses RestorePC() to restore the original
addresses.
Previously, RestorePC() assumed that the upper 4 bytes of a kernel code
address were 0xffffffff, which is not so on Android.
Instead we now parse `readelf -SW vmlinux` output to obtain the upper bytes of
PROGBITS sections VMAs in the case those VMAs are non-zero. We assume that
the upper 4 bytes are the same for every section.
2016-05-03 11:06:27 +02:00
Dmitry Vyukov
862594f1b6 manager: don't confuse users with zero coverage 2016-02-18 21:48:45 +01:00
David Drysdale
ef1dbf7924 Distinguish between no data and no symbols 2016-02-17 16:50:57 +00:00
Dmitry Vyukov
8c1b44717f manager: detect missing debug info
Fixes #19
2016-02-16 15:10:24 +01:00
Dmitry Vyukov
dfa483f986 manager: remove coverage info caching
The generation does not seem to take too large time.
The cache consumes memory but rarey used, so just remove it.
Makes the code much nicer.
2016-02-16 15:06:24 +01:00
Dmitry Vyukov
8e7ca7c5ff remove master and naming overhaul
Remove master process entirely, it is not useful in its current form.
We first need to understand what we want from it, and them re-implement it.

Prefix all binaries with syz- to avoid name clashes.
2015-12-17 16:06:33 +01:00