{"id":16271084,"url":"https://github.com/okuvshynov/flamereport","last_synced_at":"2025-10-04T06:31:12.683Z","repository":{"id":151486705,"uuid":"309312716","full_name":"okuvshynov/flamereport","owner":"okuvshynov","description":"FlameGraph visualization for terminal","archived":false,"fork":false,"pushed_at":"2020-12-14T08:37:20.000Z","size":1213,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-10T22:29:38.594Z","etag":null,"topics":["flamegraph","profiling","tui"],"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/okuvshynov.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":"2020-11-02T09:01:15.000Z","updated_at":"2023-10-17T21:32:56.000Z","dependencies_parsed_at":"2023-05-03T09:46:20.237Z","dependency_job_id":null,"html_url":"https://github.com/okuvshynov/flamereport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okuvshynov%2Fflamereport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okuvshynov%2Fflamereport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okuvshynov%2Fflamereport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okuvshynov%2Fflamereport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okuvshynov","download_url":"https://codeload.github.com/okuvshynov/flamereport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235222586,"owners_count":18955331,"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":["flamegraph","profiling","tui"],"created_at":"2024-10-10T18:12:22.237Z","updated_at":"2025-10-04T06:31:12.271Z","avatar_url":"https://github.com/okuvshynov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flame Graphs for terminal\n\n![Example](/samples/sqlite_sample.png)\n\nThis is an implementation of flame graphs right in the terminal.\n\nFor an overview of flame graphs and original implementation, check [Brendan Gregg's website](http://www.brendangregg.com/flamegraphs.html) \n\nWhile not as powerful as GUI tools, having chart right in the terminal is more convenient in case of iterative process, like:\n1. run a profile on remote machine\n2. visualize and study the profile\n3. make changes in code/workload/app-level settings/profiling settings/...\n4. repeat\n\nIn specific case of Linux perf flamereport can be seen as an alternative to running 'perf report'.\n\n## Flame graphs overview\nPlease check http://www.brendangregg.com/flamegraphs.html\n\n## Usage example\n\n### With provided sample\n\n```$ python flame.py \u003c samples/osx_dtrace```\n\n### reproducing provided sample on Mac OS\n\n1. Run dtrace with -q quiet flag:\n\n```sudo dtrace -q -x stackframes=100 -n 'profile-99 /arg0/ { @[stack()] = count(); } tick-10s { exit(0); }' -o dtrace_stacks```\n\n2. Get https://github.com/brendangregg/FlameGraph (needed for stack folding)\n\n```$ git clone https://github.com/brendangregg/FlameGraph.git```\n\n3. Now collapse stacks:\n\n```$ ./FlameGraph/stackcollapse.pl \u003c dtrace_stacks \u003e stacks```\n\n4. Run:\n\n```$ python ./flametui/flame.py \u003c stacks```\n\n### With Linux perf\n\n1. Get https://github.com/brendangregg/FlameGraph (needed for stack folding)\n\n```$ git clone https://github.com/brendangregg/FlameGraph.git```\n\n2. Do system-wide profile:\n\n```$ perf record -F 999 -a -g -- sleep 10```\n\n3. Collapse stacks:\n\n```$ perf script | ./FlameGraph/stackcollapse-perf.pl \u003e stacks```\n\n4. View visualization\n\n```$ python ./flametui/flame.py \u003c ./stacks```\n\n\n## Interactive commands\n* left/h - select the block to the left\n* right/l - select the block to the right\n* up/k - select the block above\n* down/j - select the block below\n* f - focus. Zoom into selected frame; makes it fit whole width, hides the siblings.\n* p - pin to top. This zooms into selected frame (like 'f') and hides parent frames. This is useful for deep traces, as there's no scrolling functionality.\n* F - hard focus. Zoom into all frames with title of selected frame, pin them to top.\n* x - eXclude frame. Removes the selected frame, its children and shrinks parents accordingly. This is useful when the graph is dominated by few large but not particularly interesting frames; It provides a more convenient view compared to focusing on 'smaller but more interesting' frames individually.\n* r - reset focus. Resets the focus but keeps exculded frames excluded.\n* R - hard reset, brings everything to default view; Useful after exclusions.\n* single mouse click - select the block\n* double mouse click - zoom into the block. Equivalent to 'f'\n* / - search\n* n/N - select next/prev block within the highlighted set of views\n* q - quit\n\n## Output description\n\nSimple selection with auto-highlight matching frames\n\n![Example](/samples/sqlite_selection.png)\n\nSelecting a cell with multiple frames in it. Pressing 'n' on previous example would bring us here:\n\n![Example](/samples/sqlite_multiselect.png)\n\nIn case 'x' was used to hide some of the less interesting frames, status will show how much was excluded:\n\n![Example](/samples/sqlite_exclusion.png)\n\n\nGraph element examples\n* '[foo---]' -- individual frame. \n* '-' - also individual frame. \n* '+' - aggregated frame view which contains several frames. Selecting it will show the details in the status area. Might have hidden descendents. \n\n## Known limitations\n* No color-coding for parts of stack traces (kernel/userspace/vm/native/etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokuvshynov%2Fflamereport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokuvshynov%2Fflamereport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokuvshynov%2Fflamereport/lists"}