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

[PATCH v2 0/2] add trace2 regions to fetch & push

From
Josh Steadmon <steadmon@google.com>
Date
Oct 7, 2019, 22:35 UTC
Message-ID
<cover.1570487473.git.steadmon@google.com>
In-Reply-To
<cover.1570059953.git.steadmon@google.com>

We'd like to collect better statistics about where the time is spent in fetches and pushes so that we can hopefully identify some areas for future optimization. So let's add some trace2 regions around some of the fetch/push phases so we can break down their timing.

Changes since V1:
* Use the repository struct argument in transport_push(), rather than
  the global the_repository.
Josh Steadmon (2):
  fetch: add trace2 instrumentation
  push: add trace2 instrumentation
 builtin/fetch.c | 22 +++++++++++++++-------
 builtin/push.c  |  2 ++
 fetch-pack.c    | 13 ++++++++++++-
 transport.c     | 14 ++++++++++++--
 4 files changed, 41 insertions(+), 10 deletions(-)
Range-diff against v1:
1:  054936f40b ! 1:  fe6108b6f9 push: add trace2 instrumentation
    @@ transport.c: int transport_push(struct repository *r,
      
      		refspec_ref_prefixes(rs, &ref_prefixes);
      
    -+		trace2_region_enter("transport_push", "get_refs_list", the_repository);
    ++		trace2_region_enter("transport_push", "get_refs_list", r);
      		remote_refs = transport->vtable->get_refs_list(transport, 1,
      							       &ref_prefixes);
    -+		trace2_region_leave("transport_push", "get_refs_list", the_repository);
    ++		trace2_region_leave("transport_push", "get_refs_list", r);
      
      		argv_array_clear(&ref_prefixes);
      
    @@ transport.c: int transport_push(struct repository *r,
      			struct ref *ref = remote_refs;
      			struct oid_array commits = OID_ARRAY_INIT;
      
    -+			trace2_region_enter("transport_push", "push_submodules", the_repository);
    ++			trace2_region_enter("transport_push", "push_submodules", r);
      			for (; ref; ref = ref->next)
      				if (!is_null_oid(&ref->new_oid))
      					oid_array_append(&commits,
    @@ transport.c: int transport_push(struct repository *r,
      						      transport->push_options,
      						      pretend)) {
      				oid_array_clear(&commits);
    -+				trace2_region_leave("transport_push", "push_submodules", the_repository);
    ++				trace2_region_leave("transport_push", "push_submodules", r);
      				die(_("failed to push all needed submodules"));
      			}
      			oid_array_clear(&commits);
    -+			trace2_region_leave("transport_push", "push_submodules", the_repository);
    ++			trace2_region_leave("transport_push", "push_submodules", r);
      		}
      
      		if (((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) ||
    @@ transport.c: int transport_push(struct repository *r,
      			struct string_list needs_pushing = STRING_LIST_INIT_DUP;
      			struct oid_array commits = OID_ARRAY_INIT;
      
    -+			trace2_region_enter("transport_push", "check_submodules", the_repository);
    ++			trace2_region_enter("transport_push", "check_submodules", r);
      			for (; ref; ref = ref->next)
      				if (!is_null_oid(&ref->new_oid))
      					oid_array_append(&commits,
    @@ transport.c: int transport_push(struct repository *r,
      						     transport->remote->name,
      						     &needs_pushing)) {
      				oid_array_clear(&commits);
    -+				trace2_region_leave("transport_push", "check_submodules", the_repository);
    ++				trace2_region_leave("transport_push", "check_submodules", r);
      				die_with_unpushed_submodules(&needs_pushing);
      			}
      			string_list_clear(&needs_pushing, 0);
      			oid_array_clear(&commits);
    -+			trace2_region_leave("transport_push", "check_submodules", the_repository);
    ++			trace2_region_leave("transport_push", "check_submodules", r);
      		}
      
     -		if (!(flags & TRANSPORT_RECURSE_SUBMODULES_ONLY))
     +		if (!(flags & TRANSPORT_RECURSE_SUBMODULES_ONLY)) {
    -+			trace2_region_enter("transport_push", "push_refs", the_repository);
    ++			trace2_region_enter("transport_push", "push_refs", r);
      			push_ret = transport->vtable->push_refs(transport, remote_refs, flags);
     -		else
    -+			trace2_region_leave("transport_push", "push_refs", the_repository);
    ++			trace2_region_leave("transport_push", "push_refs", r);
     +		} else
      			push_ret = 0;
      		err = push_had_errors(remote_refs);
-- 
2.23.0.581.g78d2f28ef7-goog
Previous: Junio C HamanoNext: Josh Steadmon
Message 8 of 11 in “add trace2 regions to fetch & push”
  1. 0/2 add trace2 regions to fetch & pushJosh Steadmon, Oct 2, 2019
  2. 1/2 fetch: add trace2 instrumentationJosh Steadmon, Oct 2, 2019
  3. 2/2 push: add trace2 instrumentationJosh Steadmon, Oct 2, 2019
  4. Jonathan TanOct 7, 2019
  5. Josh SteadmonOct 7, 2019
  6. Junio C HamanoOct 8, 2019
  7. Junio C HamanoOct 8, 2019
  8. 0/2 add trace2 regions to fetch & pushJosh Steadmon, Oct 7, 2019
  9. 1/2 fetch: add trace2 instrumentationJosh Steadmon, Oct 7, 2019
  10. 2/2 push: add trace2 instrumentationJosh Steadmon, Oct 7, 2019
  11. Jonathan TanOct 7, 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.