403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.165
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/profiling/sampling/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/profiling/sampling/__pycache__/cli.cpython-315.opt-2.pyc
R
>lqj�c��]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]QH0G
s
]QH8GsGsGs]QHHGsGsGsGs]QHXGs]QH`Gs]QHhGsGsGs]QHxGs]QH�G!s!]Q	H�G#s#]Q
H�G%s%]QH�G's']QH�G)s)G*s*G+s+G,s,G-s-G.s.G/s/G0s0G1s1G2s2G3s3G4s4]Q
H�G6s6]QH�G9s9QQ\Ot\Ov2s<QQ\Oz2s>Qs?Qs@QsAQsBQsC]@sDQEsEQQQQQQQQQQQ QQ!Q!Q"Q#-sFQ\Q\Q\Q\Q\!Q \Q!\#Q"\%-sGQFsHQ$sIQ%sJQ&sKQ'sLQ(sMQ)sNQ*sOQGQ+ksP\O�Q,\O�\O�*2sTQ-Q.ksUQ/sVQ0sWQHQ1ksXQ2sYQ3sZQ4s[QIQ5ks\Q6s]Q7s^Q8s_Q9s`Q:saQ;sbQ<scQ=sdQ>seQ?sfQ@sgQAshQBsiQCsj\kQD6Xc
\c2P!P!\7cPs6CKh9h\7cPs9CK(h9h)J�)�nullcontext)�SamplingUnknownProcessError�SamplingModuleNotFoundError�SamplingScriptNotFoundError)�sample�sample_live�
dump_stack�_is_process_running)�print_stack_dump)�PstatsCollector)�CollapsedStackCollector�FlamegraphCollector�DiffFlamegraphCollector)�HeatmapCollector)�GeckoCollector)�JsonlCollector)�BinaryCollector)�BinaryReader)�MICROSECONDS_PER_SECOND�PROFILING_MODE_ALL�PROFILING_MODE_WALL�PROFILING_MODE_CPU�PROFILING_MODE_GIL�PROFILING_MODE_EXCEPTION�SORT_MODE_NSAMPLES�SORT_MODE_TOTTIME�SORT_MODE_CUMTIME�SORT_MODE_SAMPLE_PCT�SORT_MODE_CUMUL_PCT�SORT_MODE_NSAMPLES_CUMUL)�ChildProcessMonitor)�LiveStatsCollectorc��\sQs]5sQsP!)�CustomFormatter�)�__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__r$��+C:\Python315\\Lib\profiling\sampling\cli.pyr#r#5s��
	r*r#c�,`�\sQs]=snQQksQsUsP!)�DiffFlamegraphActionc�"�QUmV2mP!)�diff_flamegraph��format�
diff_baseline)�self�parser�	namespace�values�
option_strings&&&&&r+�__call__�DiffFlamegraphAction.__call__?s��,�	��"(�r*r$�N)r%r&r'r(r8r)�__classdictcell__)�
__classdict__s@r+r-r-=s����)�)r*r-aUSample a process's stack frames and generate profiling data.

Examples:
  # Run and profile a script
  `python -m profiling.sampling run script.py arg1 arg2`

  # Attach to a running process
  `python -m profiling.sampling attach 1234`

  # Dump a running process's current stack
  `python -m profiling.sampling dump 1234`

  # Live interactive mode for a script
  `python -m profiling.sampling run --live script.py`

  # Live interactive mode for a running process
  `python -m profiling.sampling attach --live 1234`

