404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.135.241.114: ~ $
3

�<�e�
�@snddlmZddlTddlZddlZddlZddlZddlZddl	m
Z
ejj�Z
e
�ZGdd�dej�ZdS)�)�base)�*�N)�commandsc@s�eZdZdZedd��Zdd�Zdd�Zedd	��Ze	d
�dd��Z
e	d
�dd��Zed
�dd��Z
ed
�dd��Ze	d�dd��Zed�dd��ZdS)�VMPlugina|
	`vm`::
	
	Enables or disables transparent huge pages depending on value of the
	[option]`transparent_hugepages` option. The option can have one of three
	possible values `always`, `madvise` and `never`.
	+
	.Disable transparent hugepages
	====
	----
	[vm]
	transparent_hugepages=never
	----
	====
	+
	The [option]`transparent_hugepage.defrag` option specifies the
	defragmentation policy. Possible values for this option are `always`,
	`defer`, `defer+madvise`, `madvise` and `never`. For a detailed
	explanation of these values refer to
	link:https://www.kernel.org/doc/Documentation/vm/transhuge.txt[Transparent Hugepage Support].
	cCsdddd�S)N)�transparent_hugepages�transparent_hugepageztransparent_hugepage.defrag�)�selfr	r	�/usr/lib/python3.6/plugin_vm.py�_get_config_options%szVMPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning)r
�instancer	r	r�_instance_init-szVMPlugin._instance_initcCsdS)Nr	)r
r
r	r	r�_instance_cleanup1szVMPlugin._instance_cleanupcCsd}tjj|�sd}|S)Nz#/sys/kernel/mm/transparent_hugepagez*/sys/kernel/mm/redhat_transparent_hugepage)�os�path�exists)r
rr	r	r�	_thp_path4szVMPlugin._thp_pathrcCs�|dkr"|stjdt|��dStjddd�}|jd�d	krP|sLtjd
�dStjj	|j
�d�}tjj|�r�|s�tj|||r�t
jgndd�|S|s�tjd
�dSdS)N�always�never�madvisez-Incorrect 'transparent_hugepages' value '%s'.z
/proc/cmdlineT)�no_errorztransparent_hugepage=rzWtransparent_hugepage is already set in kernel boot cmdline, ignoring value from profile�enabledFzDOption 'transparent_hugepages' is not supported on current hardware.)rrr)�log�warn�str�cmd�	read_file�find�inforr�joinrr�
write_to_file�errno�ENOENT)r
�value�sim�removeZcmdline�sys_filer	r	r�_set_transparent_hugepages<s$

