// NewMultiProfiler initializes a profiler for recording multiple perf events
// at once.
NewMultiProfiler initializes a profiler for recording multiple perf events
at once.
// NewMultiProfiler initializes a profiler for recording multiple perf events // at once .
func NewMultiProfiler(attrs []*perf.Attr, pid, cpu int) (*MultiProfiler, error) {
	profs := make([]Profiler, len(attrs))
	var errs []error
	for i, attr := range attrs {
		p, err := NewSingleProfiler(attr, pid, cpu)
		if err != nil {
			errs = append(errs, err)
		}
		profs[i] = p
	}
	return &MultiProfiler{
		profilers: profs,
	}, MultiErr(errs)
}
func NewMultiProfiler ( attrs [ ] * perf . Attr , pid , cpu int ) ( * MultiProfiler , error ) { profs := make ( [ ] Profiler , len ( attrs ) ) var errs [ ] error for i , attr := range attrs { p , err := NewSingleProfiler ( attr , pid , cpu ) if err != nil { errs = append ( errs , err ) } profs [ i ] = p } return & MultiProfiler { profilers : profs , } , MultiErr ( errs ) }
NewMultiProfiler initializes a profiler for recording multiple perf events
at once.
NewMultiProfiler initializes a profiler for recording multiple perf events at once .