403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.84
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__/widgets.cpython-315.pyc
R
>lqj%�c�B�Qs]PHs]PHs]QHGsGs]QHGsGsG	s	G
s
GsGsG
s
GsGsGsGsGsGsGsGsGs]QHGsGsGsGsGsGsGs]QHxGsG s QQ\2s!QQ\!2s"Q	Q
\!2s#QQ\!2s$Q
Q\!2s%QQ\!2s&QQ\!2s'P!)z3Widget classes for the live profiling collector UI.)�ABC�abstractmethod)�TOP_FUNCTIONS_DISPLAY_COUNT�MIN_FUNC_NAME_WIDTH�MAX_FUNC_NAME_WIDTH�WIDTH_THRESHOLD_SAMPLE_PCT�WIDTH_THRESHOLD_TOTTIME�WIDTH_THRESHOLD_CUMUL_PCT�WIDTH_THRESHOLD_CUMTIME�MICROSECONDS_PER_SECOND�DISPLAY_UPDATE_INTERVAL_SEC�
MIN_BAR_WIDTH�MAX_SAMPLE_RATE_BAR_WIDTH�MAX_EFFICIENCY_BAR_WIDTH�MIN_SAMPLE_RATE_FOR_SCALING�FOOTER_LINES�FINISHED_BANNER_EXTRA_LINES�OPCODE_PANEL_HEIGHT)�THREAD_STATUS_HAS_GIL�THREAD_STATUS_ON_CPU�THREAD_STATUS_UNKNOWN�THREAD_STATUS_GIL_REQUESTED�PROFILING_MODE_CPU�PROFILING_MODE_GIL�PROFILING_MODE_WALL)�get_opcode_info�
format_opcodec�F`�\sQs]%snQsQs\Q2sQQksQs	Us
P!)�WidgetzBase class for UI widgets.c� �VmV mP!)zs
Initialize widget.

Args:
    display: DisplayInterface implementation
    colors: Dictionary of color attributes
)�display�colors)�selfrr s&&&�>C:\Python315\\Lib\profiling\sampling\live_collector\widgets.py�__init__�Widget.__init__(s������c��P!)z�
Render the widget starting at the given line.

Args:
    line: Starting line number
    width: Available width
    **kwargs: Additional rendering parameters

Returns:
    Next available line number after rendering
��r!�line�width�kwargss&&&,r"�render�
Widget.render3s��	
r%c�@�UOOVV42P!)z6Add a string to the display at the specified position.)r�add_str)r!r)�col�text�attrs&&&&&r"r/�Widget.add_strBs�������T��3r%)r r)�)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r#rr,r/�__static_attributes__�__classdictcell__��
__classdict__s@r"rr%s+����$�	��
��
�4�4r%rc�6`�\sQs]GsnQsQsQQksQsUsP!)�ProgressBarWidgetzReusable progress bar widget.c��[Q2g)z>Render is not used for progress bars - use render_bar instead.zUse render_bar method instead)�NotImplementedErrorr(s&&&,r"r,�ProgressBarWidget.renderJs��!�"A�B�Br%c��[V32o[U[U]2*Q2o[Vv*2oQo	[U2FDo
V�6cV�*
o	JV�*
o	J	U	Q*
o	U	[	U	21!)aM
Render a progress bar and return the bar string and its length.

Args:
    filled: Current filled amount
    total: Total amount (max value)
    max_width: Maximum width for the bar
    fill_char: Character to use for filled portion
    empty_char: Character to use for empty portion

Returns:
    Tuple of (bar_string, bar_length)
��?�[�])�min�max�int�range�len)r!�filled�total�	max_width�	fill_char�
empty_char�	bar_width�
normalized�bar_fill�bar�is&&&&&&     r"�
render_bar�ProgressBarWidget.render_barNst�� �	�-�	���#�e�Q�-�/��5�
��z�-�.�����y�!�A��|�� ���!��	"�
	�s�
���C��H�}�r%r')�█�░)	r5r6r7r8r9r,rVr:r;r<s@r"r?r?Gs����'�C��r%r?c�~``�\sQs]lsnQsU1QksQsQsQsQs	Qs
QsQQ	ksQ
s
QsQsQ
sQsUsU9s!)�HeaderWidgetz4Widget for rendering the header section (lines 0-8).c�T:�[RU_V2V0m[V2UmP!)z�
Initialize header widget.

Args:
    display: DisplayInterface implementation
    colors: Dictionary of color attributes
    collector: Reference to LiveStatsCollector for accessing stats
)�superr#�	collectorr?�progress_bar�r!rr r^�	__class__s&&&&�r"r#�HeaderWidget.__init__os$���	����)�"��-�g�>��r%c�,�UQ*oUOVU2oUOVU2oUOV2oUOV2oUO	VUOQ,22oUO
VUOQ,22oUOO%cUOV2oUOOQ2oQU]*
*oUOU]UPU]*
U2U]*
oU!)z�
Render the complete header section.