z#VMPlugin._set_transparent_hugepagesrcCs|j|||�dS)N)r()r
r$r%r&r	r	r�_set_transparent_hugepageUsz"VMPlugin._set_transparent_hugepagecCs6tjj|j�d�}tjj|�r.tjtj|��SdSdS)Nr)rrr rrr�get_active_optionr)r
r'r	r	r�_get_transparent_hugepagesYsz#VMPlugin._get_transparent_hugepagescCs|j�S)N)r+)r
r	r	r�_get_transparent_hugepagebsz"VMPlugin._get_transparent_hugepageztransparent_hugepage.defragcCsXtjj|j�d�}tjj|�rB|s>tj|||r6tjgndd�|S|sPt	j
d�dSdS)N�defragF)rzJOption 'transparent_hugepage.defrag' is not supported on current hardware.)rrr rrrr!r"r#rr)r
r$r%r&r'r	r	r� _set_transparent_hugepage_defragfs
z)VMPlugin._set_transparent_hugepage_defragcCs6tjj|j�d�}tjj|�r.tjtj|��SdSdS)Nr-)rrr rrrr*r)r
r'r	r	r� _get_transparent_hugepage_defragssz)VMPlugin._get_transparent_hugepage_defragN)�__name__�
__module__�__qualname__�__doc__�classmethodrrrrZcommand_setr(r)Zcommand_getr+r,r.r/r	r	r	rrs	
r)�rZ
decoratorsZ
tuned.logsZtunedrr"�structZglobZtuned.utils.commandsrZlogs�getrrZPluginrr	r	r	r�<module>s


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 173 B 0644
__init__.cpython-36.pyc File 173 B 0644
base.cpython-36.opt-1.pyc File 21.13 KB 0644
base.cpython-36.pyc File 21.13 KB 0644
decorators.cpython-36.opt-1.pyc File 1.06 KB 0644
decorators.cpython-36.pyc File 1.06 KB 0644
exceptions.cpython-36.opt-1.pyc File 354 B 0644
exceptions.cpython-36.pyc File 354 B 0644
hotplug.cpython-36.opt-1.pyc File 4.23 KB 0644
hotplug.cpython-36.pyc File 4.23 KB 0644
plugin_acpi.cpython-36.opt-1.pyc File 3.35 KB 0644
plugin_acpi.cpython-36.pyc File 3.35 KB 0644
plugin_audio.cpython-36.opt-1.pyc File 4.03 KB 0644
plugin_audio.cpython-36.pyc File 4.03 KB 0644
plugin_bootloader.cpython-36.opt-1.pyc File 24.45 KB 0644
plugin_bootloader.cpython-36.pyc File 24.45 KB 0644
plugin_cpu.cpython-36.opt-1.pyc File 26.03 KB 0644
plugin_cpu.cpython-36.pyc File 26.06 KB 0644
plugin_disk.cpython-36.opt-1.pyc File 16.35 KB 0644
plugin_disk.cpython-36.pyc File 16.35 KB 0644
plugin_eeepc_she.cpython-36.opt-1.pyc File 3.43 KB 0644
plugin_eeepc_she.cpython-36.pyc File 3.43 KB 0644
plugin_irqbalance.cpython-36.opt-1.pyc File 4.51 KB 0644
plugin_irqbalance.cpython-36.pyc File 4.51 KB 0644
plugin_modules.cpython-36.opt-1.pyc File 5.45 KB 0644
plugin_modules.cpython-36.pyc File 5.45 KB 0644
plugin_mounts.cpython-36.opt-1.pyc File 5.5 KB 0644
plugin_mounts.cpython-36.pyc File 5.5 KB 0644
plugin_net.cpython-36.opt-1.pyc File 23.21 KB 0644
plugin_net.cpython-36.pyc File 23.21 KB 0644
plugin_rtentsk.cpython-36.opt-1.pyc File 1.34 KB 0644
plugin_rtentsk.cpython-36.pyc File 1.34 KB 0644
plugin_scheduler.cpython-36.opt-1.pyc File 53.44 KB 0644
plugin_scheduler.cpython-36.pyc File 53.44 KB 0644
plugin_script.cpython-36.opt-1.pyc File 4.26 KB 0644
plugin_script.cpython-36.pyc File 4.31 KB 0644
plugin_scsi_host.cpython-36.opt-1.pyc File 4.56 KB 0644
plugin_scsi_host.cpython-36.pyc File 4.56 KB 0644
plugin_selinux.cpython-36.opt-1.pyc File 3 KB 0644
plugin_selinux.cpython-36.pyc File 3 KB 0644
plugin_service.cpython-36.opt-1.pyc File 13.84 KB 0644
plugin_service.cpython-36.pyc File 13.84 KB 0644
plugin_sysctl.cpython-36.opt-1.pyc File 6.7 KB 0644
plugin_sysctl.cpython-36.pyc File 6.7 KB 0644
plugin_sysfs.cpython-36.opt-1.pyc File 3.64 KB 0644
plugin_sysfs.cpython-36.pyc File 3.64 KB 0644
plugin_systemd.cpython-36.opt-1.pyc File 5.92 KB 0644
plugin_systemd.cpython-36.pyc File 5.92 KB 0644
plugin_uncore.cpython-36.opt-1.pyc File 4.75 KB 0644
plugin_uncore.cpython-36.pyc File 4.75 KB 0644
plugin_usb.cpython-36.opt-1.pyc File 2.95 KB 0644
plugin_usb.cpython-36.pyc File 2.95 KB 0644
plugin_video.cpython-36.opt-1.pyc File 4.13 KB 0644
plugin_video.cpython-36.pyc File 4.13 KB 0644
plugin_vm.cpython-36.opt-1.pyc File 4.11 KB 0644
plugin_vm.cpython-36.pyc File 4.11 KB 0644
repository.cpython-36.opt-1.pyc File 1.87 KB 0644
repository.cpython-36.pyc File 1.92 KB 0644