Commit 1e4dbf3f authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Add more git tracing.

This CL adds more perf tracing to `git fetch` from bot_update.py and
git_cache.py

Change-Id: I9b69c60b6c81fc0c5f23f82fcc889b4d45a27556
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1888433Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@google.com>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
parent ca4196d0
......@@ -552,14 +552,6 @@ class Mirror(object):
spec = spec.decode()
try:
self.print('Fetching %s' % spec)
env = os.environ.copy()
env.update({
'GIT_TRACE_PACKET': '1',
'GIT_TR2_EVENT': '1',
'GIT_TRACE2_EVENT': '1',
'GIT_TRACE_CURL': '1',
'GIT_TRACE_CURL_NO_DATA': '1'
})
# Only print first 30000 packets. We can use nonlocal keyword once we
# switch to python 3.
packet_count = [0]
......@@ -578,7 +570,6 @@ class Mirror(object):
fetch_cmd + [spec],
cwd=rundir,
retry=True,
env=env,
filter_fn=FilterPacket)
except subprocess.CalledProcessError:
if spec == '+refs/heads/*:refs/heads/*':
......
......@@ -666,6 +666,11 @@ def _git_checkout(sln, sln_dir, revisions, refs, git_cache_dir, cleanup_dir):
env = {
'GIT_TRACE': 'true',
'GIT_TRACE_PERFORMANCE': 'true',
'GIT_TRACE_PACKET': '1',
'GIT_TRACE2_EVENT': '1',
'GIT_TRACE_CURL': '1',
'GIT_TRACE_CURL_NO_DATA': '1',
'INFRA_GIT_WRAPPER_TRACE': '1',
}
# Step 1: populate/refresh cache, if necessary.
......@@ -723,11 +728,11 @@ def _git_checkout(sln, sln_dir, revisions, refs, git_cache_dir, cleanup_dir):
else:
_git_disable_gc(sln_dir)
git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir)
git('fetch', 'origin', cwd=sln_dir)
git('fetch', 'origin', cwd=sln_dir, env=env)
git('remote', 'set-url', '--push', 'origin', url, cwd=sln_dir)
for ref in refs:
refspec = '%s:%s' % (ref, ref.lstrip('+'))
git('fetch', 'origin', refspec, cwd=sln_dir)
git('fetch', 'origin', refspec, cwd=sln_dir, env=env)
# Windows sometimes has trouble deleting files.
# This can make git commands that rely on locks fail.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment