Source file src/internal/coverage/rtcov/rtcov.go

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package rtcov
     6  
     7  // This package contains types whose structure is shared between
     8  // the runtime package and the "runtime/coverage" package.
     9  
    10  // CovMetaBlob is a container for holding the meta-data symbol (an
    11  // RODATA variable) for an instrumented Go package. Here "p" points to
    12  // the symbol itself, "len" is the length of the sym in bytes, and
    13  // "hash" is an md5sum for the sym computed by the compiler. When
    14  // the init function for a coverage-instrumented package executes, it
    15  // will make a call into the runtime which will create a covMetaBlob
    16  // object for the package and chain it onto a global list.
    17  type CovMetaBlob struct {
    18  	P                  *byte
    19  	Len                uint32
    20  	Hash               [16]byte
    21  	PkgPath            string
    22  	PkgID              int
    23  	CounterMode        uint8 // coverage.CounterMode
    24  	CounterGranularity uint8 // coverage.CounterGranularity
    25  }
    26  
    27  // CovCounterBlob is a container for encapsulating a counter section
    28  // (BSS variable) for an instrumented Go module. Here "counters"
    29  // points to the counter payload and "len" is the number of uint32
    30  // entries in the section.
    31  type CovCounterBlob struct {
    32  	Counters *uint32
    33  	Len      uint64
    34  }
    35  

View as plain text