##// END OF EJS Templates
profile: expand PID in output file name
Bryan O'Sullivan -
r5997:637d4c08 default
parent child Browse files
Show More
@@ -412,7 +412,10 b' profile::'
412 "hotshot" is deprecated, and produces less reliable results.
412 "hotshot" is deprecated, and produces less reliable results.
413 Default is no profiling.
413 Default is no profiling.
414 output;;
414 output;;
415 The name of a file to write profiling data to. Default is stderr.
415 The name of a file to write profiling data to. Each occurrence of
416 "%%p" will be replaced with the current process ID (the repeated
417 "%" protects against the config parser's string interpolator).
418 Default output is to stderr.
416
419
417 server::
420 server::
418 Controls generic server settings.
421 Controls generic server settings.
@@ -379,7 +379,8 b' def profiled(ui, func, options={}):'
379 def profile_fp():
379 def profile_fp():
380 outfile = ui.config('profile', 'output', untrusted=True)
380 outfile = ui.config('profile', 'output', untrusted=True)
381 if outfile:
381 if outfile:
382 return open(outfile, 'w')
382 pid = str(os.getpid())
383 return open(outfile.replace('%p', pid), 'w')
383 else:
384 else:
384 return sys.stderr
385 return sys.stderr
385
386
General Comments 0
You need to be logged in to leave comments. Login now