mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
profile: expand PID in output file name
This commit is contained in:
parent
f2207bd308
commit
b945cf7339
@ -412,7 +412,10 @@ profile::
|
||||
"hotshot" is deprecated, and produces less reliable results.
|
||||
Default is no profiling.
|
||||
output;;
|
||||
The name of a file to write profiling data to. Default is stderr.
|
||||
The name of a file to write profiling data to. Each occurrence of
|
||||
"%%p" will be replaced with the current process ID (the repeated
|
||||
"%" protects against the config parser's string interpolator).
|
||||
Default output is to stderr.
|
||||
|
||||
server::
|
||||
Controls generic server settings.
|
||||
|
@ -379,7 +379,8 @@ def profiled(ui, func, options={}):
|
||||
def profile_fp():
|
||||
outfile = ui.config('profile', 'output', untrusted=True)
|
||||
if outfile:
|
||||
return open(outfile, 'w')
|
||||
pid = str(os.getpid())
|
||||
return open(outfile.replace('%p', pid), 'w')
|
||||
else:
|
||||
return sys.stderr
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user