403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
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/live_collector/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/profiling/sampling/live_collector/__pycache__/collector.cpython-315.opt-1.pyc
R
>lqjS�c�\�Qs]PHs]PHs]PHs]QHGsGs]PHs]PH s]PH$s	]PH(s
]PH,s]PH1s]QH4GsGs]QH@GsGsGsGsGsGsGsGs]QH@GsGsGsGsGsGsGsG s G!s!G"s"G#s#G$s$G%s%G&s&G's'G(s(G)s)G*s*G+s+G,s,]QH�G.s.]QH�G0s0G1s1G2s2G3s3G4s4]QH�G6s6\QQ	22s7Q
Q\2s8P!)z=LiveStatsCollector - Main collector class for live profiling.)�	dataclass�field)�	Collector�extract_lineno)�THREAD_STATUS_HAS_GIL�THREAD_STATUS_ON_CPU�THREAD_STATUS_UNKNOWN�THREAD_STATUS_GIL_REQUESTED�THREAD_STATUS_HAS_EXCEPTION�PROFILING_MODE_CPU�PROFILING_MODE_GIL�PROFILING_MODE_WALL)�MICROSECONDS_PER_SECOND�DISPLAY_UPDATE_INTERVAL_SEC�MIN_TERMINAL_WIDTH�MIN_TERMINAL_HEIGHT�HEADER_LINES�FOOTER_LINES�
SAFETY_MARGIN�FINISHED_BANNER_EXTRA_LINES�DEFAULT_SORT_BY�DEFAULT_DISPLAY_LIMIT�COLOR_PAIR_SAMPLES�COLOR_PAIR_FILE�COLOR_PAIR_FUNC�COLOR_PAIR_HEADER_BG�COLOR_PAIR_CYAN�COLOR_PAIR_YELLOW�COLOR_PAIR_GREEN�COLOR_PAIR_MAGENTA�COLOR_PAIR_RED�COLOR_PAIR_SORTED_HEADER)�
CursesDisplay)�HeaderWidget�TableWidget�FooterWidget�
HelpWidget�OpcodePanel)�TrendTrackerc�`�\sQs]4snQs\QQ5s]s]s]s	]s
]s]s]s
]s\QQ5sQsQsU1QksQsUsP!)	�
ThreadDataz4Encapsulates all profiling data for a single thread.c�2�[OQ2!)c��[]]Q5!)�)�direct_calls�cumulative_calls��dict���@C:\Python315\\Lib\profiling\sampling\live_collector\collector.py�<lambda>�%ThreadData.<lambda>.<locals>.<lambda><s���!�a�8r2��collections�defaultdictr1r2r3r4�ThreadData.<lambda>;s���1H�1H�8�2r2)�default_factoryc�2�[OQ2!)c�8�[O[2!�N�r7r8�intr1r2r3r4r5Ms���'�'��,r2r6r1r2r3r4r9Ls��{�7N�7N�,�8r2c���U[*%cU9O]*
tmU[*%cU9O]*
tmU[*%cU9O
]*
tmU[*%cU9O]*
tmU[*%cU9O]*
tm	U9O]*
tm
P!)z/Update status counts based on status bit flags.)r�has_gilr�on_cpur�
gil_requestedr�unknownr	�
has_exception�total)�self�status_flagss&&r3�increment_status_flag� ThreadData.increment_status_flagPs����/�/�/��L�L�A��L��.�.�.��K�K�1��K��5�5�5����!�#���/�/�/��L�L�A��L��5�5�5����!�#���
�
�a��
r2c��QUOQUOQUOQUOQUOQUO
-!)z1Return status counts as a dict for compatibility.rArBrCrDrErF)rArBrCrDrErF�rGs&r3�as_status_dict�ThreadData.as_status_dict^sH��
�t�|�|��d�k�k��T�/�/��t�|�|��T�/�/��T�Z�Z�

�	
r2c�:�U]6�cPg-RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q	$RZ9Q
$RZ9Q$!)��	thread_id�resultrArBrCrDrErF�sample_count�gc_frame_samples�opcode_stats)r?r0)�format�
__classdict__s"�r3�__annotate__�ThreadData.__annotate__4s������N�	�
������
�O�������� ��!�"�N�#�(��)�*��+�0��1r2r1)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrRrArBrCrDrErFrSrTrUrIrM�__annotate_func__�__static_attributes__�__classdictcell__�rWs@r3r)r)4si����>�
�*��F�
�G��F��M��G��M��E��L����0��L��	
�U�r2r)c�6`�\sQs]jsnQsQP
Q\Q\QPQPQPQP
Q	P-Q
ks\Q2s	\Q2s
Q
sQsQs
QsQsQ-QksQsQsQsQ-QksQsQsQsQsQ.QksQsQsQsQsQ sQ!sQ"s Q#s!Q$s"Q%s#Q&s$Q's%Q(s&Q)s'Q*s(Q+s)Q,s*Us+P!)/�LiveStatsCollectorz?Collector that displays live top-like statistics using ncurses.�	skip_idle�sort_by�limit�pid�display�mode�opcodes�async_awarec���[OQ2UmVmU[*UmV mV0mV@m]Um	PUm
PUmV`mP	Um
VPmVpmV�mU	%c
UO"LUO$UmPUmPUmPUmPUm]Um]Um]Um[6UmQ]Q]Q]Q]Q]Q]-Um]Um[OQ2UmV�m ]Um!]Um"P
Um#P
Um$PUm%P
Um&PUm'P
Um(PUm)PUm*,Um+Q	Um,]Um--Um.UO_2Um0PUm1PUm2PUm3PUm4PUm5[lOn2Um8PUm9[u2Um;P!)
ah
Initialize the live stats collector.

Args:
    sample_interval_usec: Sampling interval in microseconds
    skip_idle: Whether to skip idle threads
    sort_by: Sort key ('tottime', 'nsamples', 'cumtime', 'sample_pct', 'cumul_pct')
    limit: Maximum number of functions to display
    pid: Process ID being profiled
    display: DisplayInterface implementation (None means curses will be used)
    mode: Profiling mode ('cpu', 'gil', etc.) - affects what stats are shown
    opcodes: Whether to show opcode panel (requires --opcodes flag)
    async_aware: Async tracing mode - None (sync only), "all" or "running"
c� �[]]]Q5!)r,)�total_rec_callsr-r.r/r1r2r3r4�-LiveStatsCollector.__init__.<locals>.<lambda>�s
��D���Q�Or2rArBrCrDrErFc�8�[O[2!r=r>r1r2r3r4rp�s��K�<S�<S�TW�<Xr2�ALL)<r7r8rR�sample_interval_usecr
�sample_interval_secrerfrg�
total_samples�
start_time�stdscrri�runningrhrjrl�_get_async_frame_iterator�_get_sync_frame_iterator�_get_frame_iterator�
_saved_stdout�
_saved_stderr�_devnull�_last_display_update�max_sample_rate�successful_samples�failed_samplesr�display_update_interval_sec�thread_status_countsrTrU�show_opcodes�selected_row�
scroll_offset�paused�	show_help�filter_pattern�filter_input_mode�filter_input_buffer�finished�finish_timestamp�finish_wall_time�
thread_ids�	view_mode�current_thread_index�per_thread_data�_get_common_path_prefixes�_path_prefixes�
header_widget�table_widget�
footer_widget�help_widget�opcode_panel�	_colorize�can_colorize�
_can_colorize�_trend_tracker�set�_seen_locations)
rGrsrerfrgrhrirjrkrls
&&$$$$$$$$r3�__init__�LiveStatsCollector.__init__ms���6"�-�-�O�
���%9�!� �#:�:�	
� �#�����
������������������	�&��EP�4�#A�#A�VZ�Vs�Vs�� �!���!�����
�$(��!� ���"#������+F��(�
�q��a��Q��q��Q��Q�
%
��!�!"���(�3�3�4X�Y���#��������������"���!&���#%�� ���
� $��� $���������
�	
�!� "���#�<�<�>���"��� ���!������ ���'�3�3�5���#���"�u��r2c��UO%c<UOd.UOe]!UOUO*
!UO%c'[O2UO*
!]!)z+Get the elapsed time, frozen when finished.)r�r�rv�time�perf_counterrLs&r3�elapsed_time�LiveStatsCollector.elapsed_time�s_���=�=�=�T�2�2�>����&���(�(�4�?�?�:�:�8<����t� � �"�T�_�_�4�N�Q�Nr2c���UO%cDUOd6[OQ[OUO22![OQ2!)z7Get the current time for display, frozen when finished.z%H:%M:%S)r�r�r��strftime�	localtimerLs&r3�current_time_display�'LiveStatsCollector.current_time_display�sG���=�=�=�T�2�2�>��=�=��T�^�^�D�<Q�<Q�-R�S�S��}�}�Z�(�(r2c�|�VO7c[UQ5UOU$UOU*!)z)Get or create ThreadData for a thread ID.�rQ)r�r)�rGrQs&&r3�_get_or_create_thread_data�-LiveStatsCollector._get_or_create_thread_data�s4���0�0�0�.8�9�.M�D� � ��+��#�#�I�.�.r2c���UOQ6Xc]UO[UO26c9UOUO*oUOOU2!P!)z@Get ThreadData for currently selected thread in PER_THREAD mode.�
PER_THREAD)r�r��lenr�r��getr�s& r3�_get_current_thread_data�+LiveStatsCollector._get_current_thread_data�sR���>�>�\�)�d�.G�.G�#�d�o�o�J^�.^�����(A�(A�B�I��'�'�+�+�I�6�6�r2c��UOQ6Xc
UO!UO2oU%c
UO!-!)zAGet result dict for current view mode (aggregated or per-thread).rr)r�rRr�)rG�thread_datas& r3�_get_current_result_source�-LiveStatsCollector._get_current_result_source�s9���>�>�U�"��;�;���3�3�5��%0�{�!�!�8�b�8r2c��,o[OoU%cN[OO[OO	U22oUOU2[OQ2oU%cUOU2[OQ2oU%cUOU2[O2FDoUOU2J	[O2oU%cUOU2[[U22oUOQP	Q5U!)z2Get common path prefixes to strip from file paths.�stdlib�
platstdlibc��[U2!r=)r���xs&r3r4�>LiveStatsCollector._get_common_path_prefixes.<locals>.<lambda> s��C��Fr2��key�reverse)�os�__file__�path�dirname�abspath�append�	sysconfig�get_path�site�getsitepackages�getusersitepackages�listr��sort)rG�prefixes�os_module_file�
stdlib_dir�stdlib_path�platstdlib_path�	site_path�	user_sites&       r3r��,LiveStatsCollector._get_common_path_prefixes�s���������������������)H�I�J��O�O�J�'� �(�(��2����O�O�K�(�$�,�,�\�:����O�O�O�,��-�-�/�I��O�O�I�&�0��,�,�.�	���O�O�I�&���H�
�&���
�
�*�D�
�9��r2c��UOFDJoUOU2%fJU[U2PO[O
2oUt!	U!)z1Simplify a file path by removing common prefixes.)r��
startswithr��lstripr��sep)rG�filepath�prefix_path�relatives&&  r3�
simplify_path� LiveStatsCollector.simplify_path$sR�� �.�.�K��"�"�;�/�/�#�C��$4�$6�7�>�>�r�v�v�F����	/��r2c���U%fP!UdUOU2LPoUOO2SFD�o[UO2oUO
VTO1oV`O7fJBUOOU2UOU*Q99*]*
tt$U%fJ�UOU*Q99*]*
tt$J�	U]*o[UO2oUO
V�O1o	UOU	*Q99*]*
tt$U%c'UOU	*Q99*]*
tt$[UQP2o
U
dYUOU	*U
99*]*
tt$U%c)UOU	*U
99*]*
tt$P!P!P!)z�Process a single thread's frame stack.

