<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
À<×eƒ  ã               @   sT   d dl mZ d dl mZ ddlZddlmZ ddlZejj	ƒ Z
G dd„ dejƒZdS )é   )Úbase)Ú
exceptionsé    N)Úcommandsc                   sT   e Zd ZdZ‡ fdd„Zedd„ ƒZdd„ Zdd	„ Zd
d„ Z	dd„ Z
dd„ 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.
	c                sP   t ƒ | _d| _tjj| jƒs"d| _tjj| jƒs:tjdƒ‚tt	| ƒj
||Ž 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   ZNotSupportedPluginExceptionÚsuperr   Ú__init__)ÚselfÚargsÚkwargs)Ú	__class__© ú&/usr/lib/python3.6/plugin_eeepc_she.pyr      s    
zEeePCSHEPlugin.__init__c             C   s   dddddœ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 |_| jjdd ƒ|_d S )NFTÚload)Z_has_static_tuningZ_has_dynamic_tuningÚ	_she_modeÚ_monitors_repositoryZcreateÚ_load_monitor)r   Úinstancer   r   r   Ú_instance_init0   s    zEeePCSHEPlugin._instance_initc             C   s"   |j d k	r| jj|j ƒ d |_ d S )N)r   r   Údelete)r   r   r   r   r   Ú_instance_cleanup6   s    
z EeePCSHEPlugin._instance_cleanupc             C   sH   |j jƒ d }||jd kr*| j|dƒ n||jd krD| j|dƒ d S )NÚsystemr   Z	powersaver   Únormal)r   Zget_loadÚoptionsÚ_set_she_mode)r   r   Údevicer   r   r   r   Ú_instance_update_dynamic;   s
    z'EeePCSHEPlugin._instance_update_dynamicc             C   s   | j |dƒ d S )Nr!   )r#   )r   r   r$   r   r   r   Ú_instance_unapply_dynamicB   s    z(EeePCSHEPlugin._instance_unapply_dynamicc             C   sL   t |jd|  ƒ}|j|krHtjd||f ƒ | jj| jd| ƒ || _d S )Nzshe_%sznew eeepc_she mode %s (%d) z%s)Úintr"   r   ÚlogÚinfor   Zwrite_to_filer   )r   r   Znew_modeZnew_mode_numericr   r   r   r#   F   s
    
zEeePCSHEPlugin._set_she_mode)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úclassmethodr   r   r   r%   r&   r#   Ú__classcell__r   r   )r   r   r   	   s   		r   )Ú r   r   Z
tuned.logsZtunedZtuned.utils.commandsr   r	   ZlogsÚgetr(   ZPluginr   r   r   r   r   Ú<module>   s   
