Your IP : 52.15.92.58
3
�<�e� � @ s� d dl Z ddlmZ ddlT d dlZd dlT d dlmZ d dl j
Z
d dlZd dlZej
j� 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 )�SysctlPluginaI
`sysctl`::
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||� d| _t� | _d S )NT)�superr �__init__Z_has_dynamic_optionsr �_cmd)�self�args�kwargs)� __class__� �#/usr/lib/python3.6/plugin_sysctl.pyr * s zSysctlPlugin.__init__c C sh d|_ d|_| j|j�}| jj|i �|_t|j�dkr\tj d� | j
|� i |_| jj|� |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�unsetZoptions�_sysctl)r
�instance�storage_keyr r r �_instance_init/ s
zSysctlPlugin._instance_initc C s | j |j�}| jj|� d S )N)r r r r )r
r r r r r �_instance_cleanup? s zSysctlPlugin._instance_cleanupc C s� xzt |jj� �D ]h\}}| j|�}|d kr:tjd| � q| jj| jj |��}| j
||�}|d k r||j|<