Use `python -m profiling.sampling <command> --help` for command-specific help.g@g@sready��pstats�	collapsed�txt�
flamegraph�htmlr/�gecko�json�heatmap�jsonl�binary�binc�L�[U2o[U2o[UUUQ5!))�pid�cli_args�output_pattern)�_build_child_profiler_args�_build_output_patternr )�args�
parent_pid�child_cli_argsrLs&&  r+�_setup_child_monitorrR{s.��/��5�N�+�4�0�N����%��r*c�T�[UQP
2%c[V2![2!)�subprocesses)�getattrrRr)rOrJs&&r+�_get_child_monitor_contextrV�s$���t�^�U�+�+�#�D�.�.��=�r*c���,o[UO*oUOQ[U2,2UOd'UOQ[UO2,2UO
%cUO
Q2UO%cUO
Q2UO%cUO
Q2UO%fUO
Q2UO%cUO
Q2UO%c9UO
Q2[UQQ	2oUQ	6wcUOQ
U,2[UQQ2oUQ6wcUOQ
U,2UOQ6Xc UOQUO,2U!UOQ6wcUO
QUO02U!)�-r�-d�-a�--realtime-stats�--native�--no-gc�	--opcodes�
--async-aware�
async_mode�running�--async-mode�mode�wall�--moder/�--diff-flamegraphr>�--)r�sample_interval_usec�extend�str�duration�all_threads�append�realtime_stats�native�gc�opcodes�async_awarerUr1r2)rO�
child_args�hzr`rcs&    r+rMrM�s����J�
!�D�$=�$=�	=�B����t�S��W�o�&��}�}� ����4��T�]�]�!3�4�5��������$���������,�-��{�{�{����*�%��7�7�7����)�$��|�|�|����+�&��������/�*��T�<��;�
���"����~�z�:�;��4���(�D��v�~����8�T�*�+��{�{�'�'����.��0B�0B�C�D���
����	 ����B�t�{�{�m�,�-��r*c�h�UO%cJ[OOUO2vqU%cUQU0!UOQ0![OUOQ2oUOQ6XcQ!UOQ6XcQ!UOQU0!)z_{pid}r@rEz
heatmap_{pid}r>zprofile_{pid}.pstatsz_{pid}.)�outfile�os�path�splitext�FORMAT_EXTENSIONS�getr1)rO�base�ext�	extensions&   r+rNrN�s����|�|�|��G�G�$�$�T�\�\�2�	����V�8�C�5�)�)��l�l�^�8�,�,�&�)�)�$�+�+�u�=�	��;�;�)�#�"��;�;�(�"�)��+�+��i�	�{�3�3r*c�H�Q[Q[Q[Q[-oV*!�rd�cpu�gil�	exception)rrrr)�mode_string�mode_maps& r+�_parse_moder��s.��	�#�
�!�
�!��-�	�H�� � r*c�F�UO2eP!PoUO%c8UOO2O2O	2oU%c[U2g[QUO02g[
[1cK>h9h)NzProcess exited with code )	�poll�stderr�read�decode�strip�OSError�UnicodeDecodeError�RuntimeError�
returncode)�process�
stderr_msgs& r+�_check_process_diedr��s����|�|�~����J��~�~�~�	� ���,�,�.�5�5�7�=�=�?�J���:�&�&�
�2�7�3E�3E�2F�G�
H�H���+�,�	��	�s�6B�B �B �B c��[O2U*o[O2oUO	U[O
2[
U2U[O2*
oU]6:c[OQ2gUO[QU2Q5%fJiUO2vqgUO[2oUO2U[6wc[!QU802gUO2P!SO2h9hSO2h9h)Tz	timed outg�������?��timeoutzInvalid ready signal received: )�time�	monotonic�	selectors�DefaultSelector�register�
EVENT_READr��socketr��select�min�accept�recv�_RECV_BUFFER_SIZE�close�_READY_MESSAGEr�)	�	sync_sockr�r��deadline�sel�	remaining�conn�_�ready_signals	&&&      r+�_wait_for_ready_signalr��s����~�~��'�)�H�
�
#�
#�
%�C��L�L��I�0�0�1�����(� �4�>�>�#3�3�I��A�~��n�n�[�1�1��:�:�c�#�y�&9�:�:�:���&�&�(�G�D�
�#�y�y�):�;���
�
���~�-�"�%D�\�DT�#U�V�V���	�	���
�
�
���	�	�	��s6�.D7�7D7�;D7�D"�%D7�D7�"D4�4D7�7E	c�X�[O[O[O29^tt^2oUO[O[O
]2UO
Q	2UO2]*oUO]2UO[2[O2oUQ*o[OQQ[U2U1[!U2*o-oU%c:["O$UQ$["O$UQ$["O&UQ$["O(U1-U@o[+V([2UttPPP2![O,c�SO/2edSO12SO3[4Q5L;["O6c$SO92SO32Lh9h[;Q2gh9h)%fhP!9h)
�:r�NN�-mz$profiling.sampling._sync_coordinator�stdin�stdoutr�r�z1Process failed to signal readiness within timeout)z	127.0.0.1r)r��AF_INET�SOCK_STREAM�
setsockopt�
SOL_SOCKET�SO_REUSEADDR�bind�getsockname�listen�
settimeout�_SYNC_TIMEOUT_SECrw�getcwd�sys�
executablerj�tuple�
subprocess�DEVNULL�PIPE�Popenr�r�r��	terminate�wait�_PROCESS_KILL_TIMEOUT_SEC�TimeoutExpired�killr�)	�original_cmd�suppress_outputr��	sync_port�cwd�target_args�cmd�popen_kwargsr�s	&&       r+�_run_with_syncr�s���
���v�~�~�v�'9�'9�	:�	:�i����V�.�.��0C�0C�Q�G����'�(��)�)�+�A�.�	���������.�/��i�i�k��#�2�&���N�N��2��	�N��
�
�+��
�����$.�$6�$6�L��!�%/�%7�%7�L��"�%/�_�_�L��"��"�"�3�7�,�7��
	�"�9�7H�I��c
;�	:��H�~�~�	��|�|�~�%��!�!�#�#��L�L�)B�L�C��!�0�0�#��L�L�N��L�L�N�#���C��
�	��I
;�	:�	:�sg�CH�AH�#E?�3H�?H�H�&H�7G�
H�H	�"!H	�H�H	�H�H�H)	�!H)	al
      ^                   # Start of string
      (                   # Group 1: The numeric value
          \d+             #   One or more digits (integer part)
          (?:\.\d+)?      #   Optional: decimal point followed by digits
      )                   #   Examples: "10", "0.5", "100.25"
      (                   # Group 2: Optional unit suffix
          hz              #   "hz" - hertz
          | khz           #   "khz" - kilohertz
          | k             #   "k" - shorthand for kilohertz
      )?                  #   Suffix is optional (bare number = Hz)
      $                   # End of string
  c�2�U]6�cPgQ[Q[-!)��rate_str�return)rj�int)r1s"r+�__annotate__�!_parse_sampling_rate.__annotate__Ns����3��3�r*c��UO2O2o[OU2oU%f[O
QUQ02gUO
]2oUO
]29%fPoQ]QQQQ-oUOU]2o[U2U*oU]6:c[O
QU02g[[U*2oU]6c[O
QU02gU!)zInvalid sampling rate format: zX. Expected: number followed by optional suffix (hz, khz, k) with no spaces (e.g., 10khz)rt�khz���kz Sampling rate must be positive: zSampling rate too high: )r��lower�
_RATE_PATTERN�match�argparse�ArgumentTypeError�groupr{�floatr�r)r�r��number_part�suffix�
suffix_map�
multiplierrt�
interval_usecs&       r+�_parse_sampling_rater�Ns���~�~��%�%�'�H�����)�E���(�(�,�X�J�7e�
e�
�	
�
�+�+�a�.�K�
�[�[��^�
!�
!�r�F�	
�a�
�t��T��J�
�����*�J�	�{�	�j�	(�B�	�Q�w��(�(�+K�H�:�)V�W�W��/�"�4�5�M��q���(�(�+C�H�:�)N�O�O��r*c
���UOQ2oUOQQ[QQQQQ5UOQQ	[PQ
QQ5UOQ
QQQQ5UOQQQQ5UOQQQQ5UOQQQQQ5UOQQQQ5UOQQQQ5UOQQQ Q5UOQ!QQ"Q5P!)#zSampling configurationrXz--sampling-rate�1khz�RATErhz'sampling rate (e.g., 10000, 10khz, 10k))�type�default�metavar�dest�helprYz
--duration�SECONDSz.Sampling duration (default: run to completion))r�r�r�r�rZ�
--all-threads�
store_truezASample all threads in the process instead of just the main thread��actionr�r[zIPrint real-time sampling statistics (Hz, mean, min, max) during profilingr\�GInclude artificial `<native>` frames to denote calls to non-Python coder]�store_falserp�JDon't include artificial `<GC>` frames to denote active garbage collection�r�r�r�r^z�Gather bytecode opcode information for instruction-level profiling (shows which bytecode instructions are executing, including specializations).r_zCEnable async-aware profiling (uses task-based stack reconstruction)z--subprocesseszQAlso profile subprocesses. Each subprocess gets its own profiler and output file.�
--blockingz�Stop all threads in target process before sampling to get consistent snapshots. Uses thread_suspend on macOS and ptrace on Linux. Adds overhead but ensures memory reads are from a frozen state.)�add_argument_group�add_argumentr�r�)r4�sampling_groups& r+�_add_sampling_optionsr�ns]���.�.�/G�H�N������
!���
#�
6� �������
���
=�
 ��������
P�	 �������
X� ��
�����
V� ��
�����
�
Z�	 �������X� �������
R� ��
�����
`� ��
�����)� �r*c��UOQ2oUOQ,Q	NQQQ5UOQQQ,QQQ5P!)
zMode optionsrerdz�Sampling mode: wall (all samples), cpu (only samples when thread is on CPU), gil (only samples when thread holds the GIL), exception (only samples when thread has an active exception). Incompatible with `--async-aware`��choicesr�r�rbra�allztAsync profiling mode: "running" (only running task) or "all" (all tasks including waiting). Requires `--async-aware`r�)r�r�)r4�
mode_groups& r+�_add_mode_optionsr�s\���*�*�>�:�J�����3��,�	�������E�"��K�	�r*c	��UOQ2oUO2oUOQQQQQQ5UOQQQQQ	Q5UOQ
QQQQQ5UOQ
QQQQQ5UOQQQQQQ5UOQQ[QQ5UOQQQQQQ5U%cUOQQQQQQ5UO	QPQ5U%cUOQ,Q.NQQ Q!5UOQ"Q#Q$Q%Q&5UOQ'Q(Q)Q*OQ+[22Q,0Q-5P!)/zOutput optionsz--pstats�store_constr>r1z Generate pstats output (default))r��constr�r�z--collapsedr?z/Generate collapsed stack traces for flamegraphsz--flamegraphrAz2Generate interactive HTML flamegraph visualizationz--geckorCz*Generate Gecko format for Firefox Profilerz	--heatmaprEzMGenerate interactive HTML heatmap visualization with line-level sample countsrf�BASELINEzTGenerate differential flamegraph comparing current profile to `BASELINE` binary file)r�r�r�z--jsonlrFzBGenerate newline-delimited JSON (JSONL) for programmatic consumers�--binaryrGzIGenerate high-performance binary format (use `replay` command to convert)r0z
--compression�autozGCompression for binary format: auto (use zstd if available), zstd, nonerz-oz--outputrvz�Output path (default: `stdout` for `pstats` text; with `-o`, `pstats` is binary). Auto-generated for other formats. For heatmap: directory name (default: `heatmap_PID`))r�r�z	--browserr�z Automatically open HTML output (�, c3�`�SF �DoQUOQQ2*w�	J!	P!3h)rgr��-)�replace��.0�fs& r+�	<genexpr>�&_add_format_options.<locals>.<genexpr>s&��>X���>X��$����3��!4�4�4�>X�s�'.zR) in browser. When using `--subprocesses`, only the main process opens the browserr�)r
�zstd�none)r��add_mutually_exclusive_groupr�r-�set_defaults�join�BROWSER_COMPATIBLE_FORMATS)r4�include_compression�include_binary�output_group�format_groups&&&  r+�_add_format_optionsr�s����,�,�-=�>�L��<�<�>�L�������
�
/���������
�
>���������
�
A���������
�
9���������
�
\��������#�
c�	��������
�
Q�����!�!�� ���\�	"�	
����x�t��<���!�!��,��Z�		"�	
������
�a�	�������
��	�	�Y�>X�Y�Y�Z�[S�
S�	�	r*c��UOQ2oUOQ,QNPQQ5UOQQ[PQQ5UOQQ	Q
Q5P!)
zpstats format options�--sortz0Sort order for pstats output (default: nsamples)rz-l�--limitz4Limit the number of rows in the output (default: 15))r�r�r��--no-summaryr�z0Disable the summary section in the pstats outputr���nsamples�tottime�cumtimez
sample-pctz	cumul-pctznsamples-cumul�name)r�r�r�)r4�pstats_groups& r+�_add_pstats_optionsr)sx���,�,�-D�E�L�����
��
?��
������
��
C��������
?��r*c�h�UOQ2oUOQQQQQ5UOQQQQ5UOQQ	Q
QQ5UOQ
QQQ5UOQQQQ5UOQQQ,[OQQ5UOQQQQ5P!)zDump optionsrZr�r�z?Dump all threads in the process instead of just the main threadr�r\r�r]r�rpr�r�r^z*Show bytecode opcode names when available.r_z'Enable async-aware stack reconstructionrbrarz�Async stack mode: "running" (only running task) or "all" (all tasks including waiting, default for dump). Requires `--async-aware`rr�z<Stop all threads in target process before dumping the stack.)r�r�r��SUPPRESS)r4�
dump_groups& r+�_add_dump_optionsr->s����*�*�>�:�J�������
N�	�������
V���
�����
�
Z�	�������
9���
�����
6���
�����E�"��!�!�#�	�������
K��r*c��Q[Q[Q[Q[Q[Q[
QP-oUO
U[2!r#)rrrrrrr{)�sort_choice�sort_maps& r+�
_sort_to_moder1ksH��	�&��$��$��*��(��2����H��<�<��%7�8�8r*c��[OU2oUe[QU02gUQ6XcNUe[Q2g[OOU2%f[QU02gUUUUQ5!UQ6XcUe[Q2gUVQUUQ5!UQ	6Xc
P
oUVUQ
5!UQ6XcUVUQ5!UVQ
5!)NzUnknown format: r/z0Differential flamegraph requires a baseline filezBaseline file not found: )�baseline_binary_path�	skip_idlerGz%Binary format requires an output file)r4�compressionrC)r4rqrF)r4rc)r4)�
COLLECTOR_MAPr{�
ValueErrorrwrx�exists)	�format_typerhr4rqrc�output_filer5r2�collector_classs	&&&&&&&& r+�_create_collectorr<xs���($�'�'��4�O����+�K�=�9�:�:��'�'�� ��O�P�P��w�w�~�~�m�,�,��8���H�I�I�� �!.��
�	
��h�����D�E�E��{�I�*5�7�	7�
�g���	��3�RY�Z�Z��g��� �D�
�	
��/�E�Er*c�\�[OUQ2oUQ6XcQU0!UQUQU0!)r@rE�heatmap_r��.)rzr{)r9rJr~s&& r+�_generate_output_filenamer@�sB��"�%�%�k�5�9�I��i���#�����]�!�C�5��)��-�-r*c��[OOU2o[OOU2%ci[OO	UQ2o[OOU2%cSoL [
QU0[OQ5P!QU0o[OU2P![c*o[
QS0[OQ5Po=P!Po=hh9h)z
index.htmlz&Warning: Could not find index.html in ��filezfile://z!Warning: Could not open browser: )rwrx�abspath�isdirrr8�printr�r��
webbrowser�open�	Exception)rx�abs_path�
index_path�file_url�es&    r+�_open_in_browserrN�s����w�w���t�$�H�
�w�w�}�}�X����W�W�\�\�(�L�9�
�
�7�7�>�>�*�%�%�!�H��:�4�&�A��
�
�S����
�#�H�H�����!���H�
�1�!��5�C�J�J�G�G��H�s�4C�	D�D�C;�;Dc�x�[UQ29^tt^2oUO[2oPPP2[
W2[6fUQ*[7c[O
Q2P!P!)%fhKP9h[c'o[O
QSQS02Po=KPo=hh9h)�rbz!Error: Could not read input file z: :N�NzoError: Input file is not a binary sampling profile. The replay command only accepts files created with --binary)rHr��_BINARY_PROFILE_HEADER_SIZEr�r��exit�len�_BINARY_PROFILE_MAGICS)�filenamerC�header�excs&   r+�_validate_replay_input_filerY�s���H�
�(�D�
!�
!�T��Y�Y�:�;�F�"�	�F��1�1��"�:�3�3����
J�	
�4�"�
!���H����4�X�J�b���F�G�G��H�s?�B�A5�B�5B	�>B	�B�B�	B9�B9�B4�4B9c���UO2oUQ*o[QUQ*QUO02[QUQ02[QUOQ]2]6XcQLQ	02[	UO
UP
UOQ
5oQoUOVE2o[2UO
Q6Xc�UO%cUOUO2L�UOd
UOLQ
oUOd
UOL]o[U2o	UOV�UO%([2L�UO9%f*[!UO
["O$22o
UOU
2oU%c4UO
[&7c[)UQP
2%c[+U
2[QUQ02P!)�sample_interval_usz
Replaying �sample_countz samples from z  Sample interval: z usz  Compression: �compression_typerr)r4r2c���U]6�c`V*o](o[V2*2oQU*QV4*
**o[QUQU]d*Q
QUQ
QUQ
Q	0	PP	Q
5P!P!)ru█u░z
  [z] z5.1fz% (�,�/�))�end�flush)r�rF)�current�total�pct�	bar_width�filled�bars&&    r+�progress_callback�._replay_with_reader.<locals>.progress_callback�sr���1�9��/�C��I����)�F��&�.�5�I�,>�#?�?�C����u�B�s�3�w�t�n�C���{�!�E�!�9�A�F���
