HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/tuned/plugins/__pycache__/plugin_acpi.cpython-39.pyc
a

,�g�	�@sXddlmZddlTddlZddlZddlZddlmZej	�
�ZGdd�dej�Z
dS)�)�base)�*�N)�ACPI_DIRcsveZdZdZ�fdd�Zedd��Zdd�Zdd	�Zed
d��Z	edd
��Z
ed�dd��Ze
d�ddd��Z�ZS)�
ACPIPlugina'
	Configures the ACPI driver.

	The only currently supported option is
	[option]`platform_profile`, which sets the ACPI
	platform profile sysfs attribute,
	a generic power/performance preference API for other drivers.
	Multiple profiles can be specified, separated by `|`.
	The first available profile is selected.

	.Selecting a platform profile
	====
	----
	[acpi]
	platform_profile=balanced|low-power
	----
	Using this option, *TuneD* will try to set the platform profile
	to `balanced`. If that fails, it will try to set it to `low-power`.
	====
	cstt|�j|i|��dS�N)�superr�__init__)�self�args�kwargs��	__class__��=/usr/lib/python3.9/site-packages/tuned/plugins/plugin_acpi.pyr	 szACPIPlugin.__init__cCsddiS�N�platform_profiler��clsrrr�_get_config_options#szACPIPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning�r
�instancerrr�_instance_init'szACPIPlugin._instance_initcCsdSrrrrrr�_instance_cleanup+szACPIPlugin._instance_cleanupcCstj�td�S)NZplatform_profile_choices��os�path�joinrrrrr�_platform_profile_choices_path.sz)ACPIPlugin._platform_profile_choices_pathcCstj�td�Srrrrrr�_platform_profile_path2sz!ACPIPlugin._platform_profile_pathrcCs�tj�|���st�d�dSdd�|�d�D�}t|j�	|�
�����}|D]V}||vr�|s�t�d|�|jj|��||r�t
jgndd�|St�d|�qNt�d	�dS)
N�5ACPI platform_profile is not supported on this systemcSsg|]}|���qSr)�strip)�.0�profilerrr�
<listcomp>;�z4ACPIPlugin._set_platform_profile.<locals>.<listcomp>�|z Setting platform_profile to '%s'F)Zno_errorz+Requested platform_profile '%s' unavailablezDFailed to set platform_profile. Is the value in the profile correct?)rr�isfiler�log�debug�split�set�_cmd�	read_filer�infoZ
write_to_file�errno�ENOENTZwarning�error)r
ZprofilesrZsim�removeZavail_profilesr#rrr�_set_platform_profile6s 
�
z ACPIPlugin._set_platform_profileFcCs2tj�|���st�d�dS|j�|�����S)Nr )	rrr'rr(r)r,r-r!)r
rZignore_missingrrr�_get_platform_profileHs
z ACPIPlugin._get_platform_profile)F)�__name__�
__module__�__qualname__�__doc__r	�classmethodrrrrrZcommand_setr3Zcommand_getr4�
__classcell__rrr
rrs



r)�rZ
decoratorsrr/Z
tuned.logsZtunedZtuned.constsrZlogs�getr(ZPluginrrrrr�<module>s