Args:
    line: Starting line number
    width: Available width
    kwargs: Must contain 'elapsed' key

Returns:
    Next available line number
�elapsed�
stats_list�A_DIM�─)
�draw_header_info�draw_sample_stats�draw_efficiency_bar�draw_thread_status�draw_function_stats�get�draw_top_functionsr^�finished�draw_finished_bannerr�get_attrr/)r!r)r*r+rdrf�	separators&&&,   r"r,�HeaderWidget.render|s����#���$�$�T�'�:���%�%�d�7�;���'�'��4���&�&�t�3���'�'�����L�"�5�
���&�&�����L�"�5�
��
�>�>�"�"�"��,�,�T�9�D����%�%�g�.���U�Q�Y�'�	����T�1�i��%�!�)�4�e�<���	���r%c��[U2oUQ*oUQ*]<*oU]<*oU]6�cUQUQ
QUQ
Q0!UQUQ
Q0!)z%Format elapsed time as uptime string.i�h�02d�m�s)rI)r!rd�
uptime_sec�hours�minutes�secondss&&    r"�
format_uptime�HeaderWidget.format_uptime�sf����\�
��d�"����$��+���r�/���1�9��W�A�g�c�]�!�G�C�=��:�:��Y�a���}�A�.�.r%c��UOOQ2oQoUOU]VTUOQ**2U]*
oUOO
oUO
U2oUOO]6�cQUOO*L]oUOOQ6XcQo	UOQ*o
L�UOO[UOO26c�UOOUOO*o[UOO2oUQUOO]*QUQ	0o	UOQ
*o
LQo	UOQ*o
Q[O1UOOUOQ*1Q[O1Q
[O1V�1Q[O1Q[O1VpOQ*1Q[O1Q[O1V`OQ*1Q[O1Q[O1UOO Q0UOQ
*1Q[O1Q[O1UQ
Q0UOQ*1,o
]oS
FD:vooV�]*
6fJUOVUU2U[U2*
oJ<	U]*!)zFDraw the header information line with PID, uptime, time, and interval.�A_BOLDzTachyon Profiler�cyanrD�ALL�green� (�/�)�magentazPID: � │ zThread: zUptime: zTime: �yellowz
Interval: uµsz	Display: �.1f�Hz)rrqr/r r^�current_time_displayr}�display_update_interval_sec�	view_mode�current_thread_indexrK�
thread_ids�cursesr��pidrf�sample_interval_usec)r!r)r*rdr��title�current_time�uptime�
refresh_hz�thread_name�thread_color�	thread_id�num_threads�header_partsr0r1r2s&&&&             r"rh�HeaderWidget.draw_header_info�s������&�&�x�0��"�����T�1�e�d�k�k�&�.A�%A�B���	���~�~�:�:���#�#�G�,��AE���@j�@j�mn�@n�C�$�.�.�<�<�<�tu�	�
�>�>�#�#�u�,��K��;�;�w�/�L��~�~�2�2�S����)�)�6��!�N�N�5�5��N�N�7�7��	�"�$�.�.�";�";�<��!*��2�d�n�n�.Q�.Q�TU�.U�-V�VW�Xc�Wd�de�f��#�{�{�9�5��#��#�{�{�7�3���f�m�m�$����"�"�#�d�k�k�&�&9�:�
�f�l�l�#�
����'�
�'�
�f�l�l�#�
����'�
�[�[��)�*�
�f�l�l�#�
�v�}�}�%�
�;�;�x�0�1�
�f�l�l�#�
�6�=�=�)��>�>�6�6�7�s�;����I�&�
��f�l�l�#�
�&�-�-�(��3��r�
"�D�K�K��$7�8�)
��.��&�J�D�$��Q�Y�����T��d�3��s�4�y� ��'��a�x�r%c�p�U[6�cU[*Q
Q0!UQ6�cUQ*Q
Q0!UQ
Q0!)z:Format a rate in Hz with appropriate units (Hz, KHz, MHz).r��MHz���KHzr�)r
)r!�rate_hzs&&r"�format_rate_with_units�#HeaderWidget.format_rate_with_units�sL���-�-�� 7�7��<�C�@�@�
��
���o�c�*�#�.�.��c�]�"�%�%r%c�d�U]6�cUOOU*L]oV@OO6�cV@Om]oUOVQ[O
2U]	*
oUOUUUOOQ
UOQ*2U]*
oUOVQUQ
Q0[O2U]*
o[UOO*oU]6�cbU]6�c[[VF*]d*]d2oUOU2oUOU2o	UQ6�cQUQ	U	Q
0o
L$QUQ	U	QUQ
Q
0o
LUOU2o	QU	0o
V%*
[U
2*
]*
oU[6�c�[[U2o[U[ 2o
[VM*Q2o[#V�*2oQo[%U2FDoSUU6cQLQ*
oJ	UQ*
oUOVUUOQ*2U[U2*
oU[U
2*U]*
6c)UOV]*U
[O&2U]*!)z0Draw sample statistics with visual progress bar.z	Samples: z>8r�z total (z>7.1fz/s) g�X@� r�z (100%)r��>4.1f�%)z	 target: rDrErXrYrFr�)r^�
total_samples�max_sample_rater/r�r�r �A_NORMALr
r�rGr�rKrr
rHrrIrJrf)r!r)r*rd�sample_rater0�target_rate�
percentage�current_formatted�target_formatted�
rate_label�available_widthrQ�reference_rate�normalized_raterSrTrUs&&&&              r"ri�HeaderWidget.draw_sample_stats�sh��7>��k�D�N�N�(�(�7�2�q�	�
���7�7�7�-8�N�N�*������T��V�]�]�;��q���������~�~�+�+�B�/��K�K���		
�	�q��������+�e�!4�D�9�6�?�?�	
�	�r�	��
$�d�n�n�&I�&I�I�	�
��?�{�Q���k�7�3�>��D�J� $� ;� ;�K� H��#�:�:�;�G���T�!� �!2� 3�1�5E�4F�g�N�
� �!2� 3�1�5E�4F�b��TY�HZ�Z\�]�
�#�:�:�;�G��$�%5�$6�7�J��+��J��7�!�;���m�+��5��G�I� ��.I�J�N�!�+�">��D�O��?�6�7�H��C��9�%����H��u�%�7��&��3�J�C��L�L��C����W�)=�>��3�s�8�O�C��S��_�$�u�q�y�0����T��7�J����E��a�x�r%c��[]UOO2oUOOU*]d*oUOOU*]d*o]oUOVQ[O2U]*
oQUQ
QUQ
Q0oV&*
[U2*
]*
oU[6�Cc6[[U2o	[UOOU*U	*2o
V�*
oUOVQ[O2U]*
oU
]6�c4UOVQU
*UOQ*2Vj*
oU]6�c4UOVQU*UOQ	*2Vk*
oUOVQ
[O2U]*
oUOV]*U[O2U]*!)z9Draw sample efficiency bar showing success/failure rates.zEfficiency:r�z>5.2fz% good, z% failedrErXr��redrF)rHr^r��successful_samples�failed_samplesr/r�r�rKrrGrrIr�r )r!r)r*rM�success_pct�
failed_pctr0�labelr�rQ�success_fill�failed_fills&&&         r"rj� HeaderWidget.draw_efficiency_bar6s����A�t�~�~�3�3�4���~�~�8�8�5�@�C�G���n�n�3�3�e�;�s�B�
������T�
�v�}�}�=��r�	���K��&�h�z�%�.@��I���+��E�
�2�Q�6���m�+��4�o�F�I����� A� A�E� I�Y�V�W�L�#�2�K��L�L��C����9��1�H�C��a������u�|�3�T�[�[��5I���#���Q�����T���(;�T�[�[��=O�P��"���L�L��C����9��1�H�C��L�L��Q�w��v���?��a�x�r%c�"�U%c+UOVQ[O2U]*
oUOVUQ
U2U]*
oUOVQU0[O2U[	U2]**
oU!)aAdd a percentage stat to the display.

Args:
    line: Line number
    col: Starting column
    value: Percentage value
    label: Label text
    color: Color attribute
    add_separator: Whether to add separator before the stat

Returns:
    Updated column position
r�r�z% )r/r�rfr�rK)r!r)r0�valuer��color�
add_separators&&&&&&&r"�_add_percentage_stat�!HeaderWidget._add_percentage_statYsr�� ��L�L��G�V�\�\�:��1�H�C����T�5��-�%�8��q������T�"�U�G��f�o�o�>��s�5�z�A�~����
r%c	�,�UOO2oU%cUO2LUOOo[	]UQ*2oUQ*U*]d*oQU*
oUQ*U*]d*oUOQ]2U*]d*o	U%c2[	]UO2o
UOU
*]d*oLD[	]UOO2o
UOOU
*]d*o]oUOVQ[O2U]*
oUOO[6wcNUOVUQUOQ*2oUOUUUQ	UOQ
*P	Q5oUOO[6wc6V�]*
6c)UOUUUQUOQ
*P	Q5oV�]*
6c,UOUUU	QUOQ
*U]6�Q5oV�]*
6c,UOUUUQUOQ*U]6�Q5oU]*!)z1Draw thread status statistics and GC information.rM�has_gilgY@�
gil_requested�
has_exceptionzThreads:   zon gilr�zoff gilr�)r�zwaiting for gilr��exc�GCr�)r^�_get_current_thread_data�as_status_dict�thread_status_countsrHrm�sample_count�gc_frame_samplesr�r/r�r��moderr�r )
r!r)r*�thread_data�
status_counts�
total_threads�
pct_on_gil�pct_off_gil�pct_gil_requested�
pct_exceptionr��pct_gcr0s
&&&          r"rk�HeaderWidget.draw_thread_statustsV���n�n�=�=�?��8C��2�2�4����Il�Il�
��A�}�W�5�6�
�#�I�.��>�#�E�
��j�(��*�?�;�m�K�s�R��&�*�*�?�A�>��N�RU�U�
����;�#;�#;�<�M�!�2�2�]�B�c�I�F� ��4�>�>�#?�#?�@�M��n�n�5�5�
�E��L�F������T�
�v�}�}�=��r�	���>�>���"4�4��+�+��:�x����W�1E��C��+�+��������E�"�"�
,��C��>�>���"4�4��r�z�9I��+�+���!�!����H�%�"�
,��C������+�+��������E�"�"�R�x�
,��C������+�+��������I�&�"�R�x�
,��C��a�x�r%c��UOO2o[U2o[U2o[QUO	222oVW*
o]o	UOVQ[O2U	]*
o	UOVUQ
UOQ*2U	]*
o	UOVQ[O2U	]*
o	V�]*
6c�UOVQ[O2U	]*
o	UOVUQ
UOQ*2U	]*
o	UOVQ[O2U	]*
o	V�]*
6c�UOVQ[O2U	]*
o	UOVUQ
UOQ	*2U	]*
o	UOVQ
[O2U	]*
o	V�]*
6c{UOVQ[O2U	]*
o	UOVUQ
UOQ*2U	]*
o	UOVQ[O2U]*!)
z!Draw function statistics summary.c3�b�SF �D pOQ]2]6�fJ]w�	J"	P!3h��direct_calls)rm)�.0�fs& r"�	<genexpr>�3HeaderWidget.draw_function_stats.<locals>.<genexpr>�s%��*���*�!�e�e�N�A�.F��.J�A�A�*�s�/�/zFunctions: �>5r�z totalr�r�z execr�z stackr�z shown)r^�_get_current_result_sourcerK�sum�valuesr/r�r�r r�rf)
r!r)r*re�
result_set�total_funcs�funcs_shown�executing_funcs�
stack_onlyr0s
&&&&      r"rl� HeaderWidget.draw_function_stats�s���^�^�>�>�@�
��*�o���*�o���
�!�(�(�*�
�
��!�2�
������T�
�v�}�}�=��r�	�����T�;�r�"2�T�[�[��5H�I��q������T��&�/�/�:��q��������L�L��G�V�\�\�:��1�H�C��L�L��o�b�1�D�K�K��4H�
�
�1�H�C��L�L��G�V�_�_�=��1�H�C������L�L��G�V�\�\�:��1�H�C��L�L��z�"�o����H�8M�N��1�H�C��L�L��H�f�o�o�>��1�H�C������L�L��G�V�\�\�:��1�H�C��L�L��k�"�-����I�0F�
�
�1�H�C��L�L��H�f�o�o�>��a�x�r%c	��]oUOUUQ[Q0[O2U]*
o[	UQP	Q5o,QNoUO
Q*UO
Q*UO
Q*,o]oSFCD�o	U[6�cCL�VB]*
6�cCL�U	Q*]6XcJ4U	Q	*]*o
U	Q
*oU]*U]*
6c0UOVVh*Q*Vx*2U]*
oV$*
]*
o[
][]U22o
[U
2U
6�cU
PU
]*
Q*o
U[U
2*U]
*
6fJ�UOVV�U*2U[U
2*
oUQ
6�cQUQ
Q0LQU	Q*Q0oUOVU[O2U[U2*
oU]*
oU]6fCJ�VB]*
6fCJ�UOVQ[O2U]*
oCJ�	U]6Xc/VB]*
6c"UOVQ[O2U]*!)zDraw top N hottest functions.zTop z:     c��UQ*!r�r'��xs&r"�<lambda>�1HeaderWidget.draw_top_functions.<locals>.<lambda>�s	��a��&7r%)�key�reverser�r�r�r��func�
sample_pctr��...g�������?r�r�r�r�r�z(collecting samples...))u🥇u🥈u🥉)
r/rr�r��sortedr rGrHrKrf)r!r)r*rer0�top_by_samples�emojis�medal_colors�	displayed�	func_data�	func_name�func_pct�available_for_name�max_name_len�pct_strs&&&&           r"rn�HeaderWidget.draw_top_functions�sC����������.�/�v�6��M�M�		
�	�r�	����7��
��*���K�K����K�K��!��K�K�� �
���	�'�I��7�7���b�j� ����(�A�-��!�&�)�!�,�I� ��.�H��Q�w����#�����v�0�3�6��8O���q���"'��r�!1���r�3�q�*<�#=�>�L��9�~��,�%�&8��q�(8�9�E�A�	��S��^�#�e�b�j�0����T�	�	�3J�K��s�9�~�%�� �3����#��b�)��i��7�8��:��
���T�����>��s�7�|�#���Q��	��q�=�S�2�:�%5��L�L��G�V�\�\�B��1�H�C�Q(�T��>�c�B�J�.��L�L��$=�v�|�|�L��a�x�r%c���UOOQ2oUOOQ2oU]*
oQo[U2U]*
6cJU[U2*
]*
oU]*oVg*
oQU*U*QU**o	LUPU]*
o	UOU]V�U*UOQ**2U]*
oU]*
oU!)z3Draw a prominent banner when profiling is finished.�	A_REVERSEr�uD  ✓ PROFILING COMPLETE - Final Results Below - Press 'q' to Quit  r�r�)rrqrKr/r )
r!r)r*rr��message�
padding_total�padding_left�
padding_right�full_messages
&&&       r"rp�!HeaderWidget.draw_finished_banner3s����L�L�)�)�+�6�	����&�&�x�0��	
��	��Y���w�<�%�!�)�#�!�C��L�0�1�4�M�(�A�-�L�)�8�M���-��7�#�
�:M�M�L�"�;�U�Q�Y�/�L�	
����!�\�v�#5����G�8L�#L�	
�	
��	��	
��	���r%)r^r_)F)r5r6r7r8r9r#r,r}rhr�rirjr�rkrlrnrpr:r;�
__classcell__�rar=s@@r"r[r[lsR����>�?�#�J	/�?�B&�>�@!�F�6J�X,�\C�J�r%r[c�J``�\sQsQsnQsU1QksQsQsQsQs	Us
U9s!)�TableWidget�Sz2Widget for rendering column headers and data rows.c�4:�[RU_V2V0mP!)z�
Initialize table widget.

Args:
    display: DisplayInterface implementation
    colors: Dictionary of color attributes
    collector: Reference to LiveStatsCollector for accessing stats
�r]r#r^r`s&&&&�r"r#�TableWidget.__init__V����	����)�"�r%c��UQ*oUQ*oUOV2vqqxo	UUUU	1o
UOVV%U
2oU!)z�
Render column headers and data rows.

Args:
    line: Starting line number
    width: Available width
    kwargs: Must contain 'height' and 'stats_list' keys

Returns:
    Next available line number
�heightre)�draw_column_headers�draw_stats_rows)r!r)r*r+rre�show_sample_pct�show_tottime�show_cumul_pct�show_cumtime�column_flagss&&&,       r"r,�TableWidget.renderbsi����!���L�)�
�
�$�$�T�1�	J��|�\�
����	
���#�#��%�\�
���r%c
��U[6�oU[6�oU[6�oU[6�oUOQ*oUOQ*oQ]Q]Q]Q]Q]-OUOOP2o	,o
]oU	]6XcQLQQ	
Q
0oS
OX�U	]6XcSLS12U]*
oU%c5U	]6XcQLQQ

