403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.145
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 :  /Python315/Lib/profiling/sampling/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/profiling/sampling/__pycache__/_child_monitor.cpython-315.pyc
R
>lqjx$c�h�Qs]PHs]PHs]PHs]PHs]PHsQsQs]ds]
s	QQks
QsQQ2sP!)z�
Child process monitoring for the sampling profiler.

This module monitors a target process for child process creation and spawns
separate profiler instances for each discovered child.
皙�����?g>@c�2�[OVQ5!)z�
Get all child process IDs of the given process.

Args:
    pid: Process ID of the parent process
    recursive: If True, return all descendants (children, grandchildren, etc.)

Returns:
    List of child PIDs
��	recursive)�_remote_debugging�get_child_pids)�pidrs&&�6C:\Python315\\Lib\profiling\sampling\_child_monitor.pyrrs���+�+�C�E�E�c�0�[OU2!)z�
Check if a process is a Python process.

Args:
    pid: Process ID to check

Returns:
    bool: True if the process appears to be a Python process, False otherwise
)r�is_python_process)rs&rrr*s���.�.�s�3�3r	c�v`�\sQs]7snQsQsQsQsQ
Qks\	Q2s
\1QksQs
Q	sQ
sQsQsUsP!)�ChildProcessMonitora:
Monitors a target process for child processes and spawns profilers for them.

Use as a context manager:
    with ChildProcessMonitor(pid, cli_args, output_pattern) as monitor:
        # monitoring runs here
        monitor.wait_for_profilers()  # optional: wait before cleanup
    # cleanup happens automatically
c���VmV mV0m[2Um,Um[O2Um[O2Um
PUm]UmP!)z�
Initialize the child process monitor.

Args:
    pid: Parent process ID to monitor
    cli_args: CLI arguments to pass to child profilers
    output_pattern: Pattern for output files (format string with {pid})
)
�
parent_pid�cli_args�output_pattern�set�_known_children�_spawned_profilers�	threading�Lock�_lock�Event�_stop_event�_monitor_thread�_poll_count)�selfrrrs&&&&r�__init__�ChildProcessMonitor.__init__BsS���� �
�,��"�u���"$����^�^�%��
�$�?�?�,���#�����r	c��[OUOP	QUO0Q5UmUOO2U!)Tzchild-monitor-)�target�daemon�name)r�Thread�
_monitor_looprr�start�rs&r�	__enter__�ChildProcessMonitor.__enter__VsI��(�/�/��%�%��!�$�/�/�!2�3� 
���
	
���"�"�$��r	c��UOO2UOdXUOOQQ5UOO	2%c[Q[OQ5UO2UO9^tt^2[UO2oUOO2PPP2WFDoUOU2J	P
!)%fhK-9h)N�@��timeoutz,Warning: Monitor thread did not stop cleanly��file)rrr�join�is_alive�print�sys�stderr�wait_for_profilersr�listr�clear�_cleanup_process)r�exc_type�exc_val�exc_tb�profilers_to_cleanup�procs&&&&  r�__exit__�ChildProcessMonitor.__exit___s������������+�� � �%�%�c�%�2��#�#�,�,�.�.��B�����	
���!��Z�Z�Z�#'��(?�(?�#@� ��#�#�)�)�+��)�D��!�!�$�'�)��
�Z�s�%0C:�:D
	�D
	c�x�UO2dP!UO2UOUQ5P![OcjSO2SOSQ5P![Oc+SO2P![cP!h9hh9hh9h)Nr+)�poll�	terminate�wait�
subprocess�TimeoutExpired�kill�	Exception)rr<�terminate_timeout�kill_timeouts&&&&rr7�$ChildProcessMonitor._cleanup_processus����9�9�;�"������	��I�I�/�I�0���(�(�
	��I�I�K�
��	�	�,�	�/���,�,�
���I�I�K�K�� �����
��	
	�sW�;�B9�B9�!A6�6B5�
B5�B �B9� 	B1�*B1�+B5�,B9�0B1�1B5�5B9c��UO9^tt^2[UO2ttPPP2!)%fhP!9h�N)rr5rr&s&r�spawned_profilers�%ChildProcessMonitor.spawned_profilers�s%��
�Z�Z�Z���/�/�0��Z�Z�Z�s�6�A	�A	c��UOoU%fP![Q[U2Q0[OQ5[
O2U*oSFDGoU[
O2*
oU]6:cP!UO[QU2Q5JI	P![OcJeh9h)z�
Wait for all spawned child profilers to complete.

Call this before exiting the context if you want profilers to finish
their work naturally rather than being terminated.

Args:
    timeout: Maximum time to wait in seconds
zWaiting for z! child profiler(s) to complete...r-rr+)rLr1�lenr2r3�time�	monotonicrB�maxrCrD)rr,�	profilers�deadliner<�	remainings&&    rr4�&ChildProcessMonitor.wait_for_profilers�s����*�*�	���
��3�y�>�*�*K�L����	
�
�>�>�#�g�-���D� �4�>�>�#3�3�I��A�~��
��	�	�#�c�9�"5�	�6����,�,�
��
�s�
B,�,C�C�Cc��UOO2%CfU9O]*
tmUO[*]6XcUO	2[[
UOP	Q52oUO9^tt^2VO*
oUOOU2PPP2WFD'o[U2%fJUOU2J)	UOO%[&Q5CJ"P!)%fhKc9h[cP![c)o[QS0[ O"Q5Po=KsPo=hh9h)�rz&Warning: Error in child monitor loop: r-r+)r�is_setr�_CLEANUP_INTERVAL_CYCLES�_cleanup_completed_profilersrrrrr�updater�_spawn_profiler_for_child�ProcessLookupErrorrFr1r2r3rB�_CHILD_POLL_INTERVAL_SEC)r�children�new_children�	child_pid�es&    rr$�!ChildProcessMonitor._monitor_loop�s���"�"�)�)�+�+�
�� � �A�%� ��#�#�&>�>�!�C��5�5�7��~�d�o�o��N�O���Z�Z�Z�#+�.B�.B�#B�L��(�(�/�/��=� �".�I�(��3�3��6�6�y�A�".�
���!�!�*B�!�C�;,� �Z��&�
���
��<�Q�C�@�������
�sT�4D9�AD9�.D&�D9�,D9�&D6	�/D6	�1D9�9	E9�E9�E9�E9�E4�4E9c���UO9^tt^2UOTt,tFDpO2dJUMJ	toUmPPP2P!ttoh)%fhP!9hrK)rrr@)r�ps& rr[�0ChildProcessMonitor._cleanup_completed_profilers�sN��
�Z�Z�Z� �2�2�'�2�a�f�f�h���2�'�D�#��Z��'��Z�Z�s'�A�A�A�A�A�A,	�$A,	c�J�UOO2%cP!UO9^tt^2[UO2[
6�c1[
Q[
QU0[OQ5PPP2P!PPP2[OQQQ[U2,oUOUOU22Po[OU[O[O[OQ5oUO9^tt^2UOO2%c UO!UQQQ	5PPP2P!UOO#U2PPP2[
Q
U0[OQ5P!)%fhCK-9h)%fhKD9h[$cEoSdSO!SQQQ	5[
QSQS0[OQ5Po=P!Po=hh9h)
NzWarning: Max child profilers (z) reached, skipping PID r-z-mzprofiling.sampling�attach)�stdin�stdoutr3��?)rGrHz#Started profiler for child process z,Warning: Failed to start profiler for child z: )rrYrrOr�_MAX_CHILD_PROFILERSr1r2r3�
executable�str�extend�_build_child_cli_argsrC�Popen�DEVNULLr7�appendrF)rrb�cmdr<rcs&&   rr]�-ChildProcessMonitor._spawn_profiler_for_child�s������"�"�$�$���Z�Z�Z��4�*�*�+�/C�C��4�5I�4J�K$�$-�;�0�����
��Z�C��
�N�N�� ���	�N�
��	�
�
�4�-�-�i�8�9���	��#�#�� �(�(�!�)�)�!�)�)�	�D������#�#�*�*�,�,��)�)���#�*������'�'�.�.�t�4�
�
�5�i�[�A��Z�Z�
�E�Z�Z��4����	����%�%��C�c�&��
�>�y�k��A�3�O��Z�Z�
�
��	�sl�F,�&F,�AG�) G�
G�G�)G�&G�,F=	�5F=	�G	�	G	�G�	H"�H"�H�"5H�H"c�d�[UO2oUO%c�UOOQ[	U22oP
o[U2FD5vqVUQ7fJU]*[
U26fJ'V2U]*$P	oL	U%fUOQU,2U!)z{pid}�-o)rxz--output)r5rr�replacero�	enumeraterOrp)rrb�args�output_file�found_output�i�args&&     rrq�)ChildProcessMonitor._build_child_cli_argss����D�M�M�"�������-�-�5�5�g�s�9�~�N�K� �L�#�D�/����,�,��Q���T��1B�"-��Q��K�#'�L��	*�
 ����T�;�/�0��r	)	rrrrrrrrr)r*rl)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rr'r=r7�propertyrL�_DEFAULT_WAIT_TIMEOUT_SECr4r$r[r]rq�__static_attributes__�__classdictcell__)�
__classdict__s@rr
r
7sY������(��,�&�1��1�*C��: D�D�3�j�r	r
)T)
r�rCr2rrPrr_r�rmrZrrr
�r	r�<module>r�sR����
������!������F�
4�`�`r	

Youez - 2016 - github.com/yon3zu
LinuXploit