Args:
    frames: List of frame information
    thread_id: Thread ID for per-thread tracking (optional)
r.r-�opcode)r�r��clearr�location�filename�funcname�addrR�getattrrU)rG�framesrQr��frame�linenor��	top_frame�
top_lineno�top_locationr�s&&&        r3�process_frames�!LiveStatsCollector.process_frames0s�����EN�DY�d�5�5�i�@�_c�����"�"�$��E�#�E�N�N�3�F�������?�H��3�3�3��$�$�(�(��2����H�%�&8�9�Q�>�9��;��&�&�x�0�1C�D��I�D���1�I�	�#�I�$6�$6�7�
�!�*�*�J�8J�8J�K�����L�!�.�1�Q�6�1�����|�,�^�<��A�<���H�d�3�������l�+�F�3�q�8�3���(�(��6�v�>�!�C�>��r2c�<�UOVOQ5!)zIterator for sync frames.)re)�_iter_all_framesre)rG�stack_framess&&r3rz�+LiveStatsCollector._get_sync_frame_iteratorXs���$�$�\�^�^�$�L�Lr2c#�T �UOU2FDvq#oV#1w�	J	P!3h)z?Iterator for async frames, yielding (frames, thread_id) tuples.)�_iter_async_frames)rGr�r�rQ�task_ids&&   r3ry�,LiveStatsCollector._get_async_frame_iterator\s)���*.�*A�*A�,�*O�&�F�w��#�#�+P�s�&(c�l�U9O]*
tmU9O]*
tmP!)�)r�rurLs&r3�collect_failed_sample�(LiveStatsCollector.collect_failed_sampleas$�����q� �����a��r2c�$�UOe,[O2UmUOUmP
oUO%Cf�UOU2vqEoUO
2FD$vqxUOU99*U*
tt$J&	U%cP	oUO
2FCDHvq�UOU	2oU9OU
OQ]2*
tm	U9OU
OQ]2*
tmU9OU
OQ]2*
tmU9OU
OQ]2*
tm
U9OU
OQ]2*
tmU9OU
OQ]2*
tmU
OQ]2%fCJ(U9O U
Q**
tmCJK	P
oUO#U2FD�vq�U
%fJUO%V�Q5P	oU	d,V�O&7cUO&O)U	2U	eJXUOU	2oU9O*]*
tmJ�	U%cU9O ]*
tmU9O,]*
tmU9O.]*
tmUO0dUO32UO0dsUO4%f_[O2oUOd"V�O*
UO66�cUO92V�mP!P!P!P!)	z#Collect and display profiling data.rArBrCrDrErF�
gc_samplesr�)rvr�r�rrl�_collect_thread_status_stats�itemsr�r�rAr�rBrCrDrErFrTr{r�r�r�rSr�ruri�
_handle_inputr�r��_update_display)rGr��timestamp_us�has_gc_frame�
status_counts�
sample_has_gc�per_thread_statsr��countrQ�statsr��frames_processedr��current_times&&&            r3�collect�LiveStatsCollector.collectes����?�?�"�"�/�/�1�D�O�(,���D�%�������=A�=^�=^�_k�=l�:�M�*:�+�1�1�3�
���)�)�#�.�%�7�.�4��#��$4�$:�$:�$<�$<� �	�"�=�=�i�H���#�#�u�y�y��A�'>�>�#��"�"�e�i�i��!�&<�<�"��)�)�U�Y�Y���-J�J�)��#�#�u�y�y��A�'>�>�#��)�)�U�Y�Y���-J�J�)��!�!�U�Y�Y�w��%:�:�!��9�9�\�1�-�-��0�0�E�,�4G�G�0�0�%=�!��!%�!9�!9�,�!G��F��������<�#���$��/�/�)I����&�&�y�1��$�"�=�=�i�H���(�(�A�-�(�"H���!�!�Q�&�!�	
���1�$�����a����<�<�#���� ��<�<�#�D�K�K�K��,�,�.�L��)�)�1� �#<�#<�<��3�3�4��$�$�&�,8�)�	4�	-8�#r2c���UOoUO2oUO%c[L]o[	]U[
*
U*
[*
[*
2oUPUoV#1!)z#Prepare data for display rendering.)r��build_stats_listr�r�maxrrr)rG�height�elapsed�
stats_list�extra_header_lines�max_stats_liness&&    r3�_prepare_display_data�(LiveStatsCollector._prepare_display_data�s~���#�#���*�*�,�
�
,0�=�=�=�'�a�	��
���
� �
!��
��	
�
�� � 0��1�
��"�"r2c�v�UOe�UOe[UP	Q5Um[UOV2Um[UOV2Um[UOV2Um[UOU2Um
[UOV2UmP!P!)z+Initialize widgets with display and colors.)�enabled)
r�r�r'r"rir#r�r$r�r%r�r&r�)rG�colorss&&r3�_initialize_widgets�&LiveStatsCollector._initialize_widgets�s������%��"�"�*�&2�6�4�&H��#�!-�d�l�l�F�!I�D�� +�D�L�L�&� G�D��!-�d�l�l�F�!I�D��)�$�,�,��?�D�� +�D�L�L�&� G�D��&r2c�>�]oUOU2UOOVbV4Q5oUOOVbVQ5oUO%c UO
OVbVQ5oP!P![OcP!h9h)z*Render all display sections to the screen.)rr)rr)rr��renderr�r�r��curses�error)rGr�widthrrr�lines&&&&&& r3�_render_display_sections�+LiveStatsCollector._render_display_sections�s�����	��$�$�V�,��%�%�,�,��W�-��D�
�$�$�+�+��F�,��D�
� � � ��(�(�/�/���0���!��
�|�|�	��	�s�AB�"B�B�B�Bc�\�UOO2UOO2vqU[6fU[6c.UOV2UOO
2P!UO2oUOU2UO%c:UOO]V!Q5UOO
2P!UOU2vqEUOVVEU2UOOU]*
U2UO%c$UOO!U]*
U2UOO#2UOO
2P![$cP!h9h)z&Update the display with current stats.)r)rir��get_dimensionsrr�_show_terminal_too_small�refresh�
_setup_colorsrr�r�r!rr&r�r��render_filter_input_prompt�redraw�	Exception)rGrr$rrrs&     r3r�"LiveStatsCollector._update_display�s[��+	��L�L��� � �L�L�7�7�9�M�F��)�)�V�6I�-I��-�-�f�<����$�$�&���'�'�)�F��$�$�V�,��~�~�~�� � �'�'��5�'�@����$�$�&��#'�"<�"<�V�"D��G�
�)�)��w�F�
�

