{"id":13397018,"url":"https://github.com/grantseltzer/weaver","last_synced_at":"2025-02-28T20:14:42.226Z","repository":{"id":38837710,"uuid":"232918063","full_name":"grantseltzer/weaver","owner":"grantseltzer","description":"Trace Go program execution with uprobes and eBPF","archived":false,"fork":false,"pushed_at":"2023-08-17T02:01:48.000Z","size":8222,"stargazers_count":303,"open_issues_count":20,"forks_count":20,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-02-21T19:09:59.795Z","etag":null,"topics":["bcc","ebpf","go","golang","linux","trace","tracing","weaver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grantseltzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-01-09T22:27:24.000Z","updated_at":"2025-01-25T21:09:43.000Z","dependencies_parsed_at":"2024-01-02T20:51:49.130Z","dependency_job_id":null,"html_url":"https://github.com/grantseltzer/weaver","commit_stats":null,"previous_names":["grantseltzer/oster"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantseltzer%2Fweaver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantseltzer%2Fweaver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantseltzer%2Fweaver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantseltzer%2Fweaver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grantseltzer","download_url":"https://codeload.github.com/grantseltzer/weaver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241223410,"owners_count":19929696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bcc","ebpf","go","golang","linux","trace","tracing","weaver"],"created_at":"2024-07-30T18:01:09.428Z","updated_at":"2025-02-28T20:14:42.205Z","avatar_url":"https://github.com/grantseltzer.png","language":"Go","funding_links":[],"categories":["Go","开源类库","Open source library"],"sub_categories":["调试","Debugging"],"readme":"# Weaver\n\n\u003cb\u003ePLEASE READ!\u003c/b\u003e - 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\"\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"DrManhattanGopher.png\" alt=\"gopher\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\nWeaver 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.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/grantseltzer/weaver)](https://goreportcard.com/report/github.com/grantseltzer/weaver)\n\n\n## Quick Start \n\nThere 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](/docs).\n\n### Functions file\n\nTake the following example program: \n\n\u003ci\u003etest_prog.go\u003c/i\u003e\n```go\npackage main\n\n//go:noinline\nfunc test_function(int, [2]int) {}\n\n//go:noinline\nfunc other_test_function(rune, int64) {}\n\nfunc main() {\n\ttest_function(3, [2]int{1, 2})\n\tother_test_function('a', 33)\n}\n```\n\nLet'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:\n\n\u003ci\u003efunctions_to_trace.txt\u003c/i\u003e\n```\nmain.test_function(int, [2]int)\nmain.other_test_function(rune, int64)\n```\n\nNotice that we have to specify the parameter data types. \u003ci\u003e(You can use `weaver --types` to see what data types are supported.)\u003c/i\u003e\n\nNow we can call `weaver` like so:\n\n```\nsudo weaver -f /path/to/functions_to_trace.txt /path/to/test-prog-binary\n```\n\nWeaver 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.\n\n```\n{\"functionName\":\"main.other_test_function\",\"args\":[{\"type\":\"RUNE\",\"value\":\"a\"},{\"type\":\"INT64\",\"value\":\"33\"}],\"procInfo\":{\"pid\":43300,\"ppid\":42754,\"comm\":\"test-prog-binar\"}}\n{\"functionName\":\"main.test_function\",\"args\":[{\"type\":\"INT\",\"value\":\"3\"},{\"type\":\"INT_ARRAY\",\"value\":\"1, 2\"}],\"procInfo\":{\"pid\":43300,\"ppid\":42754,\"comm\":\"test-prog-binar\"}}\n```\n\n### Package mode\n\nFor the same example Go program as above, you can choose to not specify a functions file. The command would like like this:\n\n```\nsudo weaver /path/to/test-prog-binary\n```\n\nThis 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`)\n\nOutput does include argument vlaues in this mode.\n\n```\n{\"functionName\":\"main.main\",\"procInfo\":{\"pid\":44411,\"ppid\":42754,\"comm\":\"test-prog-binar\"}}\n{\"functionName\":\"main.test_function\",\"procInfo\":{\"pid\":44411,\"ppid\":42754,\"comm\":\"test-prog-binar\"}}\n```\n\n## Note on supported types\n\nCurrently 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:\n\n- user/stdlib defined structs\n- user/stdlib defined interfaces\n\n\n## System Dependencies\n\n- [bcc](https://github.com/iovisor/bcc/blob/master/INSTALL.md) / bcc-devel\n- linux kernel version \u003e 4.14 (please make bug reports if your kernel version doesn't work)\n\n## Build\n\n`make` will compile the weaver binary to `bin/weaver` (It also creates the smoke test binary and print-stack utility)\n\n\u003ci\u003eCan't build? Please make an issue!\u003c/i\u003e\n\n## Roadmap\n\nCheck issues for tasks currently being tracked. Please open bug reports, i'm sure there are plenty :-)\n\nShort term goals include:\n\n- Testing\n- Output options\n- Inspecting binaries for parameter data types instead of specifying them with a functions file\n- CI/CD infrastructre \n\n\u003ci\u003eimage modified version of art by Ashley McNamara ([license](https://creativecommons.org/licenses/by-nc-sa/4.0/)) based on art by Renee French.\u003c/i\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantseltzer%2Fweaver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantseltzer%2Fweaver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantseltzer%2Fweaver/lists"}