func (cs *CounterGroup) Read() ([]uint64, []float64, error) {
	cs.leader.Disable()
	defer cs.leader.Enable()
	var (
		values      []uint64
		percentages []float64
	)
	for _, c := range cs.cs {
		v, p, err := c.Read()
		if err != nil {
			return nil, nil, err
		}
		_ = p  
		values = append(values, v)
		percentages = append(percentages, p)
	}
	return values, percentages, nil
}
Read all the counters.
The group leader is disabled first so that the counts are not disturbed.
package perf
import (
	"encoding/binary"
	"encoding/csv"
	"fmt"
	"io"
	"os"
	"runtime"
	"sync"
	"syscall"
	"unsafe"
	"github.com/pwaller/perf/gen"
)
type Option func(*Config) error
func Options(options ...Option) Option {
	return func(cfg *Config) error {
		for _, o := range options {
			err := o(cfg)
			if err != nil {
				return err
			}
		}
		return nil
	}
}
type Config struct {
	Name string  
	CPU     int64   
	GroupFD int64   
	Flags   uint64  
	WholeProcess bool
	gen.Attr
}
type Counter struct {
	Name string
	fd      *os.File
	fdPtr   uintptr
	enabled bool
}
type CounterGroup struct {
	leader *Counter
	cs     []*Counter
	enabled bool
}