{"id":13509199,"url":"https://github.com/liamg/grace","last_synced_at":"2025-04-13T08:17:51.401Z","repository":{"id":62973690,"uuid":"558536854","full_name":"liamg/grace","owner":"liamg","description":":screwdriver: It's strace, with colours.","archived":false,"fork":false,"pushed_at":"2022-11-07T22:44:03.000Z","size":5412,"stargazers_count":274,"open_issues_count":4,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-24T11:56:54.909Z","etag":null,"topics":["cli","colors","colours","debug","go","golang","ptrace","strace","syscalls","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liamg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-27T18:45:03.000Z","updated_at":"2025-03-19T13:50:12.000Z","dependencies_parsed_at":"2022-11-10T05:01:49.063Z","dependency_job_id":null,"html_url":"https://github.com/liamg/grace","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liamg","download_url":"https://codeload.github.com/liamg/grace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245755669,"owners_count":20667027,"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":["cli","colors","colours","debug","go","golang","ptrace","strace","syscalls","tool"],"created_at":"2024-08-01T02:01:04.444Z","updated_at":"2025-03-27T00:08:42.767Z","avatar_url":"https://github.com/liamg.png","language":"Go","readme":"# grace\n\n_grace_ is a tool for monitoring and annotating syscalls for a given process.\n\nIt's essentially a lightweight [strace](https://en.wikipedia.org/wiki/Strace), in Go, with colours and pretty output.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"demo.gif\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"compare.png\"/\u003e\n\u003c/p\u003e\n\nIt's possible to tweak and filter the output to make it quite readable, for example (using `-vnmx`):\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"ux.png\"/\u003e\n\u003c/p\u003e\n\nYou can also review a summary of encountered syscalls (and sort by various columns):\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"summary.png\"/\u003e\n\u003c/p\u003e\n\n\n### grace vs. strace\n\n_grace_ isn't meant to compete with _strace_, it's purely meant to be a user-friendly, lightweight alternative. However, the following should provide a rough idea of what is supported in _grace_ so far.\n\nOver time grace is meant to become a simpler, more readable alternative to strace (_strace for dummies?_), albeit with reduced functionality/advanced features.\n\n| Feature                                                                               | grace | strace |\n|---------------------------------------------------------------------------------------|-------|--------|\n| Start a program and print all syscalls it makes                                       | ✅     | ✅      |\n| Attach to an existing process by `pid` and print all syscalls it makes                | ✅     | ✅      |\n| Filter syscalls by name, e.g. only show occurrences of the `open` syscall             | ✅     | ✅      |\n| Filter syscalls using a given path, e.g. only show syscalls that access `/etc/passwd` | ✅     | ✅      |\n| Dump I/O for certain file descriptors                                                 | ✅     | ✅      |\n| Count occurrences and duration of all syscalls and present in a useful format         | ✅     | ✅      |\n| Print relative/absolute timestamps                                                    | ✅     | ✅      |\n| Tamper with syscalls                                                                  | ❌     | ✅      |\n| Print extra information about file descriptors, such as path, socket addresses etc.   | ✅     | ✅      |\n| Print stack traces                                                                    | ❌     | ✅      |\n| Filter by return value                                                                | ✅     | ✅      |\n| Pretty colours to make output easier to read                                          | ✅     | ❌      |\n| Lots of output options and customisation vectors                                      | ✅     | ✅      |\n| Output to file                                                                        | ✅     | ✅      |\n| Filter by failing/non-failing syscalls                                                | ✅     | ✅      |\n\n_NOTE: Please feel free to add important strace features to this table, I'm working with a limited knowledge of strace._\n\n\n\n## Installation\n\nGrab a statically compiled binary from the [latest release](https://github.com/liamg/grace/releases/latest).\n\n## Supported Platforms/Architecture\n\nCurrently only Linux/amd64 is supported. Other architectures coming soon.\n\nIf you'd like to implement a new architecture, you can duplicate `tracer/sys_amd64.go` and convert it to contain the syscall definitions for your arch.\n\n### Usage Examples\n\n#### Trace a program\n\n```bash\ngrace -- cat /dev/null  # replace 'cat /dev/null' with your program\n```\n\n#### Trace an existing process\n\n```bash\ngrace -p 123 # replace 123 with your pid\n\n# e.g. you could use pgrep to find the pid of a process\ngrace -p `pgrep ping`\n```\n\n#### Trace a program and filter by syscall name\n\n```bash\ngrace -f \"name=openat\" -- cat /dev/null \n\n# you can also look for multiple syscalls\ngrace -f \"name=openat\u0026name=close\" -- cat /dev/null\n```\n\n#### Trace a program and filter by syscall name and path\n\n```bash\ngrace -f \"name=openat\u0026path=/dev/null\" -- cat /dev/null\n```\n\n#### Trace a program and wire up stdin/out/err with the terminal\n\n```bash\ngrace -F -- cat\n```\n\n#### Trace a program with maximum readability options\n\n```bash\ngrace -vnmx -- cat /dev/null\n```\n\n#### Trace only failing syscalls\n\n```bash\ngrace -Z -- cat /dev/null \n```\n\n#### Show a summary of syscalls with durations, counts and errors\n\n```bash\ngrace -S -- cat /dev/null\n```\n\n## Build Dependencies\n\nIf you want to build _grace_ yourself instead of using the precompiled binaries, you'll need a recent version of Go (1.19+). Then `make build` is your friend.\n","funding_links":[],"categories":["Go","cli"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamg%2Fgrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliamg%2Fgrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamg%2Fgrace/lists"}