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