Q
0oS
OX�U	]6XcSLS12U]*
oU%c5U	]6XcQLQQ
Q
0oS
OX�U	]6XcSLS12U]*
oU%c5U	]6XcQLQQ

Q
0oS
OX�U	]6XcSLS12U]*
oU%c5U	]6XcQLQQ
Q
0oS
OX�U	]6XcSLS12U]*
oV�]*
6c�V+*
]*
o
[[[[U
]*22oQQU0
Q
0oU
OV�U12V�]**
oV�]
*
6cHQoV+*
[U2*
oUQ[]U2**oU
OV�U12UOU]QU]*
*U2S
FD)voooUOUUUO2U2J+	U]*UUUU1!)z)Draw column headers with sort indicators.�
sorted_header�
normal_header�nsamplesr��tottime�	cumul_pct�cumtimeu▼nsamples�>13�  u▼%�%r�u
▼tottimez>10u
▼cumtime�function�<z	file:liner�)rrrr	r rmr^�sort_by�appendrGrrHrrKr/�rstrip)r!r)r*rrrrr r!�sort_colr�r0r1�remaining_space�
func_width�	file_text�padding�col_posr2s&&&                r"r�TableWidget.draw_column_headers�s��� �#=�=��� 7�7���";�;��� 7�7�����O�4�
����O�4�
�
���!��q����q�
��#�d�n�n�$�$�b�
)�
	�����$,�q�=�-�j��E�R�H�����S��Q��
