+
    Bi (                         ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RIH	t	H
t
 ^ RIHt  ! R R]4      t ! R R]P                  4      tR	 t/ tR
]R&   R]R&   R]R&   ]R8X  d
   ]! 4        R# R# )    N)ProfileTestregenerate_expected_output)assert_python_failureassert_python_ok)supportc                   v   a  ] tR t^t o ]P
                  t]tRtR t	R t
R tR tR tR tR tR	 tR
 tRtV tR# )CProfileTestz{built-in method builtins.max}c                    \         # N)_ProfileOutput)selfs   &)/usr/lib/python3.14/test/test_cprofile.pyget_expected_output CProfileTest.get_expected_output   s        c                Z   ^ RI p\        P                  ! 4       ;_uu_ 4       pVP                  R 4      pVP	                  4        VP                  4        VP                  4        V P                  VP                  P                  \        4       RRR4       R#   + '       g   i     R# ; i)r   Nc                      \         # r   )int r   r   <lambda>>CProfileTest.test_bad_counter_during_dealloc.<locals>.<lambda>   s    3r   )_lsprofr   catch_unraisable_exceptionProfilerenabledisableclearassertEqual
unraisableexc_type	TypeError)r   r   cmobjs   &   r   test_bad_counter_during_dealloc,CProfileTest.test_bad_counter_during_dealloc   sj    //11R"";/CJJLKKMIIKR]]33Y? 2111s   A-BB*	c                |   ^ RI pVP                  4       \        P                  ! 4       3 Fg  pR F^  pV P	                  W#R7      ;_uu_ 4        \        W#4      pV P                  \        4      ;_uu_ 4        V! 4        RRR4       RRR4       K`  	  Ki  	  R#   + '       g   i     L"; i  + '       g   i     K  ; i)r   N)profilemethod)_pystart_callback_pyreturn_callback_ccall_callback_creturn_callback)r   r   cProfileProfilesubTestgetattrassertRaisesr!   )r   r   r'   r(   
method_objs   &    r   test_crash_with_not_enough_args,CProfileTest.test_crash_with_not_enough_args#   s    ((*H,<,<,>?G \\'\AA!(!9J**955" 6 BA @ 65 BAAs$   )B*	5B=B*	B'"B*	*B;c                  a ^ RI p ! V3R lR4      p\        P                  ! 4       ;_uu_ 4       pVP                  V! ^4      4      oSP	                  4        R ! 4        SP                  4        SP                  4        V P                  VP                  P                  \        4       RRR4       \        P                  ! 4       ;_uu_ 4       pVP                  V! ^4      4      oSP	                  4        R ! 4        SP                  4        SP                  4        V P                  VP                  P                  \        4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   Nc                   4   <a  ] tR t^7t o R tV3R ltRtV tR# )8CProfileTest.test_evil_external_timer.<locals>.EvilTimerc                     ^ V n         Wn        R# )r   Ncountdisable_count)r   r;   s   &&r   __init__ACProfileTest.test_evil_external_timer.<locals>.EvilTimer.__init__8   s    
%2"r   c                   < V ;P                   ^,          un         V P                   V P                  8X  d   SP                  4        V P                   # )   )r:   r;   r   )r   profiler_with_evil_timers   &r   __call__ACProfileTest.test_evil_external_timer.<locals>.EvilTimer.__call__<   s8    

a
::!3!33,446zz!r   r9   N)__name__
__module____qualname____firstlineno__r<   rA   __static_attributes____classdictcell__)__classdict__r@   s   @r   	EvilTimerr7   7   s     3" "r   rJ   c                      R # r   r   r   r   r   r   7CProfileTest.test_evil_external_timer.<locals>.<lambda>H       Tr   c                      R # r   r   r   r   r   r   rL   S   rM   r   )r   r   r   r   r   r   r   r   r   r    RuntimeError)r   r   rJ   r"   r@   s   &   @r   test_evil_external_timer%CProfileTest.test_evil_external_timer3   s    			" 		" //11R'.'7'7	!'E$$++-$,,.$**,R]]33\B 2 //11R'.'7'7	!'E$$++-$,,.$**,R]]33\B 21 21 211s   A:EA:E&E#	&E7	c                   V P                  4       pV P                  VP                  4       VP                  4        V P	                  \
        P                  P                  \
        P                  P                  4      R 4       VP                  4        V P                  \
        P                  P                  \
        P                  P                  4      R4       R# r-   N)
