Show More
@@ -950,7 +950,7 b' def debugdiscovery(ui, repo, remoteurl=b' | |||||
950 |
|
950 | |||
951 | remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) |
|
951 | remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) | |
952 | localrevs = opts[b'rev'] |
|
952 | localrevs = opts[b'rev'] | |
953 |
with util.timedcm( |
|
953 | with util.timedcm('debug-discovery') as t: | |
954 | common, hds = doit(localrevs, remoterevs) |
|
954 | common, hds = doit(localrevs, remoterevs) | |
955 |
|
955 | |||
956 | # compute all statistics |
|
956 | # compute all statistics |
@@ -104,7 +104,7 b' class request(object):' | |||||
104 | def run(): |
|
104 | def run(): | |
105 | b"run the command in sys.argv" |
|
105 | b"run the command in sys.argv" | |
106 | initstdio() |
|
106 | initstdio() | |
107 |
with tracing.log( |
|
107 | with tracing.log('parse args into request'): | |
108 | req = request(pycompat.sysargv[1:]) |
|
108 | req = request(pycompat.sysargv[1:]) | |
109 | err = None |
|
109 | err = None | |
110 | try: |
|
110 | try: | |
@@ -210,7 +210,7 b' def _formatargs(args):' | |||||
210 |
|
210 | |||
211 | def dispatch(req): |
|
211 | def dispatch(req): | |
212 | """run the command specified in req.args; returns an integer status code""" |
|
212 | """run the command specified in req.args; returns an integer status code""" | |
213 |
with tracing.log( |
|
213 | with tracing.log('dispatch.dispatch'): | |
214 | if req.ferr: |
|
214 | if req.ferr: | |
215 | ferr = req.ferr |
|
215 | ferr = req.ferr | |
216 | elif req.ui: |
|
216 | elif req.ui: | |
@@ -297,7 +297,7 b' def dispatch(req):' | |||||
297 |
|
297 | |||
298 |
|
298 | |||
299 | def _runcatch(req): |
|
299 | def _runcatch(req): | |
300 |
with tracing.log( |
|
300 | with tracing.log('dispatch._runcatch'): | |
301 |
|
301 | |||
302 | def catchterm(*args): |
|
302 | def catchterm(*args): | |
303 | raise error.SignalInterrupt |
|
303 | raise error.SignalInterrupt | |
@@ -1181,7 +1181,7 b' def _dispatch(req):' | |||||
1181 | def _runcommand(ui, options, cmd, cmdfunc): |
|
1181 | def _runcommand(ui, options, cmd, cmdfunc): | |
1182 | """Run a command function, possibly with profiling enabled.""" |
|
1182 | """Run a command function, possibly with profiling enabled.""" | |
1183 | try: |
|
1183 | try: | |
1184 |
with tracing.log( |
|
1184 | with tracing.log("Running %s command" % cmd): | |
1185 | return cmdfunc() |
|
1185 | return cmdfunc() | |
1186 | except error.SignatureError: |
|
1186 | except error.SignatureError: | |
1187 | raise error.CommandError(cmd, _(b'invalid arguments')) |
|
1187 | raise error.CommandError(cmd, _(b'invalid arguments')) |
@@ -207,7 +207,7 b' def load(ui, name, path, loadingtime=Non' | |||||
207 | return _extensions[shortname] |
|
207 | return _extensions[shortname] | |
208 | ui.log(b'extension', b' - loading extension: %s\n', shortname) |
|
208 | ui.log(b'extension', b' - loading extension: %s\n', shortname) | |
209 | _extensions[shortname] = None |
|
209 | _extensions[shortname] = None | |
210 |
with util.timedcm( |
|
210 | with util.timedcm('load extension %s', shortname) as stats: | |
211 | mod = _importext(name, path, bind(_reportimporterror, ui)) |
|
211 | mod = _importext(name, path, bind(_reportimporterror, ui)) | |
212 | ui.log(b'extension', b' > %s extension loaded in %s\n', shortname, stats) |
|
212 | ui.log(b'extension', b' > %s extension loaded in %s\n', shortname, stats) | |
213 | if loadingtime is not None: |
|
213 | if loadingtime is not None: | |
@@ -233,7 +233,7 b' def load(ui, name, path, loadingtime=Non' | |||||
233 | ui.log( |
|
233 | ui.log( | |
234 | b'extension', b' - invoking registered callbacks: %s\n', shortname |
|
234 | b'extension', b' - invoking registered callbacks: %s\n', shortname | |
235 | ) |
|
235 | ) | |
236 |
with util.timedcm( |
|
236 | with util.timedcm('callbacks extension %s', shortname) as stats: | |
237 | for fn in _aftercallbacks.get(shortname, []): |
|
237 | for fn in _aftercallbacks.get(shortname, []): | |
238 | fn(loaded=True) |
|
238 | fn(loaded=True) | |
239 | ui.log(b'extension', b' > callbacks completed in %s\n', stats) |
|
239 | ui.log(b'extension', b' > callbacks completed in %s\n', stats) | |
@@ -278,7 +278,7 b' def loadall(ui, whitelist=None):' | |||||
278 | b'additional ' if newindex else b'', |
|
278 | b'additional ' if newindex else b'', | |
279 | ) |
|
279 | ) | |
280 | ui.log(b'extension', b'- processing %d entries\n', len(result)) |
|
280 | ui.log(b'extension', b'- processing %d entries\n', len(result)) | |
281 |
with util.timedcm( |
|
281 | with util.timedcm('load all extensions') as stats: | |
282 | for (name, path) in result: |
|
282 | for (name, path) in result: | |
283 | if path: |
|
283 | if path: | |
284 | if path[0:1] == b'!': |
|
284 | if path[0:1] == b'!': | |
@@ -331,10 +331,10 b' def loadall(ui, whitelist=None):' | |||||
331 |
|
331 | |||
332 | broken = set() |
|
332 | broken = set() | |
333 | ui.log(b'extension', b'- executing uisetup hooks\n') |
|
333 | ui.log(b'extension', b'- executing uisetup hooks\n') | |
334 |
with util.timedcm( |
|
334 | with util.timedcm('all uisetup') as alluisetupstats: | |
335 | for name in _order[newindex:]: |
|
335 | for name in _order[newindex:]: | |
336 | ui.log(b'extension', b' - running uisetup for %s\n', name) |
|
336 | ui.log(b'extension', b' - running uisetup for %s\n', name) | |
337 |
with util.timedcm( |
|
337 | with util.timedcm('uisetup %s', name) as stats: | |
338 | if not _runuisetup(name, ui): |
|
338 | if not _runuisetup(name, ui): | |
339 | ui.log( |
|
339 | ui.log( | |
340 | b'extension', |
|
340 | b'extension', | |
@@ -347,12 +347,12 b' def loadall(ui, whitelist=None):' | |||||
347 | ui.log(b'extension', b'> all uisetup took %s\n', alluisetupstats) |
|
347 | ui.log(b'extension', b'> all uisetup took %s\n', alluisetupstats) | |
348 |
|
348 | |||
349 | ui.log(b'extension', b'- executing extsetup hooks\n') |
|
349 | ui.log(b'extension', b'- executing extsetup hooks\n') | |
350 |
with util.timedcm( |
|
350 | with util.timedcm('all extsetup') as allextetupstats: | |
351 | for name in _order[newindex:]: |
|
351 | for name in _order[newindex:]: | |
352 | if name in broken: |
|
352 | if name in broken: | |
353 | continue |
|
353 | continue | |
354 | ui.log(b'extension', b' - running extsetup for %s\n', name) |
|
354 | ui.log(b'extension', b' - running extsetup for %s\n', name) | |
355 |
with util.timedcm( |
|
355 | with util.timedcm('extsetup %s', name) as stats: | |
356 | if not _runextsetup(name, ui): |
|
356 | if not _runextsetup(name, ui): | |
357 | ui.log( |
|
357 | ui.log( | |
358 | b'extension', |
|
358 | b'extension', | |
@@ -370,7 +370,7 b' def loadall(ui, whitelist=None):' | |||||
370 |
|
370 | |||
371 | # Call aftercallbacks that were never met. |
|
371 | # Call aftercallbacks that were never met. | |
372 | ui.log(b'extension', b'- executing remaining aftercallbacks\n') |
|
372 | ui.log(b'extension', b'- executing remaining aftercallbacks\n') | |
373 |
with util.timedcm( |
|
373 | with util.timedcm('aftercallbacks') as stats: | |
374 | for shortname in _aftercallbacks: |
|
374 | for shortname in _aftercallbacks: | |
375 | if shortname in _extensions: |
|
375 | if shortname in _extensions: | |
376 | continue |
|
376 | continue | |
@@ -417,7 +417,7 b' def loadall(ui, whitelist=None):' | |||||
417 | (b'templatefunc', templatefuncs, b'loadfunction'), |
|
417 | (b'templatefunc', templatefuncs, b'loadfunction'), | |
418 | (b'templatekeyword', templatekw, b'loadkeyword'), |
|
418 | (b'templatekeyword', templatekw, b'loadkeyword'), | |
419 | ] |
|
419 | ] | |
420 |
with util.timedcm( |
|
420 | with util.timedcm('load registration objects') as stats: | |
421 | _loadextra(ui, newindex, extraloaders) |
|
421 | _loadextra(ui, newindex, extraloaders) | |
422 | ui.log( |
|
422 | ui.log( | |
423 | b'extension', |
|
423 | b'extension', |
@@ -139,7 +139,7 b' class exthelper(object):' | |||||
139 | for cont, funcname, wrapper in self._functionwrappers: |
|
139 | for cont, funcname, wrapper in self._functionwrappers: | |
140 | extensions.wrapfunction(cont, funcname, wrapper) |
|
140 | extensions.wrapfunction(cont, funcname, wrapper) | |
141 | for c in self._uicallables: |
|
141 | for c in self._uicallables: | |
142 |
with tracing.log( |
|
142 | with tracing.log('finaluisetup: %s', repr(c)): | |
143 | c(ui) |
|
143 | c(ui) | |
144 |
|
144 | |||
145 | def finaluipopulate(self, ui): |
|
145 | def finaluipopulate(self, ui): | |
@@ -180,7 +180,7 b' class exthelper(object):' | |||||
180 | entry[1].append(opt) |
|
180 | entry[1].append(opt) | |
181 |
|
181 | |||
182 | for c in self._extcallables: |
|
182 | for c in self._extcallables: | |
183 |
with tracing.log( |
|
183 | with tracing.log('finalextsetup: %s', repr(c)): | |
184 | c(ui) |
|
184 | c(ui) | |
185 |
|
185 | |||
186 | def finalreposetup(self, ui, repo): |
|
186 | def finalreposetup(self, ui, repo): | |
@@ -193,7 +193,7 b' class exthelper(object):' | |||||
193 | - Changes to repo.__class__, repo.dirstate.__class__ |
|
193 | - Changes to repo.__class__, repo.dirstate.__class__ | |
194 | """ |
|
194 | """ | |
195 | for c in self._repocallables: |
|
195 | for c in self._repocallables: | |
196 |
with tracing.log( |
|
196 | with tracing.log('finalreposetup: %s', repr(c)): | |
197 | c(ui, repo) |
|
197 | c(ui, repo) | |
198 |
|
198 | |||
199 | def uisetup(self, call): |
|
199 | def uisetup(self, call): |
@@ -185,12 +185,12 b' def _peerorrepo(' | |||||
185 | for f in presetupfuncs or []: |
|
185 | for f in presetupfuncs or []: | |
186 | f(ui, obj) |
|
186 | f(ui, obj) | |
187 | ui.log(b'extension', b'- executing reposetup hooks\n') |
|
187 | ui.log(b'extension', b'- executing reposetup hooks\n') | |
188 |
with util.timedcm( |
|
188 | with util.timedcm('all reposetup') as allreposetupstats: | |
189 | for name, module in extensions.extensions(ui): |
|
189 | for name, module in extensions.extensions(ui): | |
190 | ui.log(b'extension', b' - running reposetup for %s\n', name) |
|
190 | ui.log(b'extension', b' - running reposetup for %s\n', name) | |
191 | hook = getattr(module, 'reposetup', None) |
|
191 | hook = getattr(module, 'reposetup', None) | |
192 | if hook: |
|
192 | if hook: | |
193 |
with util.timedcm( |
|
193 | with util.timedcm('reposetup %r', name) as stats: | |
194 | hook(ui, obj) |
|
194 | hook(ui, obj) | |
195 | ui.log( |
|
195 | ui.log( | |
196 | b'extension', b' > reposetup for %s took %s\n', name, stats |
|
196 | b'extension', b' > reposetup for %s took %s\n', name, stats |
General Comments 0
You need to be logged in to leave comments.
Login now