github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/coverage/rtcov/rtcov.go (about)

     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  // CovMetaBlob is a container for holding the meta-data symbol (an
     8  // RODATA variable) for an instrumented Go package. Here "p" points to
     9  // the symbol itself, "len" is the length of the sym in bytes, and
    10  // "hash" is an md5sum for the sym computed by the compiler. When
    11  // the init function for a coverage-instrumented package executes, it
    12  // will make a call into the runtime which will create a covMetaBlob
    13  // object for the package and chain it onto a global list.
    14  type CovMetaBlob struct {
    15  	P                  *byte
    16  	Len                uint32
    17  	Hash               [16]byte
    18  	PkgPath            string
    19  	PkgID              int
    20  	CounterMode        uint8
    21  	CounterGranularity uint8
    22  }
    23  
    24  // CovCounterBlob is a container for encapsulating a counter section
    25  // (BSS variable) for an instrumented Go module. Here "counters"
    26  // points to the counter payload and "len" is the number of uint32
    27  // entries in the section.
    28  type CovCounterBlob struct {
    29  	Counters *uint32
    30  	Len      uint64
    31  }