profilerclass
addCleanupr   r   r   sys
monitoringget_toolPROFILER_IDassertIsr   profs   & r   test_profile_enable_disable(CProfileTest.test_profile_enable_disableX   s    !!#%NN##CNN$>$>?	M 	cnn--cnn.H.HI4Pr   c                   V P                  4       pV P                  VP                  4       V;_uu_ 4       pV P                  W4       V P	                  \
        P                  P                  \
        P                  P                  4      R 4       RRR4       V P                  \
        P                  P                  \
        P                  P                  4      R4       R#   + '       g   i     LY; irS   )	rT   rU   r   rZ   r   rV   rW   rX   rY   )r   r\   "_CProfileTest__enter__return_values   &  r   test_profile_as_context_manager,CProfileTest.test_profile_as_context_managerd   s    !!#%T*MM$6 ''(B(BCZQ  	cnn--cnn.H.HI4P Ts   AC  C0	c                    V P                  4       pV P                  4       pVP                  4        V P                  \        VP                  4       VP	                  4        R # r   )rT   r   r1   
ValueErrorr   )r   prpr2s   &  r   test_second_profiler!CProfileTest.test_second_profileru   sD    !  "
		*cjj1


r   c                   R  pV P                  4       pVP                  4        V! 4       p VP                  \        4       VP	                  4        VP                  4        T P                  \        ;QJ d4    R VP                  P                  4        4       F  '       g   K   RM)	  RM%! R VP                  P                  4        4       4      4      3 R#   \         d     Li ; i)c               3      "   R x  R # 5ir   r   r   r   r   gen$CProfileTest.test_throw.<locals>.gen   s     s   	c              3   :   "   T F  pR V^,          9   x  K  	  R# 5i)throwNr   ).0funcs   & r   	<genexpr>*CProfileTest.test_throw.<locals>.<genexpr>   s     K?4GtAw.?s   TFN)
rT   r   rn   SyntaxErrorr   create_stats
assertTrueanystatskeys)r   rk   re   gs   &   r   
test_throwCProfileTest.test_throw|   s    	 !
		E	GGK  	


K288==?KK288==?KKLM  		s   C C%$C%c           	        V P                  4       ;_uu_ 4       pV P                  \        4      ;_uu_ 4        \        P	                  \        4       4       R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; ir   )rT   r1   r!   bytesfindstrr[   s   & r   test_bad_descriptor CProfileTest.test_bad_descriptor   sT     !!T""9--

35! . "!-- "!!s"   A:A'	A:'A72A::B	r   N)rC   rD   rE   rF   r-   r.   rT   profilermoduleexpected_max_outputr   r$   r3   rP   r]   ra   rg   rz   r   rG   rH   rI   s   @r   r	   r	      sS     $$MN:
@% #CJ
QQ"N*" "r   r	   c                   ,   a  ] tR t^t o R tR tRtV tR# )TestCommandLinec                p    \        R RRR4      w  rpV P                  V^ 4       V P                  RV4       R# )-mr-   z-sdemos!   option -s: invalid choice: 'demo'N)r   assertGreaterassertIn)r   rcouterrs   &   r   	test_sortTestCommandLine.test_sort   s5    ,T:tVL2q!:C@r   c                   \         P                  ! R RR7      ;_uu_ 4       pVP                  \        P                  ! R4      4       VP                  4        \        RRVP                  4       RRR4       R#   + '       g   i     R# ; i)zw+F)delete_on_closez                class Foo:
                    pass
                import __main__
                assert Foo == __main__.Foo
                r   r-   N)tempfileNamedTemporaryFilewritetextwrapdedentcloser   name)r   fs   & r   "test_profile_script_importing_main2TestCommandLine.test_profile_script_importing_main   s`     ((uEEGGHOO %   GGIT:qvv6 FEEEs   AA88B		r   N)rC   rD   rE   rF   r   r   rG   rH   r   s   @r   r   r      s     A
