관리-도구
편집 파일: plugin_sysctl.cpython-39.pyc
a ,�g � @ s� d dl Z ddlmZ ddlT d dlZd dlT d dlmZ d dl m Z d dlZd dlZej �� ZddgZdd gZG d d� dej�ZdS )� N� )�base)�*)�commandsZbase_reachable_timeZretrans_timez /run/sysctl.dz /etc/sysctl.dc s� e Zd ZdZ� fdd�Zdd� Zdd� Zdd � Zd d� Ze j fdd �Zdd� Zdd� Z dd� Zdd� Zdd� Zddd�Z� ZS )�SysctlPlugina5 Sets various kernel parameters at runtime. This plug-in is used for applying custom `sysctl` settings and should only be used to change system settings that are not covered by other *TuneD* plug-ins. If the settings are covered by other *TuneD* plug-ins, use those plug-ins instead. The syntax for this plug-in is `_key_=_value_`, where `_key_` is the same as the key name provided by the `sysctl` utility. .Adjusting the kernel runtime kernel.sched_min_granularity_ns value ==== ---- [sysctl] kernel.sched_min_granularity_ns=3000000 ---- ==== c s( t t| �j|i |�� d| _t� | _d S )NT)�superr �__init__Z_has_dynamic_optionsr �_cmd)�self�args�kwargs�� __class__� �?/usr/lib/python3.9/site-packages/tuned/plugins/plugin_sysctl.pyr ( s zSysctlPlugin.__init__c C sh d|_ d|_| �|j�}| j�|i �|_t|j�dkr\t� d� | � |� i |_| j�|� |j|_ d S )NFTr z0recovering old sysctl settings from previous run)Z_has_dynamic_tuningZ_has_static_tuning�_storage_key�name�_storage�get�_sysctl_original�len�log�info�_instance_unapply_static�unset�options�_sysctl�r �instance�storage_keyr r r �_instance_init- s zSysctlPlugin._instance_initc C s | � |j�}| j�|� d S �N)r r r r r r r r �_instance_cleanup= s zSysctlPlugin._instance_cleanupc C s� t |j�� �D ]h\}}| �|�}|d u r8t�d| � q| j�| j� |��}| � ||�}|d ur||j|<