]> Cypherpunks repositories - gostls13.git/commit
runtime/coverage: apis to emit counter data under user control
authorThan McIntosh <thanm@google.com>
Thu, 14 Apr 2022 19:44:20 +0000 (15:44 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 29 Sep 2022 14:14:24 +0000 (14:14 +0000)
commitecd112c0d1c90a12d3c87172cf969cdd1f6cbeca
tree6321564e7b648280255e03e4a18e73b945e14da9
parentf2ee3414689add84c6e6d2d3f44dacde5129b18d
runtime/coverage: apis to emit counter data under user control

Add hooks/apis to support writing of coverage counter data and
meta-data under user control (from within an executing "-cover"
binary), so as to provide a way to obtain coverage data from programs
that do not terminate. This patch also adds a hook for clearing the
coverage counter data for a running program, something that can be
helpful when the intent is to capture coverage info from a specific
window of program execution.

Updates #51430.

Change-Id: I34ee6cee52e5597fa3698b8b04f1b34a2a2a418f
Reviewed-on: https://go-review.googlesource.com/c/go/+/401236
Reviewed-by: David Chase <drchase@google.com>
api/next/51430.txt [new file with mode: 0644]
src/runtime/coverage/apis.go [new file with mode: 0644]
src/runtime/coverage/emit.go
src/runtime/coverage/emitdata_test.go [new file with mode: 0644]
src/runtime/coverage/testdata/harness.go [new file with mode: 0644]