Viewing File: /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/plugin_uncore.cpython-36.opt-1.pyc
3
�<�es � @ sj d dl mZ d dlT ddlZddlmZ ddlZddlZej j
� Ze� ZdZ
dZd ZG dd� dej�ZdS ) � )�hotplug)�*� N)�commandsz//sys/devices/system/cpu/intel_uncore_frequency/c @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Ze dd
� �Z
dd� Zeddd�dd� �Z
ed�ddd��Zeddd�dd� �Zed�ddd��ZdS ) �UncorePlugina|
`uncore`::
`max_freq_khz, min_freq_khz`:::
Limit the maximum and minumum uncore frequency.
Those options are Intel specific and correspond directly to `sysfs` files
exposed by Intel uncore frequency driver.
====
----
[uncore]
max_freq_khz=4000000
----
Using this options *TuneD* will limit maximum frequency of all uncore units
on the Intel system to 4 GHz.
====
c C s� d| _ t� | _t� | _d| _ytjt�}W n tk
r> d S X t j
|d�}t|�dkrbd| _|}x|D ]}| jj|� qhW t
jdt| j�� d S )NTFzuncore*r zdevices: %s)Z_devices_supported�setZ_assigned_devicesZ
_free_devicesZ_is_tpmi�os�listdir� SYSFS_DIR�OSError�fnmatch�filter�len�add�log�debug�str)�selfZdevicesZtpmi_devices�d� r �#/usr/lib/python3.6/plugin_uncore.py�
_init_devices$ s
zUncorePlugin._init_devicesc C s d|_ d|_d S )NTF)Z_has_static_tuningZ_has_dynamic_tuning)r �instancer r r �_instance_init: s zUncorePlugin._instance_initc C s d S )Nr )r r r r r �_instance_cleanup>