aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/cov/readcovdata.go
AgeCommit message (Collapse)Author
2023-02-13cmd/internal/cov: fix typo in readcovdata.goIkko Eltociear Ashimine
hte -> the Change-Id: Ie81062997289d622756881acdd11af66611cd778 GitHub-Last-Rev: 5ef07542b47f243d5a66ef166c74db0348fd2c80 GitHub-Pull-Request: golang/go#58473 Reviewed-on: https://go-review.googlesource.com/c/go/+/467518 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Bypass: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-02-10cmd/internal/cov: fix misuse of bufio.Reader.Read in read helperThan McIntosh
Fix a misuse of bufio.Reader.Read in the helper class cmd/internal/cov.MReader; the MReader method in question should have been using io.ReadFull (passing the bufio.Reader) instead of directly calling Read. Using the Read method instead of io.ReadFull will result in a "short" read when processing a specific subset of counter data files, e.g. those that are short enough to not trigger the mmap-based scheme we use for larger files, but also with a large args section (something large enough to exceed the default 4k buffer size used by bufio.Reader). Along the way, add some additional defered Close() calls for files opened by the CovDataReader.visitPod, to enure we don't leave any open file descriptor following a call to CovDataReader.Visit. Fixes #58411. Change-Id: Iea48dc25c0081be1ade29f3a633df02a681fd941 Reviewed-on: https://go-review.googlesource.com/c/go/+/466677 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-09-29cmd/internal/cov: use io.SeekStart, io.SeekCurrent, and io.SeekEndcuiweixie
Change-Id: Ibf7e33e42c649783eaa0e638babff22d96ab51c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/436701 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-09-28cmd/covdata: add tools to read/manipulate coverage data filesThan McIntosh
Add a set of helper packages for reading collections of related meta-data and counter-data files ("pods") produced by runs of coverage-instrumented binaries, and a new tool program (cmd/covdata) for dumping and/or manipulating coverage data files. Currently "go tool covdata" subcommands include 'merge', 'intersect', 'percent', 'pkglist', 'subtract', 'debugdump', and 'textfmt' (conversion to the legacy "go tool cover" format). Updates #51430. Change-Id: I44167c578f574b4636ab8726e726388531fd3258 Reviewed-on: https://go-review.googlesource.com/c/go/+/357609 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>