�M�Z�[��r�	��� (�A�
�f�3�r�:�"�=�D�����X��]�M�P]� ^�_��1�H�C��&.�!�m�l��3�G�r�J�D�����X��]�M�P]� ^�_��2�I�C�� (�A�
�f�3�r�:�"�=�D�����X��]�M�P]� ^�_��1�H�C��&.�!�m�l��3�G�r�J�D�����X��]�M�P]� ^�_��2�I�C�����#�k�A�o�O��#��'��A�)=�>��J�!��:�,��/�r�2�D�����M� :�;���>�!�C��R�Z��'�	��+��I��6�� �3��Q���#8�8���#�#�S�
�$>�?�	
���T�1�c�U�Q�Y�/��?�$0��G�T�4��L�L��w����
�t�<�$0�
�1�H�����
�	
r%c
��`-`.`/`0`1�Uvqgq�UOOQ[O2o
UOOQ[O2oUOO
n0[
UOQP
2o[
UOQ]2o
U%c[
UOQ]2L]oUOOQ2n.UOOQ2n-U%c[L]oU%cVNPLSo[U2FCD@vooV[*
U*
6�cU!UQ*oUQ	*oUQ
*oUQ*oUQ*oUQ
*oUQ*oUOQ-2n1S9%cUU
6Hn/U-U.U/U0U11QkoU]*U]*U]*oooUQU0o]oR/%c*UOU]QU]*
*R.R-*2U%cPR/%cUOUUQR.R-*2L"UOUUQ[O2U]*
oUQ2o UOUUUQ
Q0U 2U]*
oU%c*UQ
2o!UOUUUQ
Q0U!2U]*
oU%c*UQ2o"UOUUUQ
Q0U"2U]*
oU%c*UQ2o#UOUUUQ
Q0U#2U]*
oU	%c*UQ2o$UOUUUQ
Q0U$2U]*
oUU]*
6CcUU*
]*
o%[[[[ U%]*22o&So'[#U2U&6�cUPU&]*
Q*o'U'QU&0
o'R/%c
R.R-*LSo(UOUUU'U(2UU&]**
oUU]
*
6c]UOO%U2o)U)QU0o*UU*
]*
o+R/%c
R.R-*LS
o,UOUUU*PU+U,2U]*
oCJC	U!)zDraw the statistics data rows.�
color_file�
color_func�show_opcodes�selected_row�
scroll_offsetrr�r�r��cumulative_calls�
total_time�cumulative_timer�r$�trendsc�:�R%c
RR*!ROUQ2oRd$RO%cROU2![O!)�stable)rm�enabled�	get_colorr�r�)�column_name�trendr�r�is_selected�
trend_trackerr>s& �����r"�get_trend_color�4TableWidget.draw_stats_rows.<locals>.get_trend_colorsM����$�v�-�-��
�
�;��9�� �,��1F�1F�1F�(�2�2�5�9�9����&r%r�r�u►r"r&r'�>5.1fr#z>10.3fr%r�r*�:)r rmr�r�r^�_trend_tracker�getattrrrqr�	enumeraterr/rGrrHrrK�
simplify_path)2r!r)rr*rerrrrrr6r7r8r9r:�opcode_panel_height�
display_stats�row_idx�statr�r�r;r<r=r��cum_pctrG�filename�lineno�funcname�samples_strr0�nsamples_color�sample_pct_color�
tottime_color�cumul_pct_color�
cumtime_colorr/r0�func_display�
func_color�simplified_path�	file_line�remaining_width�
file_colorr�rrErFr>s2&&&&&&                                       @@@@@r"r�TableWidget.draw_stats_rows�s9���
�	D��~�
�[�[�_�_�\�6�?�?�C�
��[�[�_�_�\�6�?�?�C�
����5�5�
��t�~�~�~�u�E���t�~�~�~�q�A��GS�������C�YZ�
��L�L�)�)�+�6�	����&�&�x�0��6B�1�q��7C�
�>�2�
�
�&�}�5�5�M�G�T���,�/B�B�B��@��}��<�D���/�L�#�$6�7���l�+�J�"�#4�5�O��l�+�J��;�'�G��X�X�h��+�F�'�B�B�7�l�+B�K�
'�
'�*.�a��$�q�'�4��7�h�f�H�)�N�!�,<�+=�>�K��C�����T�1�c�U�Q�Y�&7��V�9K�L����L�L��s�E�9�v�3E�F��L�L��s�C����A��q���-�Z�8�N��L�L��s�{�3�&7�r�$:�N�K��2�I�C��#2�<�#@� ����T�3�:�e�*<�B�(?�AQ�R��q���� /�	� :�
����T�3�:�f�*=�R�(@�-�P��r�	���"1�+�">�����T�3�7�5�/��(<�o�N��q���� /�	� :�
����T�3�?�6�*B�"�(E�}�U��r�	���U�R�Z��"'�#�+��/�� �'��+�_��-A�B��
�
 (���x�=�:�-�#+�,<�j�1�n�#=��#E�L�".�q���n�!=��3>�Y��/�J�
����T�3��j�A��z�A�~�%������#�&*�n�n�&B�&B�8�&L�O�#2�"3�1�V�H� =�I�&+�c�k�A�o�O�7B��V�!3�
�J��L�L��c�9�-=�o�#>�
��
�A�I�D�A6�D�r%�r^)r5r6r7r8r9r#r,rrr:r;rr
s@@r"rrSs&����<�
#��BT
�l|�|r%rc�D``�\sQsQsnQsU1QksQsQsQsUs	U9s
!)�FooterWidget�Xz>Widget for rendering the footer section (legend and controls).c�4:�[RU_V2V0mP!)z�
Initialize footer widget.

Args:
    display: DisplayInterface implementation
    colors: Dictionary of color attributes
    collector: Reference to LiveStatsCollector for accessing state
rr`s&&&&�r"r#�FooterWidget.__init__[rr%c
��UOOQ2oUOOQ2oQoUOU]UPU]*
U2U]*
oQQQQQQ	Q
QQQ
-oUOUOO
UOO
2o,o	UOO%cU	OQ2L-UOO%cU	OQ2UOO%c*U	OQUOOQ02UOOd8UOOO%fU	OQ2U	%cQOU	2Q*LPo
UOO%cS
oLU
QUQ0oSOS]UPU]*
UOO%fUOO%cSLS2U]*!)z�
Render the footer at the specified position.