7 7r   r   c                      R \         P                  9  d   \        P                  ! 4        R# \	        \
        \        4       R# )z-rN)rV   argvunittestmainr   __file__r	   r   r   r   r   r      s!    388"8\:r   a         28    0.028    0.001    0.028    0.001 profilee.py:110(__getattr__)
        1    0.270    0.270    1.000    1.000 profilee.py:25(testfunc)
     23/3    0.150    0.007    0.170    0.057 profilee.py:35(factorial)
       20    0.020    0.001    0.020    0.001 profilee.py:48(mul)
        2    0.040    0.020    0.600    0.300 profilee.py:55(helper)
        4    0.116    0.029    0.120    0.030 profilee.py:73(helper1)
        2    0.000    0.000    0.140    0.070 profilee.py:84(helper2_indirect)
        8    0.312    0.039    0.400    0.050 profilee.py:88(helper2)
        8    0.064    0.008    0.080    0.010 profilee.py:98(subhelper)print_statsa  profilee.py:110(__getattr__)                      <-      16    0.016    0.016  profilee.py:98(subhelper)
profilee.py:25(testfunc)                          <-       1    0.270    1.000  <string>:1(<module>)
profilee.py:35(factorial)                         <-       1    0.014    0.130  profilee.py:25(testfunc)
                                                        20/3    0.130    0.147  profilee.py:35(factorial)
                                                           2    0.006    0.040  profilee.py:84(helper2_indirect)
profilee.py:48(mul)                               <-      20    0.020    0.020  profilee.py:35(factorial)
profilee.py:55(helper)                            <-       2    0.040    0.600  profilee.py:25(testfunc)
profilee.py:73(helper1)                           <-       4    0.116    0.120  profilee.py:55(helper)
profilee.py:84(helper2_indirect)                  <-       2    0.000    0.140  profilee.py:55(helper)
profilee.py:88(helper2)                           <-       6    0.234    0.300  profilee.py:55(helper)
                                                           2    0.078    0.100  profilee.py:84(helper2_indirect)
profilee.py:98(subhelper)                         <-       8    0.064    0.080  profilee.py:88(helper2)
{built-in method builtins.hasattr}                <-       4    0.000    0.004  profilee.py:73(helper1)
                                                           8    0.000    0.008  profilee.py:88(helper2)
{built-in method sys.exception}                   <-       4    0.000    0.000  profilee.py:73(helper1)
{method 'append' of 'list' objects}               <-       4    0.000    0.000  profilee.py:73(helper1)print_callersa;  <string>:1(<module>)                              ->       1    0.270    1.000  profilee.py:25(testfunc)
profilee.py:110(__getattr__)                      ->
profilee.py:25(testfunc)                          ->       1    0.014    0.130  profilee.py:35(factorial)
                                                           2    0.040    0.600  profilee.py:55(helper)
profilee.py:35(factorial)                         ->    20/3    0.130    0.147  profilee.py:35(factorial)
                                                          20    0.020    0.020  profilee.py:48(mul)
profilee.py:48(mul)                               ->
profilee.py:55(helper)                            ->       4    0.116    0.120  profilee.py:73(helper1)
                                                           2    0.000    0.140  profilee.py:84(helper2_indirect)
                                                           6    0.234    0.300  profilee.py:88(helper2)
profilee.py:73(helper1)                           ->       4    0.000    0.004  {built-in method builtins.hasattr}
profilee.py:84(helper2_indirect)                  ->       2    0.006    0.040  profilee.py:35(factorial)
                                                           2    0.078    0.100  profilee.py:88(helper2)
profilee.py:88(helper2)                           ->       8    0.064    0.080  profilee.py:98(subhelper)
profilee.py:98(subhelper)                         ->      16    0.016    0.016  profilee.py:110(__getattr__)
{built-in method builtins.hasattr}                ->      12    0.012    0.012  profilee.py:110(__getattr__)print_callees__main__)rV   r   r-   r   r   test.test_profiler   r   test.support.script_helperr   r   testr   r	   TestCaser   r   r   rC   r   r   r   <module>r      s         E N H"; H"V7h'' 7(; 	!K} #k "#p $ zF r   