���%�%�f�q�j�%�8��%�%�%��"�"�=�=��Q�J���

�L�L���!��L�L� � �"���	��	�s>�AF�
F�+F�<2F�/7F�(AF�AF�	F+�&F+�*F+c��,QNoUOUO2oU%c'V#]*
[U2**UmP!V#]*[U2**UmP![cQSmP!h9h)z�Cycle through different sort modes in column order.

Args:
    reverse: If True, cycle backwards (right to left), otherwise forward (left to right)
�nsamples)r2�
sample_pct�tottime�	cumul_pct�cumtime)�indexrfr��
ValueError)rGr��
sort_modes�current_idxs&&  r3�_cycle_sort�LiveStatsCollector._cycle_sortsi��
�
�	&�$�*�*�4�<�<�8�K��)��?�c�*�o�*M�N���)��?�c�*�o�*M�N�����	&�%�D�L�	&�s"�"A6�$A6�$A6�6	B�B�Bc�F
�UOOQ2oUOOQ2oUOOQ2oUOOQ2oUOO2%CcKUO%Cc8[O
[29^tt^2[OP	Q5OoPoUOO[UOU2UOO[UOU2UOO[UO U2UOO["UO$UO&2UOO[(UO*U2UOO[,UO.U2UOO[0UO2U2UOO[4UO6U2UOO[8UO:U2UOO[<UO>UO@2]o]oUOOVuOBU2UOOV�ODU2QUOOG["2U*QUOOG[(2U*QUOOG[,2U*Q	UOOG[02U*Q
UOOG[42U*QUOOG[82U*QUOOG[<2U*Q
UOOG["2U*QUOOG[2QUOOG[2QUOOG[2QUOOGU2U*QUOOGU2U*QU-ttPPP2!QV!*QUQUQ	UQ
UQUQV!*U*Q
V!*QUQUQUQUQUQU-!)%fhKG9h)z/Set up color pairs and return color attributes.�A_BOLD�	A_REVERSE�A_UNDERLINE�A_NORMAL)�force_color�header�cyan�yellow�green�magenta�red�
sorted_header�
normal_header�
color_samples�
color_file�
color_func�trend_up�
trend_down�trend_stable)$ri�get_attr�
has_colorsr��
contextlib�suppressr/r��	get_theme�
live_profiler�init_color_pairr�
samples_fgr�file_fgr�func_fgr�normal_header_fg�normal_header_bgr�pid_fgr�time_fgr�	uptime_fgr�interval_fgr�
off_gil_fgr �sorted_header_fg�sorted_header_bg�trend_up_fg�
trend_down_fg�get_color_pair)	rGr>r?r@rA�theme�
default_bg�
TREND_UP_PAIR�TREND_DOWN_PAIRs	&        r3r,� LiveStatsCollector._setup_colors,s������&�&�x�0���L�L�)�)�+�6�	��l�l�+�+�M�:���<�<�(�(��4���<�<�"�"�$�$��);�);�);��$�$�Y�/�/�!�+�+��=�K�K���
����,�,�-?��AQ�AQ�S]�^����,�,�_�e�m�m�Z�X����,�,�_�e�m�m�Z�X����,�,�(��*�*��*�*�����,�,�_�e�l�l�J�W����,�,�->��
�
�z�Z����,�,�-=�u���PZ�[����,�,�-?��AR�AR�T^�_����,�,�^�U�=M�=M�z�Z����,�,�,��*�*��*�*��!#�
�"$�����,�,�]�<M�<M�z�Z����,�,�_�>Q�>Q�S]�^��d�l�l�9�9�:N�O�RX�X��D�L�L�7�7��H�6�Q��d�l�l�9�9�:K�L�v�U��T�\�\�8�8�9I�J�V�S��t�|�|�:�:�;M�N�QW�W��4�<�<�6�6�~�F��O�#�T�\�\�%@�%@�AY�%Z�]c�%c�#�T�\�\�%@�%@�AU�%V�Y_�%_�#�T�\�\�%@�%@�AS�%T� �$�,�,�"=�"=�o�"N� �$�,�,�"=�"=�o�"N����� ;� ;�M� J�V� S� �$�,�,�"=�"=�o�"N�QW�"W�"�H��?0�/�d
�i�(��F��f��V��v��6��Y�/�+�=��Y�/��X��(��(����&��H�
�	
�c0�/�s�P
T�T 	�T 	c���,oUO2oUO2FCDyvq4UO%ckUvqVoUOO2oUO2o	UO2o
V�79%fV�79%f
V�QU
07oU%fJ�UO	Q]2oUO	Q]2o
V�O
*oV�O
*oUO]6�cV�O*]d*L]oUO]6�cV�O*]d*L]o-oUOd'UOOUQUQUQUQUQU-2oUOQ	UQUQU
Q
UQUQUQUQU-2CJ|	UOQ6XcUOQ
P	Q5U!UOQ6XcUOQP	Q5U!UOQ6XcUOQP	Q5U!UOQ6XcUOQP	Q5U!UOQ6XcUOQP	Q5U!)z#Build and sort the statistics list.�:r-r.r2r4r6r3r5�func�
total_time�cumulative_time�trendsc��UQ*!)r-r1r�s&r3r4�5LiveStatsCollector.build_stats_list.<locals>.<lambda>�s	��!�N�*;r2r�c��UQ*!)ror1r�s&r3r4rs����!�L�/r2c��UQ*!)rpr1r�s&r3r4rs�s
��!�,=�*>r2c��UQ*!)r3r1r�s&r3r4rs�rur2c��UQ*!)r5r1r�s&r3r4rs�s��!�K�.r2)r�rr��lowerr�rtr�r��update_metricsr�rfr�)rGr�
result_sourcern�call_countsr�r�r��
pattern_lower�filename_lower�funcname_lower�matchedr-r.rorpr3r5rqs&                  r3r�#LiveStatsCollector.build_stats_listvs����
��7�7�9�
�!.�!4�!4�!6�!6��D��"�"�"�-1�*��(� $� 3� 3� 9� 9� ;�
�!)���!1��!)���!1��"�3�M�M�$�6�M�M�$�*:�!�N�;K�(L�L��
��&�?�?�>�1�=�L�*���/A�1�E��%�(@�(@�@�J�.�1I�1I�I�O�
LP�Kb�Kb�ef�Kf�,�)@�)@�@�3�F�lm�J�NR�Ne�Ne�hi�Ni�)�,C�,C�C�c�I�op�I��F��"�"�.��,�,�;�;��"�L�!�:�!�?�$�j�#�Y��	��
����D�"�L�&�(8� �*�%�� �*����f�	�
�W"7�r�<�<�:�%��O�O� ;�T�O�J����\�\�Y�
&��O�O� 9�4�O�H����\�\�Y�
&��O�O� >��O�M����\�\�\�
)��O�O� 9�4�O�H����\�\�[�
(��O�O� 8�$�O�G��r2c�0�UOO2UOO2UOO2UOO2QUm]Um]Um]Um]Um	]Um
Q]Q]Q]Q]Q]Q]-Um]UmUOdUOO2P
UmPUmPUm["O$2UmUO&UmP!)zReset all collected statistics.rrrArBrCrDrErF)rRr�rUr�r�r�r�rur�r�r�r�rTr�r�r�r�r�r�rvrrLs&r3�reset_stats�LiveStatsCollector.reset_stats�s��������������!����"�"�$����������$%��!����"#������ ����q��a��Q��q��Q��Q�
%
��!�!"������*����%�%�'���
� $��� $����+�+�-���$(�O�O��!r2c��P	Um[O2Um[O2UmUO
dUO
2P!P!)z'Mark the profiling session as finished.)r�r�r�r�r�rirrLs&r3�
mark_finished� LiveStatsCollector.mark_finished�sC����
� $� 1� 1� 3��� $�	�	�����<�<�#�� � �"�$r2c��UO%c-U%c#UOdUO2P!P!P!P!)z4Update display after input when program is finished.)r�rir)rG�	had_inputs&&r3�_handle_finished_input_update�0LiveStatsCollector._handle_finished_input_update�s,���=�=�=�Y�4�<�<�+C�� � �"�,D�Y�=r2c��UO2oUO%c�UOO2vq#UO%c[L]o[]U[*
U*
[*
[*
2oUPUo[]U]*
]*
]*
2oLUOo[U2oVU1!)z<Calculate visible rows and stats list for opcode navigation.)rrir)r�rrrrrrgr�)rGrr�_�extra_header�	max_stats�visible_rows�
total_rowss&       r3�_get_visible_rows_info�)LiveStatsCollector._get_visible_rows_info�s����*�*�,�
��<�<�<����3�3�5�I�F�:>�-�-�-�6�Q�L��A�v��4�|�C�l�R�Ub�b�c�I�#�J�Y�/�J��q�&�1�*�q�.�2�"5�6�L��:�:�L���_�
���3�3r2c�l�UO%fP!UO2vqoU]6XcP![]V2*
2oUOUO*oVS]*
6c]UOU]*
6cU9O]*
tmL*UOU6cU9O]*
tm[UOU2Um[U]*
V0O*
]*
2o[UO[]U22UmP!)z2Move selection down in opcode mode with scrolling.)r�r�rr�r��min)rGrr�r��
max_scroll�abs_pos�max_selecteds&      r3�_move_selection_down�'LiveStatsCollector._move_selection_down�s���� � � ��/3�/J�/J�/L�,�
�*���?����J�5�6�
��$�$�t�'8�'8�8���!�^�#�� � �<�!�#3�3��!�!�Q�&�!��#�#�j�0��"�"�a�'�"�!��!3�!3�Z�@����<�!�+�Z�:L�:L�-L�q�-P�Q���� 1� 1�3�q�,�3G�H��r2c�
�UO%fP!UO]6�cU9O]*tmL*UO]6�cU9O]*tmUO2vqoU]6�c[	]V2*
2o[UOU2Um[U]*
V0O*
]*
2o[UO[	]U22UmP!P!)z0Move selection up in opcode mode with scrolling.)r�r�r�r�rr�)rGrr�r�r�r�s&     r3�_move_selection_up�%LiveStatsCollector._move_selection_ups���� � � �����q� �����"��
�
�
�!�
#����!�#��04�/J�/J�/L�,�
�*���>��Q�
� 9�:�J�!$�T�%7�%7��!D�D���|�a�/��>P�>P�1P�ST�1T�U�L� #�D�$5�$5�s�1�l�7K� L�D��	r2c��[UO2]6�cpUOQ6Xc+QUm[UO2]*
UmP!UO]*
[UO2*UmP!P!)zQNavigate to previous thread in PER_THREAD mode, or switch from ALL to PER_THREAD.rrr��r�r�r�r�rLs&r3�_navigate_to_previous_thread�/LiveStatsCollector._navigate_to_previous_thread+sg���t����!�#��~�~��&�!-���,/����,@�1�,D��)��-�-��1�����(�-)��)�$r2c���[UO2]6�cVUOQ6XcQUm]UmP!UO]*[UO2*UmP!P!)zMNavigate to next thread in PER_THREAD mode, or switch from ALL to PER_THREAD.rrr�r�rLs&r3�_navigate_to_next_thread�+LiveStatsCollector._navigate_to_next_thread6sY���t����!�#��~�~��&�!-���,-��)��-�-��1�����(�-)��)�$r2c
��UOOQ2oQoQ[Q[0oQUQU0oQoU]6�CcUUOO	U]*]*
[]U[
U2*
]*2UPU]*
U2UOO	U]*]*
[]U[
U2*
]*2UPU]*
2UOO	U]*[]U[
U2*
]*2UPU]*
2UOO	U]*]*[]U[
U2*
]*2UPU]*
2P!U]6�c+UOO	]]UPU]*
U2P!P!)z-Display a message when terminal is too small.r>zTerminal too small!zNeed: r�zHave: z
Please resize)rirQrr�add_strrr�)rGrr$r>�msg1�msg2�msg3�msg4s&&&     r3r*�+LiveStatsCollector._show_terminal_too_smallAs������&�&�x�0��$���*�+�1�-@�,A�B����w�a��x�(�����Q�;��L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!��	
�
�L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!�
�

�L�L� � ��!���A���D�	�)�a�/�0��[�u�q�y�!�
�

�L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!�
�
�q�[��L�L� � ��A�t�K�e�a�i�'8�&�A�r2c
�z�UOOQ2oUOOQ2oUOO2QoQ[Q[0oQUQU0oQoQo	U]6�Cc�UOOU]*]*
[
]U[U2*
]*2UPU]*
U2UOOU]*]*
[
]U[U2*
]*2UPU]*
2UOOU]*[
]U[U2*
]*2UPU]*
2UOOU]*]*[
]U[U2*
]*2UPU]*
2UOOU]*]*[
]U[U	2*
]*2U	PU]*
U2L/U]6�c)UOO]]UPU]*
U2UOO2UOOP
2UOO2UOOP	2P!)	zRShow terminal size warning during initialization and wait for user acknowledgment.r>�A_DIMzWARNING: Terminal too small!z
Required: r�z
Current:  z/Please resize your terminal for best experiencezPress any key to continue...)rirQr�rrr�rr�r+�set_nodelay�	get_input)
rGrr$r>r�r�r�r�r��msg5s
&&&       r3�$_show_terminal_size_warning_and_wait�7LiveStatsCollector._show_terminal_size_warning_and_waitcsC�����&�&�x�0�����%�%�g�.��������-���.�/�q�1D�0E�F���E�7�!�F�8�,��@��-���Q�;��L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!��	
�
�L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!�
�

