tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Q\¬Qc@sádZddlZddlZddlZddlmZddlmZddlZddlm    Z    m
Z
dej fd„ƒYZ d„Z d    „Zd
„Zd e jd <d e jd<de jd<edkrÝeƒndS(s"Test suite for the profile module.iÿÿÿÿN(tStringIO(t run_unittest(ttestfuncttimert ProfileTestcBsMeZejZdddgZiZdZed„ƒZ    d„Z
d„Z RS(t print_statst print_callerst print_calleess:0(sort)cCsºg}|jtdƒ}tƒ}|jdtƒtƒƒ|jtƒ|ƒxe|jD]Z}tƒ}tj    |d|ƒ}|j
ƒj dƒt ||ƒƒ|j|j ƒƒqXW|S(Ngü©ñÒMbP?s
testfunc()tstreamtstdname(t profilerclassRtrunctxtglobalstlocalstappendt methodnamesRtpstatstStatst
strip_dirst
sort_statstgetattrtgetvalue(tclstresultstproft start_timert
methodnametststats((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pyt do_profilings        cCsv|jƒ}|j|ddƒxOt|jƒD]>\}}|j||d|j|d||jjfƒq0WdS(Niièis/Stats.%s output for %s doesn't fit expectation!(Rt assertEqualt    enumerateRtexpected_outputR
t__name__(tselfRtitmethod((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pyt test_cprofile#s  cCs¨ddddg}x|D]‡}tƒ}|jtdƒ}|j|tƒtƒƒtj|d|ƒ}|jƒ|j    ƒ}|j
|j |dj ||ƒƒqWdS(Ns    [].sort()s[].sort(reverse=True)s[].sort(*(None, None, True))s[].sort(**dict(reverse=True))gü©ñÒMbP?Rs,Profiling {0!r} didn't report list.sort:
{1}( RR
RR R R RRRRtassertIntexpected_list_sort_outputtformat(R"tstmtststmtRRRtres((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pyttest_calling_conventions+s         
 ( R!t
__module__tprofiletProfileR
RR R't classmethodRR%R,(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pyR s        c Csï|jdƒ}d|GH|jƒ}g}t|dƒ9}x/|D]'}|j|ƒ|d dkrCPqCqCWWdQXt|dƒf}|j|ƒxBt|jƒD]1\}}|jd|j|||dfƒq£W|jd    ƒWdQXdS(
NtcosRegenerating %s...tris#--cuttws$%s.expected_output[%r] = """\
%s"""
is'
if __name__ == "__main__":
    main()
(    trstripRtopenRt
writelinesRRtwriteR!(tfilenameRRtnewfiletftlineR#R$((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pytregenerate_expected_output?s             cCsttƒdS(N(RR(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pyt    test_mainSscCs*dtjkrtƒn tttƒdS(Ns-r(tsystargvR=R<t__file__R(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pytmainVs
s         127 function calls (107 primitive calls) in 999.749 seconds
 
   Ordered by: standard name
 
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        4   -0.004   -0.001   -0.004   -0.001 :0(append)
        4   -0.004   -0.001   -0.004   -0.001 :0(exc_info)
       12   -0.024   -0.002   11.964    0.997 :0(hasattr)
        8   -0.008   -0.001   -0.008   -0.001 :0(range)
        1    0.000    0.000    0.000    0.000 :0(setprofile)
        1   -0.002   -0.002  999.751  999.751 <string>:1(<module>)
        0    0.000             0.000          profile:0(profiler)
        1   -0.002   -0.002  999.749  999.749 profile:0(testfunc())
       28   27.972    0.999   27.972    0.999 profilee.py:110(__getattr__)
        1  269.996  269.996  999.753  999.753 profilee.py:25(testfunc)
     23/3  149.937    6.519  169.917   56.639 profilee.py:35(factorial)
       20   19.980    0.999   19.980    0.999 profilee.py:48(mul)
        2   39.986   19.993  599.814  299.907 profilee.py:55(helper)
        4  115.984   28.996  119.964   29.991 profilee.py:73(helper1)
        2   -0.006   -0.003  139.942   69.971 profilee.py:84(helper2_indirect)
        8  311.976   38.997  399.896   49.987 profilee.py:88(helper2)
        8   63.968    7.996   79.944    9.993 profilee.py:98(subhelper)
 
 
Rs{   Ordered by: standard name
 
Function                          was called by...
:0(append)                        <- profilee.py:73(helper1)(4)  119.964
:0(exc_info)                      <- profilee.py:73(helper1)(4)  119.964
:0(hasattr)                       <- profilee.py:73(helper1)(4)  119.964
                                     profilee.py:88(helper2)(8)  399.896
:0(range)                         <- profilee.py:98(subhelper)(8)   79.944
:0(setprofile)                    <- profile:0(testfunc())(1)  999.749
<string>:1(<module>)              <- profile:0(testfunc())(1)  999.749
profile:0(profiler)               <-
profile:0(testfunc())             <- profile:0(profiler)(1)    0.000
profilee.py:110(__getattr__)      <- :0(hasattr)(12)   11.964
                                     profilee.py:98(subhelper)(16)   79.944
profilee.py:25(testfunc)          <- <string>:1(<module>)(1)  999.751
profilee.py:35(factorial)         <- profilee.py:25(testfunc)(1)  999.753
                                     profilee.py:35(factorial)(20)  169.917
                                     profilee.py:84(helper2_indirect)(2)  139.942
profilee.py:48(mul)               <- profilee.py:35(factorial)(20)  169.917
profilee.py:55(helper)            <- profilee.py:25(testfunc)(2)  999.753
profilee.py:73(helper1)           <- profilee.py:55(helper)(4)  599.814
profilee.py:84(helper2_indirect)  <- profilee.py:55(helper)(2)  599.814
profilee.py:88(helper2)           <- profilee.py:55(helper)(6)  599.814
                                     profilee.py:84(helper2_indirect)(2)  139.942
profilee.py:98(subhelper)         <- profilee.py:88(helper2)(8)  399.896
 
 
Rsö   Ordered by: standard name
 
Function                          called...
:0(append)                        ->
:0(exc_info)                      ->
:0(hasattr)                       -> profilee.py:110(__getattr__)(12)   27.972
:0(range)                         ->
:0(setprofile)                    ->
<string>:1(<module>)              -> profilee.py:25(testfunc)(1)  999.753
profile:0(profiler)               -> profile:0(testfunc())(1)  999.749
profile:0(testfunc())             -> :0(setprofile)(1)    0.000
                                     <string>:1(<module>)(1)  999.751
profilee.py:110(__getattr__)      ->
profilee.py:25(testfunc)          -> profilee.py:35(factorial)(1)  169.917
                                     profilee.py:55(helper)(2)  599.814
profilee.py:35(factorial)         -> profilee.py:35(factorial)(20)  169.917
                                     profilee.py:48(mul)(20)   19.980
profilee.py:48(mul)               ->
profilee.py:55(helper)            -> profilee.py:73(helper1)(4)  119.964
                                     profilee.py:84(helper2_indirect)(2)  139.942
                                     profilee.py:88(helper2)(6)  399.896
profilee.py:73(helper1)           -> :0(append)(4)   -0.004
                                     :0(exc_info)(4)   -0.004
                                     :0(hasattr)(4)   11.964
profilee.py:84(helper2_indirect)  -> profilee.py:35(factorial)(2)  169.917
                                     profilee.py:88(helper2)(2)  399.896
profilee.py:88(helper2)           -> :0(hasattr)(8)   11.964
                                     profilee.py:98(subhelper)(8)   79.944
profilee.py:98(subhelper)         -> :0(range)(8)   -0.008
                                     profilee.py:110(__getattr__)(16)   27.972
 
 
Rt__main__(t__doc__R>RtunittestRttest.test_supportRR.t test.profileeRRtTestCaseRR<R=RAR R!(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_profile.pyt<module>s     2            "  "