Args:
    line: Starting line number (should be height - 2)
    width: Available width

Returns:
    Next available line number
rfr�zCnsamples: direct/cumulative (direct=executing, cumulative=on stack)r#z
Total Timer"zDirect Samplesr%zCumulative Timer�zSample %r$zCumulative %z([PROFILING FINISHED - Press 'q' to quit]z[PAUSED]z	[Filter: z (c to clear)]z[Trend colors: OFF]r�zSort: u6 | 't':mode 'x':trends ←→:thread 'h':help 'q':quit)
rrqr/rmr^r+ror,�paused�filter_patternrKrA�join)r!r)r*r+rfr��legend�
sort_names�sort_display�status�
status_str�footers&&&,        r"r,�FooterWidget.rendergs������%�%�g�.�����&�&�x�0��W�����T�1�f�[�u�q�y�1�5�9���	��
�|��(��(��*���
�
�"�~�~��N�N�"�"�D�N�N�$:�$:�
��
���>�>�"�"�"��M�M�D�E�
�^�^�
"�
"�
"��M�M�*�%��>�>�(�(�(��M�M��D�N�N�9�9�:�.�I�
��>�>�(�(�4�T�^�^�=Z�=Z�=b�=b�=b��M�M�/�0�/5�S�X�X�f�%��+�2�
��>�>�"�"�"�"�|�F�"�|�6�,��7m�n�F�����
��;�U�Q�Y�����%�%�%����)@�)@�)@�
��
	
��a�x�r%c���UOOQ2oUOOQ2oQUOOQ0oUO	U]UPU]*
VC*2P!)z9Draw the filter input prompt at the bottom of the screen.r�rzFunction filter: �_)rrqr^�filter_input_bufferr/)r!r)r*r�r�prompts&&&   r"�render_filter_input_prompt�'FooterWidget.render_filter_input_prompt�se�����&�&�x�0���L�L�)�)�+�6�	�%�T�^�^�%G�%G�$H��J�����T�1�f�[�u�q�y�1�9�3E�Fr%rd)r5r6r7r8r9r#r,ryr:r;rr
s@@r"rfrfXs����H�
#�;�zG�Gr%rfc�,`�\sQsQsnQsQsQsUsP!)�
HelpWidget�z-Widget for rendering the help screen overlay.c��UQ*oUOOQ2oUOOQ2oQU1PU1QU1QU1QU1QU1Q	U1Q
U1QU1QU1Q
U1PU1QU1QU1QU1PU1QU1QU1QU1QU1PU1QU1QU1QU1PU1QU1,oU[U2*
]*o[U2FDCvo	vq�V�*U]*
6fJ]oUO	V�*V�PU]*
U2JE	U!)z�
Render the help screen.

