func (p *ProcessStatSample) collectIOCounters(proc *process.Process) { defer func() { if e := recover(); e != nil { log.Warnf("Recovered from panic on IO counters collection. Maybe unsupported on this platform.") } }() iocnt, err := proc.IOCounters() if err != nil { log.Warnf("Error encountered collecting I/O stats: %s", err) } else { src := reflect.ValueOf(iocnt).Elem() dest := reflect.ValueOf(&p.IOCounters).Elem() sum(&src, &dest) } }