a Á]›iÿ ã @ sT d dl mZ d dl mZ ddlZddlmZ ddlZej ¡ Z G dd„ dejƒZdS )é )Úbase)Ú exceptionsé N)Úcommandsc s` e Zd ZdZ‡ fdd„Zedd„ ƒZdd„ Zdd „ Z‡ fd d„Z dd „ Z dd„ Zdd„ Z‡ Z S )ÚEeePCSHEPlugina Dynamically sets the front-side bus (FSB) speed according to the CPU load. This feature can be found on some netbooks and is also known as the Asus Super Hybrid Engine. If the CPU load is lower or equal to the value specified by the [option]`load_threshold_powersave` option, the plug-in sets the FSB speed to the value specified by the [option]`she_powersave` option. If the CPU load is higher or equal to the value specified by the [option]`load_threshold_normal` option, it sets the FSB speed to the value specified by the [option]`she_normal` option. Static tuning is not supported and the plug-in is transparently disabled if the hardware support for this feature is not detected. NOTE: For details about the FSB frequencies and corresponding values, see link:https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-platform-eeepc-laptop[the kernel documentation]. The provided defaults should work for most users. c sT t ƒ | _d| _tj | j¡s"d| _tj | j¡s:t d¡‚tt | ƒj |i |¤Ž d S )Nz!/sys/devices/platform/eeepc/cpufvz%/sys/devices/platform/eeepc-wmi/cpufvz)Plugin is not supported on your hardware.)r Ú_cmdÚ _control_fileÚosÚpathÚisfiler ZNotSupportedPluginExceptionÚsuperr Ú__init__)ÚselfÚargsÚkwargs©Ú __class__© úB/usr/lib/python3.9/site-packages/tuned/plugins/plugin_eeepc_she.pyr s zEeePCSHEPlugin.__init__c C s dddddœS )Ng333333ã?gš™™™™™Ù?é r )Úload_threshold_normalÚload_threshold_powersaveZ she_powersaveZ she_normalr )r r r r Ú_get_config_options% s üz"EeePCSHEPlugin._get_config_optionsc C s d|_ d|_d |_d |_d S )NFT)Z_has_static_tuningZ_has_dynamic_tuningÚ _she_modeÚ _load_monitor©r Úinstancer r r Ú_instance_init. s zEeePCSHEPlugin._instance_initc C s" |j d ur| j |j ¡ d |_ d S )N)r Ú_monitors_repositoryÚdeleter r r r Ú_instance_cleanup4 s z EeePCSHEPlugin._instance_cleanupc s$ t t| ƒ |¡ | j dd ¡|_d S )NÚload)r r Ú_instance_init_dynamicr Zcreater r r r r r" 9 s z%EeePCSHEPlugin._instance_init_dynamicc C sH |j ¡ d }||jd kr*| |d¡ n||jd krD| |d¡ d S )NÚsystemr Z powersaver Únormal)r Zget_loadÚoptionsÚ _set_she_mode)r r Údevicer! r r r Ú_instance_update_dynamic= s z'EeePCSHEPlugin._instance_update_dynamicc C s | |d¡ d S )Nr$ )r&