관리-도구
편집 파일: plugin_sysfs.cpython-39.opt-1.pyc
a ,�g� � @ st d dl mZ ddlZddlZddlZd dlT ddlZddl m Z ddlT ddlm Z ej�� ZG dd� dej�ZdS )� )�base� N)�*)�commandsc sf e Zd ZdZ� fdd�Zdd� Zdd� Zdd � Zd d� Ze j fdd �Zdd� Zdd� Z dd� Z� ZS )�SysfsPluginai Sets various `sysfs` settings specified by the plug-in options. The syntax is `_name_=_value_`, where `_name_` is the `sysfs` path to use and `_value_` is the value to write. The `sysfs` path supports the shell-style wildcard characters (see `man 7 glob` for additional detail). Use this plugin in case you need to change some settings that are not covered by other plug-ins. Prefer specific plug-ins if they cover the required settings. .Ignore corrected errors and associated scans that cause latency spikes ==== ---- [sysfs] /sys/devices/system/machinecheck/machinecheck*/ignore_ce=1 ---- ==== 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_sysfs.pyr % s zSysfsPlugin.__init__c C s4 d|_ d|_tdd� t|j�� �D ��|_i |_d S )NFTc S s$ g | ]}t j�|d �|d f�qS )r r )�os�path�normpath)�.0� key_valuer r r � <listcomp>. � z.SysfsPlugin._instance_init.<locals>.<listcomp>)Z_has_dynamic_tuningZ_has_static_tuning�dict�list�options�items�_sysfs�_sysfs_original�r �instancer r r �_instance_init* s zSysfsPlugin._instance_initc C s d S �Nr r r r r �_instance_cleanup1 s zSysfsPlugin._instance_cleanupc C sn t |j�� �D ]Z\}}| j�|�}t�|�D ]:}| �|�rX| �|�|j |<