관리-도구
편집 파일: plugin_acpi.cpython-39.pyc
a ����,�g� ����������������������@���sX���d�dl�mZ�d�dlT�ddlZddlZddlZddlmZ�ej � ��ZG�dd��dej�Z dS�)����)�base)�*�����N)�ACPI_DIRc�����������������������sv���e�Zd�ZdZ��fdd�Zedd���Zdd��Zdd ��Zed d���Z edd ���Z ed�dd���Ze 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`. ==== c��������������������s���t�t|��j|i�|���d�S��N)�superr����__init__)�self�args�kwargs�� __class__���=/usr/lib/python3.9/site-packages/tuned/plugins/plugin_acpi.pyr ��� ���s����zACPIPlugin.__init__c�����������������C���s���dd�iS��N�platform_profiler�����clsr���r���r����_get_config_options#���s����zACPIPlugin._get_config_optionsc�����������������C���s���d|_�d|_d�S�)NTF)Z_has_static_tuningZ_has_dynamic_tuning�r ����instancer���r���r����_instance_init'���s����zACPIPlugin._instance_initc�����������������C���s���d�S�r���r���r���r���r���r����_instance_cleanup+���s����zACPIPlugin._instance_cleanupc�����������������C���s���t�j�td�S�)NZplatform_profile_choices��os�path�joinr���r���r���r���r����_platform_profile_choices_path.���s����z)ACPIPlugin._platform_profile_choices_pathc�����������������C���s���t�j�td�S�r���r���r���r���r���r����_platform_profile_path2���s����z!ACPIPlugin._platform_profile_pathr���c�����������������C���s����t�j�|�����st�d��d�S�dd��|�d�D��}t|�j� |�� �������}|D�]V}||v�r�|s�t�d|���|�jj|����||r�t jgndd��|��S�t�d|���qNt�d ��d�S�) N�5ACPI platform_profile is not supported on this systemc�����������������S���s���g�|�]}|�����qS�r���)�strip)�.0�profiler���r���r���� <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?)r���r����isfiler����log�debug�split�set�_cmd� read_filer����infoZ write_to_file�errno�ENOENTZwarning�error)r ���Zprofilesr���Zsim�removeZavail_profilesr#���r���r���r����_set_platform_profile6���s ���� � z ACPIPlugin._set_platform_profileFc�����������������C���s2���t�j�|�����st�d��d�S�|�j�|��������S�)Nr ���) r���r���r'���r���r(���r)���r,���r-���r!���)r ���r���Zignore_missingr���r���r����_get_platform_profileH���s���� z ACPIPlugin._get_platform_profile)F)�__name__� __module__�__qualname__�__doc__r ����classmethodr���r���r���r���r���Zcommand_setr3���Zcommand_getr4���� __classcell__r���r���r ���r���r������s��� r���)��r���Z decoratorsr���r/���Z tuned.logsZtunedZtuned.constsr���Zlogs�getr(���ZPluginr���r���r���r���r����<module>���s���