func (p *Provider) Dispose() {
	C.providerDestroy(p)
}
Dispose cleans up the Provider datastructures and frees associated memory
from the underlying C library (libstapsdt). The Provider instance is useless
after this method is invoked.
package salp
import "C"
import (
	"fmt"
	"unsafe"
)
type stapsdtError struct {
	code int
	msg  string
}
type Provider = C.struct_SDTProvider
type Probe = C.struct_SDTProbe
type ProbeArgType C.ArgType_t
const (
	Uint8 = ProbeArgType(C.uint8)
	Bool = Uint8
	Byte = Uint8
	Int8 = ProbeArgType(C.int8)
	Uint16 = ProbeArgType(C.uint16)
	Int16 = ProbeArgType(C.int16)
	Uint32 = ProbeArgType(C.uint32)
	Int32 = ProbeArgType(C.int32)
	Uint64 = ProbeArgType(C.uint64)
	Int64 = ProbeArgType(C.int64)
	String = ProbeArgType(C.uint64)
	Error = String
)
func (e stapsdtError) Error() string {
	return fmt.Sprintf("libstapsdt error [%v]: %v", e.code, e.msg)
}
func NewProvider(name string) *Provider {
	clbl := C.CString(name)
	defer C.free(unsafe.Pointer(clbl))
	return C.providerInit(clbl)
}
func (p *Provider) Name() string {
	return C.GoString(p.name)
}
func (p *Provider) err() error {
	return stapsdtError{
		code: int(p.errno),
		msg:  C.GoString(p.error),
	}
}
func (p *Provider) Load() error {
	rc := C.providerLoad(p)
	if int(rc) != 0 {
		return p.err()
	}
	return nil
}
func (p *Provider) AddProbe(name string, argTypes ...ProbeArgType) (*Probe, error) {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	var pp *Probe
	if l := len(argTypes); l == 0 {
		pp = C.salp_providerAddProbe(p, cname, 0, nil)
	} else {
		pp = C.salp_providerAddProbe(
			p, cname, C.uint32_t(l), (*C.ArgType_t)(&argTypes[0]))
	}
	if pp == nil {
		return nil, p.err()
	}
	return pp, nil
}
func MustAddProbe(p *Provider, name string, argTypes ...ProbeArgType) *Probe {
	prb, err := p.AddProbe(name, argTypes...)
	if err != nil {
		panic(err)
	}
	return prb
}
func MustLoadProvider(p *Provider) {
	err := p.Load()
	if err != nil {
		panic(err)
	}
}
func (p *Provider) Unload() {
	C.providerUnload(p)
}