Ë
    1²jÇ  ã                   óŠ   — d dl Z d dlZd dlZd dlZd dlZddlmZmZmZ ddl	m	Z	 d„ Z
d„ Zd„ Zd„ Zd	„ Zd
„ Zedk(  r e«        yy)é    Né   )ÚstartÚfinalizeÚ_select_backend)Úflagsc            	      ó  — t        j                  ddt         j                  ¬«      } | j                  ddt        d¬«       | j                  dd	t        d
d g d¢¬«       | j                  ddt        ddddg¬«       | j                  ddt        dd ¬«       | j                  ddt        ddddg¬«       | j                  ddt        dd d dg¬«       | j                  dt         j
                  d ¬!«       | j                  «       }||j                  fS )"NzBThe proton command utility for profiling scripts and pytest tests.zÒ
    proton [options] script.py [script_args] [script_options]
    proton [options] pytest [pytest_args] [script_options]
    python -m triton.profiler.proton [options] script.py [script_args] [script_options]
)ÚdescriptionÚusageÚformatter_classz-nz--namezName of the profiling session)ÚtypeÚhelpz-bz	--backendzProfiling backend)ÚcuptiÚ	roctracerÚinstrumentation)r   r   ÚdefaultÚchoicesz-cz	--contextzProfiling contextÚshadowÚpythonz-mz--modezProfiling mode)r   r   r   z-dz--datazProfiling dataÚtreeÚtracez-kz--hookzProfiling hookÚtritonÚtarget_argszSubcommand and its arguments)Únargsr   )ÚargparseÚArgumentParserÚRawTextHelpFormatterÚadd_argumentÚstrÚ	REMAINDERÚ
parse_argsr   )ÚparserÚargss     úU/var/www/html/ia-enhanced/venv/lib/python3.12/site-packages/triton/profiler/proton.pyÚparse_argumentsr$   
   s(  € Ü×$Ñ$ØXð aô ×2Ñ2ô4€Fð ×Ñ˜˜h¬SÐ7VÐÔWØ
×Ñ˜˜k´Ð:MÐW[Ú Ið ô Kà
×Ñ˜˜k´Ð:MÐW_Ø!)¨8Ð 4ð ô 6à
×Ñ˜˜h¬SÐ7GÐQUÐÔVØ
×Ñ˜˜h¬SÐ7GÐQWÐbhÐjqÐarÐÔsØ
×Ñ˜˜h¬SÐ7GÐQUÐ`dÐfnÐ_oÐÔpØ
×Ñ˜¬X×-?Ñ-?ÐFdÐÔeØ×ÑÓ€DØ�×!Ñ!Ð!Ð!ó    c                 óF   — t         j                  j                  | «      dk(  S )NÚpytest)ÚosÚpathÚbasename)Úscripts    r#   Ú	is_pytestr,      s   € Ü�7‰7×Ñ˜FÓ# xÑ/Ð/r%   c                 ó\  — t         j                  j                  | «      }t        j                  }| g|z   t        _        t        j                  j                  t         j                  j                  |«      «       	 t        j                  | d¬«       	 |t        _        y# t        $ r5}t        d«       t        j                  |«       Y d }~|t        _        yd }~wt        $ r!}|j                  cY d }~|t        _        S d }~wt        $ r Y |t        _        yw xY w# |t        _        w xY w)NÚ__main__)Úrun_namez-An error occurred while executing the script:r   r   )r(   r)   ÚabspathÚsysÚargvÚappendÚdirnameÚrunpyÚrun_pathÚ	ExceptionÚprintÚ	tracebackÚprint_exceptionÚ
SystemExitÚcodeÚKeyboardInterrupt)r+   r"   Úscript_pathÚoriginal_argvÚes        r#   Úexecute_as_mainrA   "   sÖ   € Ü—'‘'—/‘/ &Ó)€Kä—H‘H€MØˆx˜$‰„C„Hä‡H�H‡O�O”B—G‘G—O‘O KÓ0Ô1ð!Ü�‰�v¨
Ö3ð !ŒŒØøô ò ÜÐ=Ô>Ü×!Ñ! !Ô$Ûð !Œ�ûô ò Ø�v‰vŒð !Œ�ûô ò Øà Œ�ðûð !Œ�úsN   Á<B  Â 	DÂ) CÃ	D ÃDÃ%DÃ0DÃ1D ÄDÄD ÄDÄD ÄD+c                 ó¤   — dt         _        | d   }t        | «      dkD  r| dd  ng }t        |«      rdd l}|j                  |«      S t        ||«      S )NTr   r   )r   Úcommand_lineÚlenr,   r'   ÚmainrA   )r   r+   Úscript_argsr'   s       r#   Údo_setup_and_executerG   :   sS   € à„EÔà˜‰^€FÜ%(¨Ó%5¸Ò%9�+˜a˜b‘/¸r€KÜ�ÔÛØ�{‰{˜;Ó'Ð'ä˜v {Ó3Ð3r%   c                 ó  — | j                   r| j                   n	t        «       }t        | j                  | j                  | j
                  || j                  ¬«       t        |«      }t        «        t        j                  |«       y )N)ÚcontextÚdataÚbackendÚhook)rK   r   r   ÚnamerI   rJ   rL   rG   r   r1   Úexit)r"   r   rK   Úexitcodes       r#   Úrun_profilingrP   G   sT   € Ø"Ÿlšlˆd�lŠl´Ó0A€Gä	ˆ$�)‰)˜TŸ\™\°·	±	À7ÐQU×QZÑQZÕ[ä# KÓ0€Hä„JÜ‡H�HˆXÕr%   c                  ó6   — t        «       \  } }t        | |«       y )N)r$   rP   )r"   r   s     r#   rE   rE   R   s   € Ü'Ó)Ñ€Dˆ+Ü�$˜Õ$r%   r.   )r   r1   r(   r5   r9   Úprofiler   r   r   r   r$   r,   rA   rG   rP   rE   Ú__name__© r%   r#   ú<module>rU      sO   ðÛ Û 
Û 	Û Û ß 5Ñ 5Ý ò"ò(0òò0
4òò%ð
 ˆzÒÙ…Fð r%   