{"id":24865517,"url":"https://github.com/kfl/ebpf-cfg","last_synced_at":"2025-10-26T02:34:58.508Z","repository":{"id":201212074,"uuid":"707185540","full_name":"kfl/ebpf-cfg","owner":"kfl","description":"Starter code for working with a CFG for eBPF","archived":false,"fork":false,"pushed_at":"2024-09-13T07:37:22.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T23:59:50.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/kfl.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-19T11:47:09.000Z","updated_at":"2024-09-13T07:37:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8836c3e-1838-41ce-af16-a585c763bf13","html_url":"https://github.com/kfl/ebpf-cfg","commit_stats":null,"previous_names":["kfl/ebpf-cfg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Febpf-cfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Febpf-cfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Febpf-cfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Febpf-cfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfl","download_url":"https://codeload.github.com/kfl/ebpf-cfg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245717687,"owners_count":20661146,"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":[],"created_at":"2025-01-31T23:59:59.670Z","updated_at":"2025-10-26T02:34:53.476Z","avatar_url":"https://github.com/kfl.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"eBPF Control-Flow-Graph\n=======================\n\nSome starter code that shows how to use [`ebpf-tools`](https://github.com/kfl/ebpf-tools).\n\nStart by cloning or forking this repository, and then work on you own\nclone.\n\nAll the Haskell code of interest is in\n[`app/Main.hs`](./app/Main.hs). The code roughly does two things: it\nbuilds a control-flow-graph (CFG) and it visualise the CFG using\n[graphviz](https://graphviz.org/).\n\nYou can find some sample eBPF programs in the [`examples`](./examples)\ndirectory.\n\nThe set up in this project assumes that you are using `cabal` to build\nyour project.\n\n\nCabal details\n-------------\n\nUsing [`ebpf-tools`](https://github.com/kfl/ebpf-tools) is currently a\nbit gnarly, because it isn't released to Hackage yet. Thus, you must\nhave a `cabal.project` file with the following content:\n\n```cabal\n-- Using the unreleased v. 0.2.0.0 of ebpf-tools from github\nsource-repository-package\n    type: git\n    location: https://github.com/kfl/ebpf-tools.git\n    tag: 3024cfaddd9160bb746a2b20d982c511791c8644\n```\n\nAs demonstrated in this project.\n\n\nVisualise the CFG\n-----------------\n\nTo make a `dot` file of the CFG for an eBPF assembler file, say\n`examples/add.asm`, run the command:\n\n```\ncabal run ebpf-cfg -- examples/add.asm add.dot\n```\n\nTo make a PDF out of the `dot` file run the command (requires\n[graphviz](https://graphviz.org/)):\n\n```\ndot -Tpdf add.dot -o add.pdf\n```\n\n\nWhat if I'm using `stack`?\n--------------------------\n\nIf you are using `stack` then you'll want to add a `stack.yaml` file\nwith you favourite `stack` configuration, and then also the following\nfor `ebpf-tools`:\n\n```yaml\nextra-deps:\n  - github: kfl/ebpf-tools\n    commit: 3024cfaddd9160bb746a2b20d982c511791c8644\n```\n\n(You might also need to delete the `cabal.project` file. I don't know,\nI no longer use `stack`. If you have good `stack` advice that should\nbe included here, then please make a PR.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfl%2Febpf-cfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfl%2Febpf-cfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfl%2Febpf-cfg/lists"}