Args:
    line: Starting line number (ignored, help is centered)
    width: Available width
    kwargs: Must contain 'height' key

Returns:
    Next available line number (not used for overlays)
rr�r�z'Tachyon Profiler - Interactive CommandszNavigation & Display:z2  s           - Cycle through sort modes (forward)z3  S           - Cycle through sort modes (backward)z3  t           - Toggle view mode (ALL / per-thread)z,  x           - Toggle trend colors (on/off)u=  j/k or ↑/↓  - Select next/previous function (--opcodes)u)  ← / →       - Cycle through threadsz+  +           - Faster display refresh ratez+  -           - Slower display refresh ratezControl:z)  p           - Freeze display (snapshot)z$  r           - Reset all statisticsz
Filtering:z1  /           - Enter function filter (substring)z  c           - Clear filterz#  ESC         - Cancel filter inputzOther:z#  h or ?      - Show/hide this helpz  q           - Quit profilerz'Press any key to close this help screen)rrqrKrMr/)
r!r)r*r+rr�r��
help_lines�
start_linerUr1r2r0s
&&&,         r"r,�HelpWidget.render�sk����!�����&�&�x�0���<�<�(�(��4��7��?�
��N�
$�f�-�
A�8�L�
B�H�M�
B�H�M�
;�X�F�
L�h�W�
8�(�C�
:�H�E�
:�H�E�
��N�
�� �
8�(�C�
3�X�>�
��N�
�6�"�
@�(�K�
+�X�6�
2�H�=�
��N�
�v��
2�H�=�
,�h�7�
��N�
6��?�5
�
�:�s�:��.�1�4�
�(��4�O�A�|���~���
�*������Z�^�S�{����2C�T�J� 5�
�r%r')r5r6r7r8r9r,r:r;r<s@r"r|r|�s����7�3�3r%r|c�>``�\sQsQsnQsU1QksQsQsUsU9s	!)�OpcodePanel��z@Widget for displaying opcode statistics for a selected function.c�4:�[RU_V2V0mP!)Nrr`s&&&&�r"r#�OpcodePanel.__init__�s���
����)�"�r%c��UOQ,2oUOQ]2oUOOo[UOQ]2oUOOQ2oUOOQ2o	UOOQU	2o
UOOQU	2oUOOQU	2oVv*o
U%cU
[U26�cUOU]Q	U	2U]*!VM*oUQ
*oUvoooUOOOU-2oU%f"UOU]QUQ0U	2U]*![UO2Q
Q5o[UO22oQUQ0oUQ[]U[U2*
]*
2**
oUOU]UPU]*
V�*2U]*
oU%cU]*]*L]o[]VQ*
]*
2o]o[!UPU2FD�vovooV]*
6�cL�[#U2oUQ*o[%U2oU]6�cUU*]d*L]o U]6�c['UU*U*2L]o!QU!*QUU!*
**o"U%cSLSo#QU"QUQ
QU Q
QUQ
Q0	o$UOU]U$PU]*
U#2U]*
oJ�	[U2U6�c4[U2U*
o%UOU]QU%Q0U	2U]*
oU!)z�Render opcode statistics panel.

