func parseProcessTable(ctx context.Context, processes []*process.Process) (procs []*proc, e error) {
	procs = make([]*proc, 0, len(processes))
	for _, p := range processes {
		parsed, err := parseProc(ctx, p)
		if err != nil {  
			if e == nil {  
				e = err
			}
			continue
		}
		procs = append(procs, parsed)
	}
	return
}
parseProcessTable returns processes that could be parsed and the first error
package shutdown
import (
	"context"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"syscall"
	"text/tabwriter"
	"github.com/shirou/gopsutil/v3/net"
	"github.com/shirou/gopsutil/v3/process"
	"github.com/tetratelabs/func-e/internal/envoy"
	"github.com/tetratelabs/func-e/internal/moreos"
)
func enableNodeCollection(r *envoy.Runtime) error {
	nodeDir := filepath.Join(r.GetRunDir(), "node")
	if err := os.MkdirAll(nodeDir, 0750); err != nil {
		return fmt.Errorf("unable to create directory %q, so node data will not be captured: %w", nodeDir, err)
	}
	n := nodeCollection{nodeDir}
	r.RegisterShutdownHook(n.ps)
	r.RegisterShutdownHook(n.networkInterfaces)
	r.RegisterShutdownHook(n.activeConnections)
	return nil
}
type nodeCollection struct {
	nodeDir string
}
func (n *nodeCollection) ps(ctx context.Context) error {
	f, err := os.Create(filepath.Join(n.nodeDir, "ps.txt"))
	if err != nil {
		return fmt.Errorf("unable to create file to write ps output to: %w", err)
	}
	defer f.Close()  
	processes, err := process.ProcessesWithContext(ctx)
	if err == nil {
		err = ctx.Err()
	}
	if err != nil {
		if err.Error() == "not implemented yet" {  
			return nil  
		}
		return fmt.Errorf("unable to get list of running processes: %w", err)
	}
	parsed, err := parseProcessTable(ctx, processes)
	if len(parsed) == 0 {
		if err != nil {
			return fmt.Errorf("unable to parse any processes: %w", err)
		}
		return nil
	}
	return printProcessTable(f, parsed)
}
type proc struct {
	username, cmd            string
	status                   []string
	rss, vms, minflt, majflt uint64
	pCPU                     float64
	pid                      int32
	pMem                     float32
}