MOON
Server: Apache
System: Linux s5.yayogua.com.py 6.12.0-124.55.3.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:54:02 EDT 2026 x86_64
User: sanbercountryclu (1012)
PHP: 8.2.33
Disabled: NONE
Upload Files
File: //lib/python3.12/site-packages/tuned/units/__pycache__/manager.cpython-312.pyc
�

�]�i����ddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ejj�ZdgZGd�de�Zy)�N)�GlobalConfig)�commands�Managerc���eZdZdZ	d�fd�	Zed��Zed��Zed��Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zej&fd�Z�xZS)rz?
	Manager creates plugin instances and keeps a track of them.
	c����tt|��||_||_||_||_g|_g|_|xs
t�|_
t�|_y�N)
�superr�__init__�_plugins_repository�_monitors_repository�_def_instance_priority�_hardware_inventory�
_instances�_pluginsr�_configr�_cmd)�self�plugins_repository�monitors_repository�def_instance_priority�hardware_inventory�config�	__class__s      ��8/usr/lib/python3.12/site-packages/tuned/units/manager.pyr
zManager.__init__sU�������!�/�$��1�$�� 5�$��/�$���$�/��$�-��)�<�>�$�,��j�$�)�c��|jSr)r�rs r�pluginszManager.plugins!s��	
���rc��|jSr)rrs r�	instanceszManager.instances%s��	
���rc��|jSr)rrs rrzManager.plugins_repository)s��	
�	!�	!�!rc�
�|j�y|jjtj�}|�|j
j
d�}tj|j|tj�duS)NTz
/proc/cpuinfo)
�
cpuinfo_regexr�get�consts�CFG_CPUINFO_STRINGr�	read_file�re�search�	MULTILINE)r�unit�cpuinfo_strings   r�_unit_matches_cpuinfozManager._unit_matches_cpuinfo-so��	����
��<�<�#�#�F�$=�$=�>�.����I�I�'�'��8�>�	���4�%�%�~��L�L�
��
�rc��|j�y|jjtj�}|�#djt
j��}tj|j|tj�duS)NT� )�uname_regexrr$r%�CFG_UNAME_STRING�join�os�unamer(r)r*)rr+�uname_strings   r�_unit_matches_unamezManager._unit_matches_uname6so��	����
����!�!�&�"9�"9�:�,����(�(�2�8�8�:�&�<�	���4�#�#�\��L�L�
��
�rc
��g}t|j��D]�\}}|jstj	d|z��+|j|�stj	d|z��U|j
|�stj	d|z��|j�t|j�|_nt|j�|_|j|���|jd���tj�}|D]}d||j<�t|j��D]A\}}	|jj!|�}|||<|j"j|��Cg}
|D]�}||j}|��tj	d	|j4�d
|j�d��|j7|j4|j|j8|j:|j<|j>|j@�}|
j|���|
D]R}|jBjE�|jBjG|�|jBjI|��T|jJjM�|jNjQ|
�y#t$j&j(j*$r&}	tj-d|�d|	���Yd}	~	���d}	~	wt.$r8}	tj1d|z�tj3|	�Yd}	~	��d}	~	wwxYw)Nzskipping disabled instance '%s'z.skipping instance '%s', cpuinfo does not matchz,skipping instance '%s', uname does not matchc��|jSr)�priority)�xs r�<lambda>z Manager.create.<locals>.<lambda>Rs���
�
r)�keyzskipping plugin 'z!', not supported on your system: zfailed to initialize plugin %sz
creating 'z' (�)))�list�items�enabled�log�debugr-r6r9�intr
�append�sort�collections�OrderedDict�typer�creater�tunedr�
exceptions�NotSupportedPluginException�info�	Exception�error�	exception�name�create_instance�devices�devices_udev_regex�
script_pre�script_post�options�plugin�init_devices�assign_free_devices�initialize_instancer�start_processing_eventsr�extend)
r�instances_config�instance_info_list�
instance_name�
instance_info�plugins_by_name�plugin_name�nonerX�er �new_instance�instances
             rrIzManager.create?s�����&*�+;�+A�+A�+C�&D�"�m�]�
