func writeProfile(syscallsList []string, arch specs.Arch, profilePath string) {
	profile := specs.LinuxSeccomp{
		DefaultAction: specs.ActErrno,
		Architectures: []specs.Arch{arch},
		Syscalls: []specs.LinuxSyscall{
			specs.LinuxSyscall{
				Names:  syscallsList,
				Action: specs.ActAllow,
			},
		},
	}
	profileFile, err := os.Create(profilePath)
	if err != nil {
		log.Fatalf("Failed to create seccomp profile: %v", err)
	}
	defer profileFile.Close()
	enc := json.NewEncoder(profileFile)
	enc.SetIndent("", "    ")
	enc.Encode(profile)
	fmt.Printf("Saved seccomp profile at %v\n", profilePath)
}
write the seccomp profile to the profilePath file given an architecture and a list of syscalls (name)
package main
import (
	"debug/elf"
	"encoding/json"
	"fmt"
	"log"
	"os"
	"os/exec"
	"strings"
	"github.com/opencontainers/runtime-spec/specs-go"
)
func openElf(filename string) *elf.File {
	bin, err := os.OpenFile(filename, os.O_RDONLY, 0)
	if err != nil {
		log.Fatalln("can't open file", err)
	}
	f, err := elf.NewFile(bin)
	if err != nil {
		log.Fatalln("elf read error", err)
	}
	return f
}
func isGoBinary(file *elf.File) bool {
	if sect := file.Section(".gosymtab"); sect != nil {
		return true
	}
	if sect := file.Section(".note.go.buildid"); sect != nil {
		return true
	}
	return false
}
func getArch(file *elf.File) specs.Arch {
	var arch specs.Arch
	switch file.Machine.String() {
	case "EM_X86_64":
		arch = specs.ArchX86_64
	case "EM_386":
		arch = specs.ArchX86
	case "EM_ARM":
		arch = specs.ArchARM
	default:
		log.Fatalf("Unsuported arch : %v\n", file.Machine.String())
	}
	fmt.Println("Arch : ", arch)
	return arch
}