git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: I made a flame graph renderer for git's trace2 output

From
Derrick Stolee <stolee@gmail.com>
Date
May 10, 2019, 16:38 UTC
Message-ID
<8794fd2e-6256-3238-6d87-2e726d4a91fa@gmail.com>
In-Reply-To
<87zhnuwdkp.fsf@evledraar.gmail.com>
On 5/10/2019 11:09 AM, Ævar Arnfjörð Bjarmason wrote:
Show 17 quoted lines
> Here's a flamegraph of where git's test suite spends its time on my box:
> https://vm.nix.is/~avar/noindex/git-tests.svg
> 
> I hacked up a script for this today to plot trace2 production data, as
> noted there it's at:
> https://github.com/avar/FlameGraph/tree/stackcollapse-git-tr2-event
> 
> What are flamegraphs? See http://www.brendangregg.com/flamegraphs.html
> 
> As noted in TODOs in the script there's various stuff I'd like to do
> better, and this also shows how we need a lot more trace regions to get
> granular data.
> 
> But it's already quite cool, and I'll keep improving it. I'll submit a
> PR to Brendan's parent repo once I'm happy enough with it, I figure it
> makes more sense there than in git.git, but maybe we'd eventually want
> to teach the test suite to optionally use something like this.
This is a neat idea. Thanks!

For anyone else giving this a try, here are the steps I took to create my own [1], much smaller test:

# run some tests export GIT_TR2_EVENT=~/git-tr2-event.txt git fetch --all git gc git push

# get the FlameGraph repo git clone https://github.com/avar/FlameGraph.git cd FlameGraph

(
    # Get the proper perl packages, if you don't have them
    sudo apt install cpanminus
    sudo cpanm install JSON::XS
)
./stackcollapse-git-tr2-event.pl ~/git-tr2-event.txt | ./flamegraph.pl >git-test.svg
[1] https://github.com/derrickstolee/FlameGraph/blob/git-test/git-test.svg
Previous: Ævar Arnfjörð BjarmasonNext: SZEDER Gábor
Message 2 of 9 in “I made a flame graph renderer for git's trace2 output”
  1. Ævar Arnfjörð BjarmasonMay 10, 2019
  2. Derrick StoleeMay 10, 2019
  3. SZEDER GáborMay 10, 2019
  4. Jeff HostetlerMay 20, 2019
  5. Jeff KingMay 10, 2019
  6. Ævar Arnfjörð BjarmasonMay 10, 2019
  7. Jeff HostetlerMay 20, 2019
  8. Ævar Arnfjörð BjarmasonMay 21, 2019
  9. Jeff HostetlerMay 21, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.