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

Re: Drastic jump in the time required for the test suite

From
Jeff King <peff@peff.net>
Date
Oct 20, 2016, 23:20 UTC
Message-ID
<20161020232052.uggm2w7qitrj5f7g@sigill.intra.peff.net>
In-Reply-To
<20161020210013.57wkyhmf2ism6vt2@sigill.intra.peff.net>
On Thu, Oct 20, 2016 at 05:00:13PM -0400, Jeff King wrote:
Show 10 quoted lines
> > I am not an expert on perl nor tracing, but is it feasible to find out
> > how many internal calls there are? i.e. either some shell script (rebase,
> > submodule) calling git itself a couple of times or even from compile/git/git
> > itself, e.g. some submodule operations use forking in there.
> 
> The script below is my attempt, though I think it is not quite right, as
> "make" should be the single apex of the graph. You can run it like:
> 
>   strace -f -o /tmp/foo.out -e clone,execve make test
>   perl graph.pl /tmp/foo.out | less -S

Ah, I see why it is sometimes wrong. We may see parent/child interactions out of order. E.g., we may see:

  1. Process B execs "git".
  2. Process B exits.
  3. Process A forks pid B.

because strace does not manage to ptrace "A" before "B" finishes running. It's hard to tell in step 3 if this is the same "A" we saw earlier. You cannot just go by PID, because the tests run enough processes that we end up reusing PIDs. My script has a hack which increments a counter when processes go away, but that happens in step 2 above (and steps 1 and 3 think they are seeing different processes, even though they are the same).

I'm sure it could be cleverly hacked around, but the easiest thing is probably to just make sure the tests are not run in parallel. High load makes that kind of out-of-order sequence much more likely.

Making sure I run it with "make -j1", the script I posted earlier gives pretty reasonable output. I won't post mine here, as it's double-digit megabytes, but you should be able to recreate it yourself.

Of course, the call graph by itself isn't that interesting. But you might be able to do some interesting analysis, or just find spots of interest to you (like git-submodule).

-Peff
Previous: Jeff KingNext: Johannes Sixt
Message 17 of 31 in “Drastic jump in the time required for the test suite”
  1. Johannes SchindelinOct 19, 2016
  2. Junio C HamanoOct 19, 2016
  3. Jeff KingOct 19, 2016
  4. Johannes SchindelinOct 20, 2016
  5. Jeff KingOct 20, 2016
  6. Stefan BellerOct 20, 2016
  7. Jeff KingOct 20, 2016
  8. Stefan BellerOct 20, 2016
  9. Jeff KingOct 20, 2016
  10. Jeff KingOct 20, 2016
  11. Johannes SixtOct 21, 2016
  12. Jeff KingOct 21, 2016
  13. Johannes SchindelinOct 20, 2016
  14. Jeff KingOct 20, 2016
  15. Stefan BellerOct 20, 2016
  16. Jeff KingOct 20, 2016
  17. Jeff KingOct 20, 2016
  18. Johannes SixtOct 20, 2016
  19. Jeff KingOct 20, 2016
  20. Dennis KaarsemakerOct 20, 2016
  21. Duy NguyenOct 21, 2016
  22. Junio C HamanoOct 20, 2016
  23. Matthieu MoyOct 20, 2016
  24. Duy NguyenOct 20, 2016
  25. René ScharfeOct 20, 2016
  26. Duy NguyenOct 21, 2016
  27. René ScharfeOct 21, 2016
  28. Matthieu MoyOct 21, 2016
  29. René ScharfeOct 21, 2016
  30. Eric WongOct 27, 2016
  31. Duy NguyenOct 28, 2016

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.