Args:
    line: Starting line number
    width: Available width
    kwargs: Must contain 'stats_list', 'height'

Returns:
    Next available line number
rerr:r�r��
color_cyan�color_yellow�
color_magentaz(No function selected (use j/k to select)r�zNo opcode data for z() (requires --opcodes)c��U]*'!)�r'r�s&r"r��$OpcodePanel.render.<locals>.<lambda>s
��Q�q�T�Er%)r�u─── Opcodes for z() rg�is_specializedrXrYrEz] z<35r�rIz% (z>6r�z... and z
 more opcodes)rmr^r9rLrrqr rKr/�opcode_statsr��itemsr�r�rHrGrMrrrI)&r!r)r*r+rerr9r:r�r�r�r�r��actual_index�
selected_statr�rTrUrVr��sorted_opcodes�total_opcode_samples�header�	max_count�max_rowsrQrU�
opcode_num�count�opcode_infor��name_display�pctrSrT�
name_color�row_text�	remainings&&&&,                                  r"r,�OpcodePanel.render�s;���Z�Z��b�1�
����H�b�)���~�~�2�2��������C�
����&�&�x�0���<�<�(�(��4���[�[�_�_�\�8�<�
��{�{���~�x�@���������B�
�%�3���\�S��_�<��L�L��q�"L�h�W��!�8�O�"�0�
��V�$��%)�"��&�(��~�~�2�2�6�6�t�R�@����L�L��q�$7��z�AX�"Y�[c�d��!�8�O� �� 2� 2� 4�/�J��"�<�#6�#6�#8�9��*�(��3�7���%�#�a���V��!4�q�!8�9�9�9�����T�1�f�X�e�A�g�.�
�0C�D���	��-;�N�1�%�a�(��	��q�&�-�!�+�,���	�&/��y��0I�&J�"�A�"�
�E���z�!��)�*�5�K�(�)9�:�N�(��4�L�:N�QR�:R�5�/�/�#�5�XY�C�@I�1�}�s�E�I�-��:�;�RS�H��(�"�U�i�(�.B�%C�C�C�+9��l�J��3�%�r�,�s�!3�1�S��K�s�5��*�A�N�H��L�L��q�(�8�E�!�G�"4�j�A��A�I�D�)'K�.�~���)��N�+�h�6�I��L�L��q�H�Y�K�}�"E�x�P��A�I�D��r%rd)
r5r6r7r8r9r#r,r:r;rr
s@@r"r�r��s����J�#�T�Tr%r�)(r9r��time�abcrr�	constantsrrrrrrr	r
rrr
rrrrrrrrrrrr�opcode_utilsrrrr?r[rrfr|r�r'r%r"�<module>r�s���9�
��#������$���:�4�S�4�D"��"�Jd�6�d�NB�&�B�JSG�6�SG�l6��6�r[�&�[r%

Youez - 2016 - github.com/yon3zu
LinuXploit