�r*r>r$�browserz	Replayed z samples)�get_inforF�
input_filer{r<r1r2�replay_samplesrv�export�sort�limitr1�print_stats�
no_summaryrr@rw�getpidrrUrN)rO�reader�info�interval�	collectorrj�countr/rr�	sort_moderV�	export_oks&&          r+�_replay_with_readerr}�s����?�?��D��(�)�H�	�J�t�N�+�,�N�4�?�?�:K�
L�M�	���z��
-�.�	���X�X�0�!�4��9�6�v�
F�	H��
"����X���(�(��I�

�
�!�!�)�?�E�	�G��{�{�h���<�<�<����T�\�\�*�"�Y�Y�2��	�	�
�
�#'�*�*�"8�D�J�J�b�E�%�k�2�I��!�!��d�o�o�"5�#�
�
�L�L�
C�
C�(����b�i�i�k�B�	��$�$�X�.�	�
����9�9���i��/�/��X�&�	�I�e�W�H�
%�&r*c���UOQ6Xc<UOP2UOo[QUQUOQ02P!UOQ6XCcUO
%c�[OOUO
2%cR[OOUO
[UOU22oUOU2P!UOUO
2P!UOd
UOLQoUOd
UOL]o[U2oUOVvUO%(U2P!UO
%co[OOUO
2%c@[OOUO
[UOU22oL*UO
9%f[UOU2oUOU2oU%c:UO[ 7c#[#UQP
2%c[%U2P!P!P!P!)rGzBinary profile written to z (z	 samples)r>r$rl)r1rprVrF�
total_samplesrvrwrxrErr@rqrrr1rsrtrrUrN)	ryrOrJrcrVr/rrr{r|s	&&&&     r+�_handle_outputr�,s����{�{�h��������%�%��
�*�8�*�B�y�7N�7N�6O�y�Y�Z�	
����	 ��<�<�<��w�w�}�}�T�\�\�*�*��7�7�<�<����6O�PT�P[�P[�]`�6a�b��� � ��*�� � ����.�(,�y�y�'<�$�)�)�*�K�"&�*�*�"8�D�J�J�b�E�%�k�2�I��!�!��d�o�o�"5�t�
�
�<�<�<�B�G�G�M�M�$�,�,�7�7��w�w�|�|�D�L�L�2K�D�K�K�Y\�2]�^�H��|�|�R�R�'@����c�'R�H��$�$�X�.�	�
����9�9���i��/�/��X�&�0�:�
r*c��	�[UQP2oUQ6XcP![UQ2%c,UO%c[eUO	Q2[UQ2%caUO
%cO[eUO	Q2[UQ2%c$UO%cUO	Q2[UQP
2%Cc,o[UQP
2%cUOQ	2[UQ
P	2%fUOQ2[UQP2Q
6XcUOQ2[UQ2%c0UOQ6wcUOQUO02[UQ2%c$UO%cUOQ2U%c%UO	QQOU2Q02[UQP
2%f`UQ6Xc%[UQ2%cUO	Q2L4[UQ2%c#UOQ6wcUO	Q2UQ6XcP!UO%cOUO]d6c>[QUOQQUO*Q0[O Q5[UQ2%c�UO%c�UO"Q 6wc%Q!UO"0oUO	Q"UQ#02,oUO$dUOQ$2UO&dUOQ%2UO(%cUOQ&2U%c%UO	QQOU2Q'02P!UO"Q(6Xc$[UQQ2Q6wcUO	Q)2Q/o[UQ*P
2%c<UO"U7c+UO	Q+QOQ,U22Q-02UO"Q 6wc�,oUO$dUOQ$2UO&dUOQ%2UO(%cUOQ&2U%c8Q!UO"0oUO	QQOU2Q.U02P!P!P!)0�command�replay�livez=Live mode requires the curses module, which is not available.rTzU--subprocesses is not available on this platform (requires _remote_debugging module).z0--subprocesses is incompatible with --live mode.rrror\rpr]r1rGr	rcrdz--mode=rlr�zOptions rza are incompatible with --async-aware. Async-aware profiling uses task-based stack reconstruction.�dumpr`z2--async-mode requires --async-aware to be enabled.razWarning: --blocking with a u$ µs interval will stop all threads i@BzS times per second. Consider using --sampling-rate 1khz or lower to reduce overhead.rBr>rgz--live is incompatible with z!. Live mode uses a TUI interface.r r!r"zT are incompatible with --live. Live mode uses a TUI interface with its own controls.rCzy--mode option is incompatible with --gecko. Gecko format automatically includes both GIL-holding and CPU status analysis.rqz"--opcodes is only compatible with c3�@�SF �DoQU*w�	J	P!3h)rgr$rs& r+r�!_validate_args.<locals>.<genexpr>�s��Mg���Mg��4�!�8�8�Mg�s�r?z# are only valid with --pstats, not )r�rCrAr/rErG)rU�hasattrr�r!�errorrTr rmrcrlrr`�blockingrhrFr�r�r1rqrrrt)rOr4r��issues�format_flag�opcodes_compatible_formatss&&    r+�_validate_argsr�\s���d�I�t�,�G��(����t�V�������/A�/I����K�	
�
�t�^�$�$��):�):�):��&��L�L�7�
��4�� � �T�Y�Y�Y��L�L�K�L��t�]�E�*�*����4��5�)�)��M�M�*�%��t�T�4�(�(��M�M�)�$��4��4�(�H�4��M�M�*�%��4�� � �T�Y�Y�&�%8��M�M�G�D�I�I�;�/�0��4��'�'�D�,<�,<�,<��M�M�/�*���L�L��4�9�9�V�,�-�.N�N�
��4���.�.��f���t�\�*�*����Q�R��
�T�<�
(�
(�T�_�_�	�-I��L�L�M�N��&����}�}�}��2�2�S�8�
�)�$�*C�*C�)D�Dh��D�5�5�5�6�7O�
O����		
��t�V��������;�;�(�"��t�{�{�m�,�K��L�L�.�{�m�;\�]�
�
���9�9� ��M�M�(�#��:�:�!��M�M�)�$��?�?�?��M�M�.�)���L�L��4�9�9�V�,�-�.H�H�
�	��{�{�g��'�$���"?�6�"I����
\�	
�"i���t�Y��&�&�4�;�;�>X�+X����0����:h�Mg�:h�1h�0i�ij�k�	
�
�{�{�h�����9�9� ��M�M�(�#��:�:�!��M�M�)�$��?�?�?��M�M�.�)���t�{�{�m�,�K��L�L��4�9�9�V�,�-�-P�Q\�P]�^�
��r*c�P�[O[OP2o[O[OP2[2[O[OU2P![O[OS2h9hr:)�locale�	setlocale�LC_ALL�_main)�
old_locales r+�mainr��sa���!�!�&�-�-��6�J�
���V�]�]�B�'�4�
��������
�3��������
�3�s�
A>�>'B%c��[O[[Q5oUO	QP	QQ5oUOQQ[QQ5oUO
QQ	Q
QQ5UO
Q
QQ5UO
Q[OQQ5UO
QQ
QQ5[U2[U2[U2[U2UOQQ[QQ5oUO
Q[QQ5UO
QQ
QQ5[U2[U2[U2[U2UOQQ[QQ5oUO
Q[QQ5[U2UOQQ [Q!Q5oUO
Q"Q#Q5[UP
P
Q$5[U2UO2o[V`2Q[ Q["Q[$Q[&-oUO)UO*2oU%cUU2P!UO-Q%UO*02P!)&)�description�formatter_classr�zCommand to run)r��requiredr��runz"Run and profile a script or modulea0Run and profile a Python script or module

Examples:
  # Run and profile a module
  `python -m profiling.sampling run -m mymodule arg1 arg2`

  # Generate flamegraph from a script
  `python -m profiling.sampling run --flamegraph -o output.html script.py`

  # Profile with custom rate and duration
  `python -m profiling.sampling run -r 5khz -d 30 script.py`

  # Save collapsed stacks to file
  `python -m profiling.sampling run --collapsed -o stacks.txt script.py`

  # Live interactive mode for a script
  `python -m profiling.sampling run --live script.py`)r�r�r�r�z--moduler�z)Run target as a module (like `python -m`)r��targetz%Script file or module name to profile)r�rOz)Arguments to pass to the script or module)�nargsr�z--livezSInteractive TUI profiler (top-like interface, press 'q' to quit, 's' to cycle sort)�attachz'Attach to and profile a running processaAttach to a running process and profile it

Examples:
  # Profile all threads, sort by total time
  `python -m profiling.sampling attach -a --sort tottime 1234`

  # Live interactive mode for a running process
  `python -m profiling.sampling attach --live 1234`rJzProcess ID to attach to)r�r�r�z&Dump a running process's current stackz�Dump a running process's current Python stack

Examples:
  # Dump the main thread stack
  `python -m profiling.sampling dump 1234`

  # Dump all thread stacks
  `python -m profiling.sampling dump -a 1234`zProcess ID to dumpr�z5Replay a binary profile and convert to another formata�Replay a binary profile file and convert to another format

Examples:
  # Convert binary to flamegraph
  `python -m profiling.sampling replay --flamegraph -o output.html profile.bin`

  # Convert binary to pstats and print to stdout
  `python -m profiling.sampling replay profile.bin`

  # Convert binary to gecko format
  `python -m profiling.sampling replay --gecko -o profile.json profile.bin`rnzBinary profile file to replay)rrzUnknown command: )r��ArgumentParser�_HELP_DESCRIPTIONr#�add_subparsers�
add_parserr��	REMAINDERr�rrr)r�r-�
parse_argsr��_handle_run�_handle_attach�_handle_dump�_handle_replayr{r�r�)	r4�
subparsers�
run_parser�
attach_parser�dump_parser�
replay_parserrO�command_handlers�handlers	         r+r�r��s���
�
$�
$�%�'��F��&�&�
��,<�'��J�
�&�&�
�
1�'�9�	'��J�,������
8�	������
4�������� � �
8���
�����
b���
�*�%��j�!��
�#��
�#��)�)��
6�'�7�	*��M����
�
�
&���
�����
b���
�-�(��m�$��
�&��
�&��'�'��
5�'�1�	(��K����
�
�
!���
�k�"��)�)��
D�'�
O�	*��M� ����
,����
�5�QV�W��
�&�����D��4� �	�{��.����.�	���"�"�4�<�<�0�G����
����(�����7�8r*c��[UO2%f[UO2gUO%c[	VO2P!UO
Q6Xc[L[UO2oU[6wc
U[6gLP
oPoUO
Q6Xc5UO9%f![UO
UO2o[UO
UOV OUU[UQQ2UO Q5o[#VO29^tt^2[%UOSUO&UO(UO*SUO,%c
UO.LPUO0UO2UOUO4Q5o[7V@UOU2PPP2P!)%fhP!9h)NrCrGr5r
�r:r5r2�	�duration_secrlrnrcrrrorprqr�)r	rJrr��_handle_live_attachr1rr�rcrrvr@r<rhrqrUr2rVrrkrlrnrrr`rorpr�r�)rOrcr4r:rys&    r+r�r�~sw���t�x�x�(�(�)�$�(�(�3�3��y�y�y��D�(�(�+��
�;�;�'�!�	�
����
#�	�(,�/A�'A��#�#�u���K��{�{�h���l�l�V�V�&?����T�X�X�&V��"����T�.�.�	�<�<����D�-��8��(�(�	�I�
$�D�(�(�	3�	3���H�H������(�(��.�.��+/�+;�+;�+;������;�;��w�w��L�L��]�]�
�	�	�y����$�7�
4�	3�	3�	3�s�AG,�AG,�,G=	�5G=	c��[UO2%f[UO2gUO%c[L[
oUO%c[
UQQ2LPo[UOUOUUUOUOUOUOQ5o[!WUOQ5P![c([OQSOQ02KJh9h)r`r)rlrcrrrorprqr�z"No stack dump collected - process z' exited before its stack could be read.)rJ)r	rJrrrrrrUrrlrorprqr��ProcessLookupErrorr�rSr
)rOrcr`�stack_framess&   r+r�r��s����t�x�x�(�(�)�$�(�(�3�3�#'�"2�"2�"2��8J�D�7;�7G�7G�7G���|�U�3�T�J�
�!��H�H��(�(��"��;�;��w�w��L�L��]�]�	
�� �\�t�x�x�0��
�
����0����
�;'�
'�	
�
�s�2AC�	D�$%D�Dc�2	�UO%c�[O2oP
oU[O7c#[OO]U2P	o[OOUO2e[UO2gU%c [OOU2LD[OOUO2%f[UO2gUO%c[U2P!UO%c,[O QUO,UO"N3oL)[O UO,UO"N3o[%UP
Q5oUO*Q6Xc[,L[/UO02oU[,6wc
U[26gLP
oPoUO*Q6Xc5UO49%f![7UO*WO82o[;UO*UO<VpO>UU[AUQQ2UOBQ5o	[EUWO829^tt^2[GUO8S	UOHUOJUOLSUON%c
UOPLPUORUOTUO>UOVQ	5o	[YV�UO8U2UO[2e)UO]2UO_[`Q
5LPPP2P!S%c![OOS2hh9h[&c%o[O(QS02Po=CK%Po=hh9h[bOdc$SOg2SO_2K�h9hSO[2edSO]2SO_[`Q
5h[bOdc$SOg2SO_2hh9hh9h)%fhP!9h)Fr��r��Error: rCrGr5r
r�r�r�)4�modulerwr�r�rx�insert�	importlib�util�	find_specr�r�remover8rr��_handle_live_runr�rOr�r�rSr1rr�rcrrvr@rJr<rhrqrUr2rVrrkrlrnrrr`rorpr�r�r�r�r�r�r�r�r�)
rOr��	added_cwdr�r�rMrcr4r:rys
&         r+r�r��s_���{�{�{��i�i�k���	��c�h�h���H�H�O�O�A�s�#��I�	%��~�~�'�'����4�<�1�$�+�+�>�>�=��������$���w�w�~�~�d�k�k�*�*�-�d�k�k�:�:��y�y�y������{�{�{��~�~�t�T�[�[�=�4�9�9�=���~�~�t�{�{�7�T�Y�Y�7�� � ��e�<���;�;�'�!�	�
����
#�	�(,�/A�'A��#�#�u���K��{�{�h���l�l�Y�Y�&?����W�[�[�&Y��"����T�.�.�	�<�<����D�-��8��(�(�	�I�
$�D�'�+�+�	6�	6�	#������!�]�]� �,�,�#�2�2��/3�/?�/?�/?�D�O�O�T��{�{��7�7��������I�
�9�G�K�K��>��|�|�~�%��!�!�#�#��L�L�)B�L�C�&�'
7�	6��_�������$���(� ����7�1�#����� ��d"�0�0�#��L�L�N��L�L�N�#��	�|�|�~�%��!�!�#�#��L�L�)B�L�C��!�0�0�#��L�L�N��L�L�N�#��	&��'
7�	6�	6�s��#*M1�M1�
N�R�AP�AP�,R�>R�O�%R�1N�:!N�	O
�(O
�)O�O
�P�$!P�R�P�R�R�R�/Q�R�Q>�!Q>�;R�=Q>�>R�R�R	�R	c���[UO2oU[6go[UOSQ]SSUO
UO%c
UOLPQ5o[SSUOUOUOSUO%c
UOLPUOUOUO
UOQ5P!)r%�r4�sort_byrrrJrcrqrrr�)r�rcrr!rhrqrrr`rrkrlrnrorpr�)rOrJrcr4rys&&   r+r�r�&s����t�y�y�!�D��+�+�I�#��!�!�����
����'+�'7�'7�'7�D�O�O�T�	�I�����]�]��$�$��*�*�
�'+�'7�'7�'7�D�O�O�T��{�{��7�7�������r*c��UO%c,[OQUO,UON3oL)[OUO,UON3o[UP	Q5o[UO2oU[6go[UOSQ]WOSUOUO%c
UO LPQ5o[#UOSUO$UO&UO(SUO%c
UO LPUO*UO,UOUO.Q5UO12oUe(UO32UO5[6Q5UO52UO>%clUO>9^tt^2UO>OA2oU%c*[CUOE2[O>Q5PPP2P!P![c%o[OQS02Po=CK�Po=hh9h[8O:cSO=2K�h9h[F[H1cK|h9h)%fhP!9hSO12oSeTSO32SO5[6Q5L+[8O:cSO=2Lh9hSO52SO>%c�SO>9^tt^2SO>OA2oS%c*[CSOE2[O>Q5L[F[H1cLh9hPPP2h)%fhh9hh9h)r�r�r�r%r�r�r�rB)%r�r�r�r�rOr�r�rSr�rcrr!rhrJrqrrr`rrkrlrnrorpr�r�r�r�r�r�r�r�r�r�rFr�r�r7)	rOr�r�rMrcr4ryr�r�s	&        r+r�r�Is����{�{�{��~�~�t�T�[�[�=�4�9�9�=���~�~�t�{�{�7�T�Y�Y�7�� � ��d�;���t�y�y�!�D��+�+�I�#��!�!�����K�K�
����'+�'7�'7�'7�D�O�O�T�	�I�#���K�K������(�(��.�.��+/�+;�+;�+;������;�;��w�w��L�L��]�]�	
��\�\�^�
�������
����%>��?�	�����>�>�>������$�^�^�0�0�2�F���f�m�m�o�C�J�J�?�	 ����a� ����7�1�#����� ��V�,�,�
�����
�� ��,����� �����\�\�^�
�������
����%>��?���,�,�
�����
��	�����>�>�>������$�^�^�0�0�2�F���f�m�m�o�C�J�J�?����,����� ������s	�)
H2�$AJ:�)?J:�
I$�J&�!J�=)J�2	I!�<I!�=I�I!�$J�8J�J�J#�J#� J&�"J#�#J&�&J7	�/J7	�:O�O� K7�6O�7L�L�O�L�$O�O�O	�!N&�<)N&�%O	�&N:�6N:�7O	�9N:�:O	�=	O�O
�O
�	Oc���[OOUO2%f$[O
QUO02[
UO2[UO29^tt^2o[V2PPP2P!)%fhP!9h[[1c%o[O
QS02Po=P!Po=hh9h)zError: Input file not found: r�)rwrxr8rnr�rSrYrr}r�r7)rOrvrXs&  r+r�r��s���
�7�7�>�>�$�/�/�*�*����0����0A�B�C�����0�"�
�$�/�/�
*�
*�f���-�+�
*�
*�
*���Z� �"����7�3�%��!�!��"�sB�*B1�B�B1�B.	�&B.	�(B1�.B1�1C&�C&�C!�!C&�__main__)sHCATsTACH)rAr/rE)F)TT)FNNr
N)lr��importlib.utilr�r�rw�rer�r�r�r�r�rG�
contextlibr�errorsrrrrrrr	r�r
�pstats_collectorr�stack_collectorrr
r�heatmap_collectorr�gecko_collectorr�jsonl_collectorr�binary_collectorr�
binary_readerr�	constantsrrrrrrrrrrrr�_child_monitorr �ImportError�live_collectorr!�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatterr#�Actionr-r�r�r�r�r�rRrUrzr6rrRrVrMrNr�r�r�r��compile�VERBOSE�
IGNORECASEr�r�r�rrr)r-r1r<r@rNrYr}r�r�r�r�r�r�r�r�r�r�r%r$r*r+�<module>r�sW����
�	�	��
��
���"�i�i�H�H�"�-�b�b�/�+�+�-�'�
�
�
�
��3�
�2�
	��*�*��(�(�	�)�8�?�?�)�R��,�������� ��+��
�h����&��v��V�
�v��W��e�	��
�o��(��%��.��^�
���^��o�	�
�J����#�L4�0!�I�$�<4�n�
�
��
�z�z�B�M�M�!�#�
��@@�F�*V�r�>*�Z9�5F�p.�"H�4
�$<'�~-'�`x�v4�Y9�x/8�d1�8W#�t �FC�L"��z���F���e+�����������s0�F4�"G�4G�:G�G�G�
G�G

Youez - 2016 - github.com/yon3zu
LinuXploit