관리-도구
편집 파일: controller.cpython-39.pyc
a ,�ggL � @ s( d dl mZmZ d dlmZ d dlmZmZmZ d dl m Z mZmZm Z d dlmZ d dlmZ d dlZd dlZd dlZd dlZd dlZe�� ZdZd Zd ZdZdZd ZdZdZ e eed�Z!G dd� de�Z"G dd� dej#�Z$G dd� dej#�Z%G dd� de&�Z'G dd� de&�Z(G dd� dej)j*�Z+dS )� )�exports�logs)�commands)�PPD_CONFIG_FILE�PPD_BASE_PROFILE_FILE�PPD_API_COMPATIBILITY)� PPDConfig�PPD_PERFORMANCE�PPD_BALANCED�PPD_POWER_SAVER)�Enum)�RandomN�tunedz-/sys/devices/system/cpu/intel_pstate/no_turboz4/sys/bus/platform/devices/thinkpad_acpi/dytc_lapmode�unknownzorg.freedesktop.UPowerz/org/freedesktop/UPowerz#/sys/firmware/acpi/platform_profile)z low-powerZbalancedZperformancec @ s e Zd ZdZdZdZdZdS )�PerformanceDegradedz7 Possible reasons for performance degradation. � zlap-detectedzhigh-operating-temperatureN)�__name__� __module__�__qualname__�__doc__�NONE�LAP_DETECTED�HIGH_OPERATING_TEMPERATURE� r r �8/usr/lib/python3.9/site-packages/tuned/ppd/controller.pyr ! s r c s( e Zd ZdZ� fdd�Zdd� Z� ZS )�PerformanceDegradedEventHandlerz= Event handler for checking performance degradation. c s t t| ��� || _|| _d S �N)�superr �__init__�_controller�_path)�self� controller�path�� __class__r r r . s z(PerformanceDegradedEventHandler.__init__c C s |j | jkrd S | j�� d S r )�pathnamer r �check_performance_degraded�r! Zeventr r r �process_IN_MODIFY3 s z1PerformanceDegradedEventHandler.process_IN_MODIFY)r r r r r r) � __classcell__r r r$ r r * s r c sD e Zd ZdZdZ� fdd�Zdd� Zdd� Zd d � Zdd� Z � Z S ) �PlatformProfileEventHandlera Event handler for switching PPD profiles based on the ACPI platform profile This handler should only invoke a PPD profile change if the change of the file at PLATFORM_PROFILE_PATH comes from within the kernel (e.g., when the user presses Fn-L on a Thinkpad laptop). This is currently detected as the file being modified without being opened before. g�������?c s$ t t| ��� || _d| _d| _d S )NFr )r r+ r r � _file_open�_last_close�r! r"