All Projects → grantseltzer → Weaver

grantseltzer / Weaver

Licence: lgpl-3.0
Trace Go program execution with uprobes and eBPF

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Weaver

Bpfd
Framework for running BPF programs with rules on Linux as a daemon. Container aware.
Stars: ✭ 396 (+127.59%)
Mutual labels:  tracing, ebpf
Opencensus Java
A stats collection and distributed tracing framework
Stars: ✭ 640 (+267.82%)
Mutual labels:  tracing, trace
Zipkin Go
Zipkin tracer library for go
Stars: ✭ 435 (+150%)
Mutual labels:  tracing, trace
pwru
Packet, where are you? -- Linux kernel networking debugger
Stars: ✭ 694 (+298.85%)
Mutual labels:  tracing, ebpf
Hubble
Hubble - Network, Service & Security Observability for Kubernetes using eBPF
Stars: ✭ 1,245 (+615.52%)
Mutual labels:  tracing, ebpf
Tapping device
TappingDevice makes objects tell you what they do, so you don't need to track them yourself.
Stars: ✭ 296 (+70.11%)
Mutual labels:  tracing, trace
Jaeger Ui
Web UI for Jaeger
Stars: ✭ 639 (+267.24%)
Mutual labels:  tracing, trace
uprobe-http-tracer
uprobe-based HTTP tracer for Go binaries
Stars: ✭ 45 (-74.14%)
Mutual labels:  tracing, ebpf
Kubectl Trace
Schedule bpftrace programs on your kubernetes cluster using the kubectl
Stars: ✭ 1,194 (+586.21%)
Mutual labels:  trace, ebpf
Ebpf exporter
Prometheus exporter for custom eBPF metrics
Stars: ✭ 829 (+376.44%)
Mutual labels:  tracing, ebpf
ctrace-go
Canonical OpenTracing for GoLang
Stars: ✭ 12 (-93.1%)
Mutual labels:  tracing, trace
Opencensus Web
A stats collection and distributed tracing framework
Stars: ✭ 168 (-3.45%)
Mutual labels:  tracing, trace
zipkin-cpp-opentracing
OpenTracing Tracer implementation for Zipkin in C++
Stars: ✭ 46 (-73.56%)
Mutual labels:  tracing, trace
Bpftrace
High-level tracing language for Linux eBPF
Stars: ✭ 4,526 (+2501.15%)
Mutual labels:  tracing, ebpf
go-sensor
🚀 Go Distributed Tracing & Metrics Sensor for Instana
Stars: ✭ 90 (-48.28%)
Mutual labels:  tracing, trace
Zipkin Go Opentracing
OpenTracing Bridge for Zipkin Go
Stars: ✭ 472 (+171.26%)
Mutual labels:  tracing, trace
ebpfpub
ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.
Stars: ✭ 86 (-50.57%)
Mutual labels:  tracing, ebpf
zipkin-ruby-opentracing
OpenTracing Tracer implementation for Zipkin in Ruby
Stars: ✭ 15 (-91.38%)
Mutual labels:  tracing, trace
Molten
php probe for zipkin and opentracing
Stars: ✭ 740 (+325.29%)
Mutual labels:  tracing, trace
Opencensus Csharp
Distributed tracing and stats collecting framework
Stars: ✭ 126 (-27.59%)
Mutual labels:  tracing, trace

Weaver

PLEASE READ! - I am currently refactoring Weaver to use libbpf instead of bcc which would include various other major improvements. If you're currently using weaver please be aware that features/bug fixes are being held off until the major refactor occurs. This will be tracked in the branch "refactor"

gopher

Weaver is a CLI tool that allows you to trace Go programs in order to inspect what values are passed to specified functions. It leverages eBPF attached to uprobes.

Go Report Card

Quick Start

There are two modes of operation, one that uses a 'functions file', and one that extracts a symbol table from a passed binary and filters by Go packages. More information on functionality in docs.

Functions file

Take the following example program:

test_prog.go

package main

//go:noinline
func test_function(int, [2]int) {}

//go:noinline
func other_test_function(rune, int64) {}

func main() {
	test_function(3, [2]int{1, 2})
	other_test_function('a', 33)
}

Let's say we want to know what values are passed to test_function and other_test_function whenever the program is run. Once the program is compiled (make) we just have to create a file which specifies each function to trace:

functions_to_trace.txt

main.test_function(int, [2]int)
main.other_test_function(rune, int64)

Notice that we have to specify the parameter data types. (You can use weaver --types to see what data types are supported.)

Now we can call weaver like so:

sudo weaver -f /path/to/functions_to_trace.txt /path/to/test-prog-binary

Weaver will then sit idle without any output until test-prog is run and the test_function and other_test_function functions are called. This will also work on an already running Go Program.

{"functionName":"main.other_test_function","args":[{"type":"RUNE","value":"a"},{"type":"INT64","value":"33"}],"procInfo":{"pid":43300,"ppid":42754,"comm":"test-prog-binar"}}
{"functionName":"main.test_function","args":[{"type":"INT","value":"3"},{"type":"INT_ARRAY","value":"1, 2"}],"procInfo":{"pid":43300,"ppid":42754,"comm":"test-prog-binar"}}

Package mode

For the same example Go program as above, you can choose to not specify a functions file. The command would like like this:

sudo weaver /path/to/test-prog-binary

This will default to only tracing functions in the main package, however you can use the --packages flag to specify a comma seperated list of packages (typially of the form github.com/x/y)

Output does include argument vlaues in this mode.

{"functionName":"main.main","procInfo":{"pid":44411,"ppid":42754,"comm":"test-prog-binar"}}
{"functionName":"main.test_function","procInfo":{"pid":44411,"ppid":42754,"comm":"test-prog-binar"}}

Note on supported types

Currently weaver supports basic data types but getting support for user defined types is a high priority. Getting following types defined are a work in progress:

  • user/stdlib defined structs
  • user/stdlib defined interfaces

System Dependencies

  • bcc / bcc-devel
  • linux kernel version > 4.14 (please make bug reports if your kernel version doesn't work)

Build

make will compile the weaver binary to bin/weaver (It also creates the smoke test binary and print-stack utility)

Can't build? Please make an issue!

Roadmap

Check issues for tasks currently being tracked. Please open bug reports, i'm sure there are plenty :-)

Short term goals include:

  • Testing
  • Output options
  • Inspecting binaries for parameter data types instead of specifying them with a functions file
  • CI/CD infrastructre

image modified version of art by Ashley McNamara (license) based on art by Renee French.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].