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/plugins/__pycache__/plugin_sysfs.cpython-312.opt-1.pyc
�

�]�i�
���ddlmZddlZddlZddlZddl�ddlZddl	m
Z
ddl�ddlm
Z
ejj�ZGd�dej"�Zy)�)�base�N)�*)�commandsc�j��eZdZdZ�fd�Zd�Zd�Zd�Zd�Ze	jfd�Zd�Zd	�Z
d
�Z�xZS)�SysfsPluginai
	Sets various `sysfs` settings specified by the plug-in options.

	The syntax is `_name_=_value_`, where
	`_name_` is the `sysfs` path to use and `_value_` is
	the value to write. The `sysfs` path supports the shell-style
	wildcard characters (see `man 7 glob` for additional detail).

	Use this plugin in case you need to change some settings that are
	not covered by other plug-ins. Prefer specific plug-ins if they
	cover the required settings.

	.Ignore corrected errors and associated scans that cause latency spikes
	====
	----
	[sysfs]
	/sys/devices/system/machinecheck/machinecheck*/ignore_ce=1
	----
	====
	c�X��tt|�
|i|��d|_t	�|_y)NT)�superr�__init__�_has_dynamic_optionsr�_cmd)�self�args�kwargs�	__class__s   ��?/usr/lib/python3.12/site-packages/tuned/plugins/plugin_sysfs.pyrzSysfsPlugin.__init__%s(�����T�#�T�4�V�4�"�$���j�$�)�c	��d|_d|_tt|jj��D�cgc])}tjj|d�|df��+c}�|_	i|_
ycc}w)NFTrr)�_has_dynamic_tuning�_has_static_tuning�dict�list�options�items�os�path�normpath�_sysfs�_sysfs_original)r�instance�	key_values   r�_instance_initzSysfsPlugin._instance_init*so��!&�(�� $�(���Z^�_g�_o�_o�_u�_u�_w�Zx�y�Zx�Y�2�7�7�+�+�I�a�L�9�9�Q�<�H�Zx�y�z�(�/��(���zs�.A;c��y�N�)rr s  r�_instance_cleanupzSysfsPlugin._instance_cleanup1s��rc�x�t|jj��D]�\}}|jj	|�}tj|�D]\}|j|�r1|j|�|j|<|j||��Etjd|z��^��y)Nz)rejecting write to '%s' (not inside /sys))
rrr�
_variables�expand�glob�iglob�_check_sysfs�_read_sysfsr�_write_sysfs�log�error)rr �key�value�v�fs      r�_instance_apply_staticz"SysfsPlugin._instance_apply_static4s�������.�.�0�1�j�c�5������e�$�1��J�J�s�O�q������#'�#3�#3�A�#6�X���a� �	���q�!���Y�Y�:�Q�>�?�
�2rc�D�d}t|jj��D]w\}}|jj	|�}tj|�D]?}|j|�s�|j|�}	|j|||	|�dk(s�>d}�A�y|S)NTF)
rrrr(r)r*r+r,r-�
_verify_value)
rr �ignore_missing�devices�retr1r2r3r4�curr_vals
          r�_instance_verify_staticz#SysfsPlugin._instance_verify_static>s����#�����.�.�0�1�j�c�5������e�$�1��J�J�s�O�q������� � ��#�X����1�a��>�:�e�C��c�	
�2�

�*rc�~�t|jj��D]\}}|j||��yr$)rrrr.)rr �rollbackr1r2s     r�_instance_unapply_staticz$SysfsPlugin._instance_unapply_staticIs4����1�1�7�7�9�:�j�c�5����S�%� �;rc�.�tjd|�S)Nz^/sys/.*)�re�match)r�
sysfs_files  rr,zSysfsPlugin._check_sysfsMs��	���+�z�	*�*rc��|jj|�j�}t|�dkDr|jj	|d�Sy)NrF)r
�	read_file�strip�len�get_active_option)rrC�datas   rr-zSysfsPlugin._read_sysfsPsD��	
���	�	�Z�	(�	.�	.�	0�$���Y��]�
�)�)�
%�
%�d�E�
2�2�
rc�>�|jj||d��S)NT)�ignore_same)r
�
write_to_file)rrCr2s   rr.zSysfsPlugin._write_sysfsWs��	
���	 �	 ��U��	 �	E�Er)�__name__�
__module__�__qualname__�__doc__rr"r&r5r<�consts�
ROLLBACK_SOFTr?r,r-r.�
__classcell__)rs@rrr
sC����.�
 ��@�	
�:@�9M�9M�!�+��Frr)�rr*rA�os.pathr�
decorators�
tuned.logs�tuned�tuned.constsrQ�
subprocess�tuned.utils.commandsr�logs�getr/�Pluginrr%rr�<module>r_sD����	������)��j�j�n�n���KF�$�+�+�KFr