A syscall trace library in go.
- Linux
- x86
- x86_64
import "github.com/jfrabaute/libtrace"
Create a new TracerClient and install either callbacks or channels to receive all the syscalls you want to monitor.
tracer := libtrace.NewTracer(cmd)
tracer.RegisterGlobalCbOnExit(func(trace *libtrace.Trace) {
log.Printf("Syscall: %s\n", trace.Signature.Name)
})
tracer.Run()
tracer := libtrace.NewTracer(cmd)
tracer.RegisterCbOnExit(func(trace *libtrace.Trace) {
log.Printf("open: %d %s\n", trace.Return.Code, trace.Return.Description)
}, "open")
tracer.Run()
Sample app:
- gotrace is a basic "strace" app written in go using "libtrace".
libtrace is licensed under the MIT License. See LICENSE for full license text.