Blame SOURCES/00225-cprofile-sort-option.patch
|
|
f63228 |
diff -up Python-2.7.5/Lib/cProfile.py.sort Python-2.7.5/Lib/cProfile.py
|
|
|
f63228 |
--- Python-2.7.5/Lib/cProfile.py.sort 2015-02-09 12:45:46.525657065 +0100
|
|
|
f63228 |
+++ Python-2.7.5/Lib/cProfile.py 2015-02-09 12:45:05.266316315 +0100
|
|
|
f63228 |
@@ -161,7 +161,7 @@ def label(code):
|
|
|
f63228 |
# ____________________________________________________________
|
|
|
f63228 |
|
|
|
f63228 |
def main():
|
|
|
f63228 |
- import os, sys
|
|
|
f63228 |
+ import os, pstats, sys
|
|
|
f63228 |
from optparse import OptionParser
|
|
|
f63228 |
usage = "cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
|
|
|
f63228 |
parser = OptionParser(usage=usage)
|
|
|
f63228 |
@@ -169,8 +169,9 @@ def main():
|
|
|
f63228 |
parser.add_option('-o', '--outfile', dest="outfile",
|
|
|
f63228 |
help="Save stats to <outfile>", default=None)
|
|
|
f63228 |
parser.add_option('-s', '--sort', dest="sort",
|
|
|
f63228 |
- help="Sort order when printing to stdout, based on pstats.Stats class",
|
|
|
f63228 |
- default=-1)
|
|
|
f63228 |
+ help="Sort order when printing to stdout, based on pstats.Stats class",
|
|
|
f63228 |
+ default=-1,
|
|
|
f63228 |
+ choices=pstats.Stats.sort_arg_dict_default.keys())
|
|
|
f63228 |
|
|
|
f63228 |
if not sys.argv[1:]:
|
|
|
f63228 |
parser.print_usage()
|
|
|
f63228 |
|