�
�
��I�I�/�-�?�@��
�
$�
$�]�
3��I�I�>��N�O��
�
"�
"�=�
1��I�I�<�}�L�M�����$� ��!<�!<�=�M�� ��!7�!7�8�M�����]�+�'E�"���2��3��+�+�-�/�)�m�)-�?�=�%�%�&�*� �� 5� 5� 7�8��k�4�

�
�
%�
%�
,�
,�[�
9�F�#)�O�K� ��M�M���� �	9��)�)�m��M�.�.�/�6��n���9�9�]�%7�%7��9K�9K�
L�M��(�(��);�);�]�=S�=S����=�;�;����m�7�7��9N�9N�P�<�
���L�!�*��h��?�?���!��?�?�&�&�x�0��?�?�&�&�x�0�����2�2�4��/�/����#��3�-�-�
"�
"�
>�
>�
��H�H��VW�
X�Y���
�
��I�I�.��<�=��M�M�!����
�s$�;K�'M�6L�M�#-M�Mc	���	||i|��S#t$rY}tj�}tj	d|�dt|����tj	|�|cYd}~Sd}~wwxYw)NzBUG: Unhandled exception in z: )rN�	traceback�
format_excrArO�str)r�caller�exc_ret�f�args�kwargsre�traces        r�	_try_callzManager._try_callws`���
�T�
�V�
���	�����!�5��9�9���A�����9�9�U��
�>���s�
�	A,�AA'�!A,�'A,c���|jD]L}tjd|jz�|j	dd|j
j|��N|jD]A}tjd|jz�|j	dd|j��C|jjj�|jdd�=|jdd�=y)Nzdestroying instance %s�destroy_allzcleaning plugin '%s')rrArBrQrrrX�destroy_instancer�cleanuprr�clear)rrgrXs   rrtzManager.destroy_all�s����/�/�h��9�9�
%��
�
�
5�6��>�>�-��
�_�_�%�%�
��"�
�
�
�f��9�9�
#�f�k�k�
1�2��>�>�-��v�~�~�6�����"�"�(�(�*�
�m�m�A��
�o�o�a�rc��|jjD]7}tjd|z�|j	dd|j
��9y)Nzupdating monitor %s�update_monitors)r�monitorsrArBrr�update)r�monitors  rryzManager.update_monitors�s?���*�*�3�3�g��9�9�
"�W�
,�-��>�>�#�T�7�>�>�:�4rc�`�|jD]}|jdd|j��!y)N�start_tuning)rrr�apply_tuning�rrgs  rr~zManager.start_tuning�s)���/�/�h��>�>�.�$�
����"rc�x�d}|jD](}|jdd|j|�}|dk(s�'d}�*|S)NT�
verify_tuningF)rrrr�)r�ignore_missing�retrg�ress     rr�zManager.verify_tuning�sE���#��/�/�h�	
�����
���^�
-�3�	�U�l�
�C�	"�


�*rc�`�|jD]}|jdd|j��!y)N�
update_tuning)rrrr�r�s  rr�zManager.update_tuning�s)���/�/�h��>�>�/�4�
����"rc��|jj�t|j�D] }|j	dd|j
|��"y)N�stop_tuning)r�stop_processing_events�reversedrrr�unapply_tuning)r�rollbackrgs   rr�zManager.stop_tuning�sB�����1�1�3��4�?�?�+�h��>�>�-��
���h�(�,rr)�__name__�
__module__�__qualname__�__doc__r
�propertyrr rr-r6rIrrrtryr~r�r�r%�
ROLLBACK_SOFTr��
__classcell__)rs@rrrs�����
8<�
����������"��"���6$�p��;�
�

��#)�"6�"6�(r)rFr3r(ri�tuned.exceptionsrJ�
tuned.logs�tuned.plugins.exceptions�tuned.constsr%�tuned.utils.global_configr�tuned.utils.commandsr�logsr$rA�__all__�objectr�rr�<module>r�sH���	�	������2�)��j�j�n�n����+��b(�f�b(r