a ”ˆ«hŽ ã@sXddlmZddlTddlZddlZddlZddlmZej   ¡Z Gdd„dej ƒZ dS)é)Úbase)Ú*éN)ÚACPI_DIRcsveZdZdZ‡fdd„Zedd„ƒZdd„Zdd „Zed d „ƒZ ed d „ƒZ e dƒ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Ú ;óz4ACPIPlugin._set_platform_profile..ú|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 Ú classmethodrrrrrZ command_setr3Z command_getr4Ú __classcell__rrr rr s     r)ÚrZ decoratorsrr/Z tuned.logsZtunedZ tuned.constsrZlogsÚgetr(ZPluginrrrrrÚs