Ë
    Ûéñi  ã                   ó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     úX/var/www/pod-logistic/pod-ai/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                 ór  — t         j                  j                  | «      }ddd|dt        t        j
                  t        i}t        j                  }| g|z   t        _        t        j                  j                  t         j                  j                  |«      «       	 t        |d«      5 }t        |j                  «       |d«      }d d d «       t        |«       |t        _        y # 1 sw Y   Œ!xY w# t        $ r-}t        d|› �«       t	        j                  d«       Y d }~ŒId }~ww xY w# |t        _        w xY w)	NÚ__name__Ú__main__Ú__file__Ú__builtins__ÚrbÚexecz.An error occurred while executing the script: r   )r(   r)   Úabspathr1   Úsysr.   ÚargvÚappendÚdirnameÚopenÚcompileÚreadr3   Ú	ExceptionÚprintÚexit)r+   r"   Úscript_pathÚclean_globalsÚoriginal_argvÚfileÚcodeÚes           r#   Úexecute_as_mainrE       sï   € Ü—'‘'—/‘/ &Ó)€Kð 	�JØ�KØœÜ�‰”cð	€Mô —H‘H€MØˆx˜$‰„C„Hä‡H�H‡O�O”B—G‘G—O‘O KÓ0Ô1ð!Ü�+˜tÓ$ð 	=¨Ü˜4Ÿ9™9›;¨°VÓ<ˆD÷	=äˆT�=Ô!ð
 !Œ�÷	=ð 	=ûô ò ÜÐ>¸q¸cÐBÔCÜ�‰��‰ûðûð !Œ�úsB   ÂC0 Â(C$ÃC0 Ã$C-Ã)C0 Ã0	D&Ã9#D!ÄD) Ä!D&Ä&D) Ä)D6c                 ó¨   — dt         _        | d   }t        | «      dkD  r| dd  ng }t        |«      rdd l}|j                  |«       y t        ||«       y )NTr   r   )r   Úcommand_lineÚlenr,   r'   ÚmainrE   )r   r+   Úscript_argsr'   s       r#   Údo_setup_and_executerK   ;   sM   € à„EÔà˜‰^€FÜ%(¨Ó%5¸Ò%9�+˜a˜b‘/¸r€KÜ�ÔÛØ�‰�KÕ ä˜ Õ,r%   c                 óâ   — | j                   r| j                   n	t        «       }t        | j                  | j                  | j
                  || j                  ¬«       t        |«       t        «        y )N)ÚcontextÚdataÚbackendÚhook)	rO   r   r   ÚnamerM   rN   rP   rK   r   )r"   r   rO   s      r#   Úrun_profilingrR   H   sF   € Ø"Ÿlšlˆd�lŠl´Ó0A€Gä	ˆ$�)‰)˜TŸ\™\°·	±	À7ÐQU×QZÑQZÕ[ä˜Ô%ä…Jr%   c                  ó6   — t        «       \  } }t        | |«       y )N)r$   rR   )r"   r   s     r#   rI   rI   R   s   € Ü'Ó)Ñ€Dˆ+Ü�$˜Õ$r%   r/   )r   r5   r(   Úprofiler   r   r   r   r$   r,   rE   rK   rR   rI   r.   © r%   r#   ú<module>rV      sI   ðÛ Û 
Û 	ß 5Ñ 5Ý ò"ò(0ò!ò6
-òò%ð
 ˆzÒÙ…Fð r%   