3 À<×eƒ ã@sTddlmZddlmZddlZddlmZddlZejj ƒZ Gdd„dej ƒZ dS)é)Úbase)Ú exceptionséN)ÚcommandscsTeZdZdZ‡fdd„Zedd„ƒZdd„Zdd „Zd d „Z d d „Z dd„Z ‡Z S)ÚEeePCSHEPlugina¾ `eeepc_she`:: 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. csPtƒ|_d|_tjj|jƒs"d|_tjj|jƒs:tjdƒ‚tt |ƒj ||ŽdS)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ÚisfilerZNotSupportedPluginExceptionÚsuperrÚ__init__)ÚselfÚargsÚkwargs)Ú __class__©ú&/usr/lib/python3.6/plugin_eeepc_she.pyr s zEeePCSHEPlugin.__init__cCsdddddœS)Ng333333ã?gš™™™™™Ù?ér)Úload_threshold_normalÚload_threshold_powersaveZ she_powersaveZ she_normalr)rrrrÚ_get_config_options'sz"EeePCSHEPlugin._get_config_optionscCs&d|_d|_d|_|jjddƒ|_dS)NFTÚload)Z_has_static_tuningZ_has_dynamic_tuningÚ _she_modeÚ_monitors_repositoryZcreateÚ _load_monitor)rÚinstancerrrÚ_instance_init0szEeePCSHEPlugin._instance_initcCs"|jdk r|jj|jƒd|_dS)N)rrÚdelete)rrrrrÚ_instance_cleanup6s z EeePCSHEPlugin._instance_cleanupcCsH|jjƒd}||jdkr*|j|dƒn||jdkrD|j|dƒdS)NÚsystemrZ powersaverÚnormal)rZget_loadÚoptionsÚ _set_she_mode)rrÚdevicerrrrÚ_instance_update_dynamic;s z'EeePCSHEPlugin._instance_update_dynamiccCs|j|dƒdS)Nr!)r#)rrr$rrrÚ_instance_unapply_dynamicBsz(EeePCSHEPlugin._instance_unapply_dynamiccCsLt|jd|ƒ}|j|krHtjd||fƒ|jj|jd|ƒ||_dS)Nzshe_%sznew eeepc_she mode %s (%d) z%s)Úintr"rÚlogÚinforZ write_to_filer)rrZnew_modeZnew_mode_numericrrrr#Fs  zEeePCSHEPlugin._set_she_mode) Ú__name__Ú __module__Ú __qualname__Ú__doc__r Ú classmethodrrrr%r&r#Ú __classcell__rr)rrr s r) ÚrrZ tuned.logsZtunedZtuned.utils.commandsrr ZlogsÚgetr(ZPluginrrrrrÚs