Skip to content

jfrabaute/libtrace

Repository files navigation

libtrace

A syscall trace library in go.

License

Supported Platforms

  • Linux
    • x86
    • x86_64

Usage

import "github.com/jfrabaute/libtrace"

Create a new TracerClient and install either callbacks or channels to receive all the syscalls you want to monitor.

Monitoring all the syscalls

tracer := libtrace.NewTracer(cmd)
tracer.RegisterGlobalCbOnExit(func(trace *libtrace.Trace) {
	log.Printf("Syscall: %s\n", trace.Signature.Name)
})

tracer.Run()

Monitoring only "open" syscall

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".

Licensing

libtrace is licensed under the MIT License. See LICENSE for full license text.

About

A syscall trace library in go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages