mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
profiling: Adding a profiling.format config variable
Allows defining other output formats for profiling. If an invalid format is given, output a warning and ignore it. For now, only the standard 'text' value is supported.
This commit is contained in:
parent
14ff1a53ae
commit
f2cfd93c8c
@ -545,6 +545,13 @@ profiling::
|
||||
collected during profiling, while 'profiling report' stands for a
|
||||
statistical text report generated from the profiling data.
|
||||
The profiling is done using lsprof.
|
||||
format;;
|
||||
Profiling format.
|
||||
Default: text.
|
||||
text;;
|
||||
Generate a profiling report.
|
||||
When saving to a file, it should be noted that only the report is saved,
|
||||
and the profiling data is not kept.
|
||||
output;;
|
||||
File path where profiling data or report should be saved.
|
||||
If the file exists, it is replaced.
|
||||
|
@ -379,6 +379,13 @@ def _runcommand(ui, options, cmd, cmdfunc):
|
||||
raise error.ParseError(cmd, _("invalid arguments"))
|
||||
|
||||
if options['profile']:
|
||||
format = ui.config('profiling', 'format', default='text')
|
||||
|
||||
if not format in ['text']:
|
||||
ui.warn(_("unrecognized profiling format '%s'"
|
||||
" - Ignored\n") % format)
|
||||
format = 'text'
|
||||
|
||||
output = ui.config('profiling', 'output')
|
||||
|
||||
if output:
|
||||
|
@ -15,4 +15,7 @@ if "$TESTDIR/hghave" -q lsprof; then
|
||||
|| echo --profile + output to file failed
|
||||
grep CallCount < ../out > /dev/null \
|
||||
|| echo wrong --profile output when saving to a file
|
||||
|
||||
hg --profile --config profiling.format=text st 2>&1 \
|
||||
| grep CallCount > /dev/null || echo --profile format=text failed
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user