{"id":13501266,"url":"https://github.com/furkanonder/beetrace","last_synced_at":"2025-04-06T20:11:16.554Z","repository":{"id":103091063,"uuid":"588769981","full_name":"furkanonder/beetrace","owner":"furkanonder","description":"Trace your python process line by line with eBPF!","archived":false,"fork":false,"pushed_at":"2023-02-19T21:56:50.000Z","size":379,"stargazers_count":257,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T18:10:04.750Z","etag":null,"topics":["bpf","bpftrace","ebpf","tracing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/furkanonder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-14T00:27:14.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":"2023-05-20T22:00:46.922Z","dependency_job_id":null,"html_url":"https://github.com/furkanonder/beetrace","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"de438de90fdb862cb01d5041b4815848e5a05cd0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fbeetrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fbeetrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fbeetrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fbeetrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furkanonder","download_url":"https://codeload.github.com/furkanonder/beetrace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543591,"owners_count":20955865,"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":["bpf","bpftrace","ebpf","tracing"],"created_at":"2024-07-31T22:01:31.043Z","updated_at":"2025-04-06T20:11:16.530Z","avatar_url":"https://github.com/furkanonder.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"/assets/logo/beetrace.png\" width=500px /\u003e\n  \u003ch2\u003eTrace your python process line by line with low overhead!\u003c/h2\u003e\n\u003c/div\u003e\n\n_beetrace_ allows you to trace a Python process line by line or the functions' entries\nand returns. It uses USDT(User Statically-Defined Tracing) probes with\n[bpftrace](https://github.com/iovisor/bpftrace/).\n\n## Dependencies\n\n- This package is only available for Linux and requires bpftrace. You can look at the\n  bpftrace installation\n  [here](https://github.com/iovisor/bpftrace/blob/master/INSTALL.md).\n\n- CPython must be\n  [configured with the --with-dtrace option](https://docs.python.org/3/using/configure.html#cmdoption-with-dtrace).\n\n## Installation\n\n```bash\npip install beetrace\n```\n\n## Usage \u0026 Example\n\nTo trace the Python process, use the -p parameter to pass the pid value.\n\n```bash\nbeetrace -p {pid of process}\n```\n\nLet's take a look at the quick example.\n\n---\n\n```bash\n$ cat -n example.py\n1 import os\n2 from time import sleep\n3\n4\n5 def c():\n6     x = 1\n7\n8 def b():\n9     y = 2\n10    c()\n11\n12\n13 def a():\n14     z = 1\n15     b()\n16\n17\n18 while True:\n19     print(f\"PID of program: {os.getpid()}\")\n20     sleep(1)\n21     print(\"Sleep 1 second\")\n22     a()\n```\n\nOutput:\n\n```bash\nPID of program: 17988\nSleep 1 second\nPID of program: 17988\nSleep 1 second\nPID of program: 17988\nSleep 1 second\nPID of program: 17988\n...\n...\n...\n```\n\n```bash\n$ beetrace -p 17988\n___  ____ ____ ___ ____ ____ ____ ____\n|__] |___ |___  |  |__/ |__| |    |___\n|__] |___ |___  |  |  \\ |  | |___ |___\n\nPID: 17988 | Tracing from: python3 example.py\n\nPress Control-C to quit.\n\nPath                                   File:Line                                          Function\n/tmp                                   example.py:18                                      \u003cmodule\u003e\n/tmp                                   example.py:19                                      \u003cmodule\u003e\n/tmp                                   example.py:20                                      \u003cmodule\u003e\n/tmp                                   example.py:21                                      \u003cmodule\u003e\n/tmp                                   example.py:22                                      \u003cmodule\u003e\n/tmp                                   example.py:14                                      a\n/tmp                                   example.py:15                                      a\n/tmp                                   example.py:9                                       b\n/tmp                                   example.py:10                                      b\n/tmp                                   example.py:6                                       c\n/tmp                                   example.py:18                                      \u003cmodule\u003e\n/tmp                                   example.py:19                                      \u003cmodule\u003e\n/tmp                                   example.py:20                                      \u003cmodule\u003e\n/tmp                                   example.py:21                                      \u003cmodule\u003e\n/tmp                                   example.py:22                                      \u003cmodule\u003e\n/tmp                                   example.py:14                                      a\n/tmp                                   example.py:15                                      a\n/tmp                                   example.py:9                                       b\n/tmp                                   example.py:10                                      b\n/tmp                                   example.py:6                                       c\n/tmp                                   example.py:18                                      \u003cmodule\u003e\n/tmp                                   example.py:19                                      \u003cmodule\u003e\n/tmp                                   example.py:20                                      \u003cmodule\u003e\n...                                    ...                                                ...\n...                                    ...                                                ...\n...                                    ...                                                ...\n```\n\n\nhttps://user-images.githubusercontent.com/24194934/212464397-0bf66a4a-4114-4d5f-b500-b7a7f7ca0eca.mp4\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanonder%2Fbeetrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurkanonder%2Fbeetrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanonder%2Fbeetrace/lists"}