tracer.go
func New(options NewOptions) *BTTracer {
	moduleOpt := "--module=go:enable,true"
	if !options.IncludeSystemGs {
		moduleOpt += ",filter,user"
	}

	return &BTTracer{
		cmd: "/opt/backtrace/bin/ptrace",
		kvp: "--kv",
		kvd: ":",
		options: []string{
			"--load=",
			moduleOpt,
			"--faulted",
			strconv.Itoa(os.Getpid())},
		ss: []os.Signal{
			syscall.SIGABRT,
			syscall.SIGFPE,
			syscall.SIGSEGV,
			syscall.SIGILL,
			syscall.SIGBUS},
		logger: &defaultLogger{
			logger: log.New(os.Stderr, "[bcd] ", log.LstdFlags),
			level:  LogError},
		defaultTraceOptions: TraceOptions{
			Faulted:           true,
			CallerOnly:        false,
			ErrClassification: true,
			Timeout:           time.Second * 120}}
}
func New(options NewOptions) *BTTracer {
	moduleOpt := "--module=go:enable,true"
	if !options.IncludeSystemGs {
		moduleOpt += ",filter,user"
	}

	return &BTTracer{
		cmd: "/opt/backtrace/bin/ptrace",
		kvp: "--kv",
		kvd: ":",
		options: []string{
			"--load=",
			moduleOpt,
			"--faulted",
			strconv.Itoa(os.Getpid())},
		ss: []os.Signal{
			syscall.SIGABRT,
			syscall.SIGFPE,
			syscall.SIGSEGV,
			syscall.SIGILL,
			syscall.SIGBUS},
		logger: &defaultLogger{
			logger: log.New(os.Stderr, "[bcd] ", log.LstdFlags),
			level:  LogError},
		defaultTraceOptions: TraceOptions{
			Faulted:           true,
			CallerOnly:        false,
			ErrClassification: true,
			Timeout:           time.Second * 120}}
}
func New ( options NewOptions ) * BTTracer { moduleOpt := " " if ! options . IncludeSystemGs { moduleOpt += " " } return & BTTracer { cmd : " " , kvp : " " , kvd : " " , options : [ ] string { " " , moduleOpt , " " , strconv . Itoa ( os . Getpid ( ) ) } , ss : [ ] os . Signal { syscall . SIGABRT , syscall . SIGFPE , syscall . SIGSEGV , syscall . SIGILL , syscall . SIGBUS } , logger : & defaultLogger { logger : log . New ( os . Stderr , " " , log . LstdFlags ) , level : LogError } , defaultTraceOptions : TraceOptions { Faulted : true , CallerOnly : false , ErrClassification : true , Timeout : time . Second * 120 } } }
// Returns a new object implementing the bcd.Tracer and bcd.TracerSig interfaces
// using the Backtrace debugging platform. Currently, only Linux and FreeBSD
// are supported.
//
// Relevant default values:
//
// Tracer path: /opt/backtrace/bin/ptrace.
//
// Output directory: Current working directory of process.
//
// Signal set: ABRT, FPE, SEGV, ILL, BUS. Note: Go converts BUS, FPE, and
// SEGV arising from process execution into run-time panics, which cannot be
// handled by signal handlers. These signals are caught when sent from
// os.Process.Kill or similar.
//
// The default logger prints to stderr.
//
// DefaultTraceOptions:
//
// Faulted: true
//
// CallerOnly: false
//
// ErrClassification: true
//
// Timeout: 120s
Returns a new object implementing the bcd . Tracer and bcd . TracerSig interfaces using the Backtrace debugging platform . Currently only Linux and FreeBSD are supported . Relevant default values : Tracer path : / opt / backtrace / bin / ptrace . Output directory : Current working directory of process . Signal set : ABRT FPE SEGV ILL BUS . Note : Go converts BUS FPE and SEGV arising from process execution into run - time panics which cannot be handled by signal handlers . These signals are caught when sent from os . Process . Kill or similar . The default logger prints to stderr . DefaultTraceOptions : Faulted : true CallerOnly : false ErrClassification : true Timeout : 120s