�L�L� � ��!���A���D�	�)�a�/�0��[�u�q�y�!�
�

�L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!�
�

�L�L� � ��!��a���A���D�	�)�a�/�0��[�u�q�y�!��	
��q�[��L�L� � ��A�t�K�e�a�i�'8�&�A���������� � ��'������ ���� � ��&r2c��
�UOOP	2UOO2oUO%c�U]6XcP
UmPUmL�U]
6XfU]
6Xc5UO%c
UOLPUmP
UmPUmLeU]6XfUQ6Xc(UO%cUOPPUmL0U] 6�c*U]6c#U9O[
U2*
tmUOUP6g2P!U[Q26Xf!U[Q26XfU[Q26XcUO%(Um	P!UO%cUP6wc
P
Um	P!U[Q26XfU[Q26Xc
P
Um
CL�U[Q26XcUOP
Q5CL�U[Q	26XcUOP	Q5CLaU[Q
26XfU[Q26XcUO%(UmCL)U[Q26XfU[Q
26Xc%UO%fUO2CL�U[Q26XfU[Q26Xc%[QUO Q*
2UmCL�U[Q26XfU[Q26Xc%[#QUO Q*2UmCL]U[Q26XfU[Q26XcUO
%cPUmCL"U[Q26Xc%P	UmUO
9%fPUmCL�U[Q26XfU[Q26XcEUO$Q6Xc+['UO(2]6�cQUm]UmCL�QUmCL�U[Q26XfU[Q26Xc+UO,dUO,O/2CL@U[Q26XfU[Q26XcUO12CLU[Q26XfU[Q 26XcUO32L�U[4O66Xc5UO8%cUO32L�UO;2L�U[4O<6Xc5UO8%cUO12L\UO?2LKU[4O@6XcUO;2L%U[4OB6XcUO?2UOUP6g2P!)!z%Handle keyboard input (non-blocking).��h�H�?�q�Q�s)r��S�p�P�r�R�+�=g�������?�-r�g�?�c�C�/�t�Trrr�r��X�j�J�k�K)"rir�r�r�r�r��chrr��ordr�rxr;r�r�r�rr�r�r�r�r�r�r��toggler�r�r"�KEY_UPr�r��KEY_DOWNr��KEY_LEFT�	KEY_RIGHT)rG�chs& r3r� LiveStatsCollector._handle_input�s
����� � ��&�
�\�\�
#�
#�
%���!�!�!��R�x�).��&�+-��(��r��R�2�X��/�/�/��,�,���#�
*/��&�+-��(��s��b�C�i��+�+�+�/3�/G�/G���/L�D�,���r��b�3�h��(�(�C��G�3�(�
�.�.�r�R�x�8����S��>�R�3�s�8�^�r�S��X�~�!%���/�D�N���>�>�>�b�B�h�"�D�N����S��>�R�3�s�8�^� �D�L�
�3�s�8�^����U��+�
�3�s�8�^����T��*�
�3�s�8�^�r�S��X�~�"�k�k�/�D�K�
�3�s�8�^�r�S��X�~��=�=�=�� � �"��
�3�s�8�^�r�S��X�~�/2��d�6�6��=�0�D�,��3�s�8�^�r�S��X�~�/2��T�5�5��<�0�D�,��3�s�8�^�r�S��X�~��"�"�"�&*��#��
�3�s�8�^�%)�D�"�'+�':�':�'@�'@�b�D�$�
�3�s�8�^�r�S��X�~��~�~��&��t���'�!�+�%1�D�N�01�D�-��!&���
�3�s�8�^�r�S��X�~��"�"�.��#�#�*�*�,��
�3�s�8�^�r�S��X�~��%�%�'�
�3�s�8�^�r�S��X�~��#�#�%�
�6�=�=�
 �� � � ��'�'�)��1�1�3�
�6�?�?�
"�� � � ��)�)�+��-�-�/�
�6�?�?�
"��-�-�/�
�6�#�#�
#��)�)�+�	
�*�*�2��8�4r2c��Vm[U2UmUOO2vq#U[6fU[
6cUO
V#2[O]2UOP	2UOP
2UOP
2UOP	2[O2%c+[O2[O2[ O"Um[ O&Um[+[,O.Q2UmUO0[ mUO0[ mUOO52UOO72P![2c-SO$[ mSO([ mgh9h)z5Initialize curses display and suppress stdout/stderr.�w)rwr!rir)rrr�r"�curs_set�nodelay�scrollok�idlok�leaveokrR�start_color�use_default_colors�sys�stdoutr|�stderrr}�openr��devnullr~r/r�r+)rGrwrr$s&&  r3�init_curses�LiveStatsCollector.init_cursessB����$�V�,������3�3�5�
���%�%��2E�)E��5�5�f�D���������t����������U�����t���������� ��%�%�'�!�Z�Z��� �Z�Z���	� ����S�1�D�M����C�J����C�J�	
��������������	��+�+�C�J��+�+�C�J��		�s�%A	F$�$	G�.-Gc	��UOdUO[mPUmUOdUO[mPUmUO
dM[O[29^tt^2UO
O2PPP2PUmUOdoUOd_[O[29^tt^2[O]2UOOP
2PPP2P!P!P!)%fhK�9hSO
db[O[29^tt^2SO
O2PPP2L)%fhL9hPSmhh9h)%fhP!9h)z2Clean up curses display and restore stdout/stderr.)r|r�r�r}r�r~rSrTr/�closerirwr"r�r�rLs&r3�cleanup_curses�!LiveStatsCollector.cleanup_curses<s3��	%��!�!�-�!�/�/��
�%)��"��!�!�-�!�/�/��
�%)��"��}�}�(��(�(��3�3��M�M�'�'�)�4� $��
��<�<�#����(?��$�$�Y�/�/�����"����(�(��/�0�/�)@�#�	4�3���}�}�(��(�(��3�3��M�M�'�'�)�4�3�3�3�� $��
�)��0�/�/�s]�
E�)E�E�D/�/2F6�/D?	�8D?	�F3�"F3�3F	�	F3�F'
� F'
�"F3�6G	�?G	c��[Q2g)z%Export is not supported in live mode.z_Export to file is not supported in live mode. Use the live TUI to view statistics in real-time.)�NotImplementedError)rGr�s&&r3�export�LiveStatsCollector.exportSs��!�
@�
�	
r2)2r�r~r{rr�r}r|r�r�rlr�rir�r�r�r�r�r�r�r�r�rTr�r�rgr�rjr�rUr�r�rhrRrxrtrsr�r�r�r�rerfrvrwr�r�r�r�rur�r=)F),rZr[r\r]r^rrr��propertyr�r�r�r�r�r�r�r�rzryr�rrrr&rr;r,rr�r�r�r�r�r�r�r�r*r�rr�r�r�r`rarbs@r3rdrdjsE����I�k%��	k%�
 �k%�$�
k%�
�k%��k%��k%��k%��k%�Z�O��O��)��)�/��9�#�J
�&D�PM�$�
 �A9�F#�,H��8-�^&�,H
�TI�V4�>#�#�
4�I�8M�$	)�	)� B�D1'�f{5�z'�R0�.
�
r2rd)9r^r7rSr"�dataclassesrrr�r�r�r�r�r��	collectorrr�	constantsrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr rir!�widgetsr"r#r$r%r&�
trend_trackerr'r)rdr1r2r3�<module>r�s���C���
�(�	��
����1�	�	�	�������,#�U�U�'��2
�2
��2
�jn
��n
r2

Youez - 2016 - github.com/yon3zu
LinuXploit