404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.219.158.84: ~ $
3

�<�e�
�@sdddlmZddlmZddlmZddlZddlZddlZddl	Z	ej
j�ZGdd�dej
�ZdS)�)�base)�command_custom�)�constsNcs�eZdZdZ�fdd�Zdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zeddd�dd��Z�ZS)�IrqbalancePlugina�
	`irqbalance`::
	
	Plug-in for irqbalance settings management. The plug-in
	configures CPUs which should be skipped when rebalancing IRQs in
	`/etc/sysconfig/irqbalance`. It then restarts irqbalance if and
	only if it was previously running.
	+
	The banned/skipped CPUs are specified as a CPU list via the
	[option]`banned_cpus` option.
	+
	.Skip CPUs 2,4 and 9-13 when rebalancing IRQs
	====
	----
	[irqbalance]
	banned_cpus=2,4,9-13
	----
	====
	cs tt|�j||�tj�|_dS)N)�superr�__init__�perfZcpu_map�_cpus)�self�args�kwargs)�	__class__��'/usr/lib/python3.6/plugin_irqbalance.pyr szIrqbalancePlugin.__init__cCsd|_d|_dS)NFT)Z_has_dynamic_tuningZ_has_static_tuning)r�instancerrr�_instance_init$szIrqbalancePlugin._instance_initcCsdS)Nr)rrrrr�_instance_cleanup(sz"IrqbalancePlugin._instance_cleanupcCsddiS)N�banned_cpusr)�clsrrr�_get_config_options+sz$IrqbalancePlugin._get_config_optionscCsly ttjd��
}|j�SQRXWnFtk
rf}z*|jtjkrJtjd�ntj	d|�dSd}~XnXdS)N�rz>irqbalance sysconfig file is missing. Is irqbalance installed?z,Failed to read irqbalance sysconfig file: %s)
�openr�IRQBALANCE_SYSCONFIG_FILE�read�IOError�errno�ENOENT�log�warn�error)r�f�errr�_read_irqbalance_sysconfig1sz+IrqbalancePlugin._read_irqbalance_sysconfigcCsZy&ttjd��}|j|�WdQRXdStk
rT}ztjd|�dSd}~XnXdS)N�wTz-Failed to write irqbalance sysconfig file: %sF)rrr�writerrr )r�contentr!r"rrr�_write_irqbalance_sysconfig<sz,IrqbalancePlugin._write_irqbalance_sysconfigcCs|d|S)NzIRQBALANCE_BANNED_CPUS=%s
r)r�	sysconfig�banned_cpumaskrrr�_write_banned_cpusEsz#IrqbalancePlugin._write_banned_cpuscCs8g}x(|jd�D]}tjd|�s|j|�qWdj|�S)N�
z\s*IRQBALANCE_BANNED_CPUS=)�split�re�match�append�join)rr(�lines�linerrr�_clear_banned_cpusHs
z#IrqbalancePlugin._clear_banned_cpuscCs2|jjdddgdgd�\}}|dkr.tjd�dS)NZ	systemctlztry-restartZ
irqbalance�)Z	no_errorsrz.Failed to restart irqbalance. Is it installed?)�_cmdZexecuterr)rZretcode�outrrr�_restart_irqbalanceOs
z$IrqbalancePlugin._restart_irqbalancecCs@|j�}|dkrdS|j|�}|j||�}|j|�r<|j�dS)N)r#r3r*r'r7)rr)r&rrr�_set_banned_cpusXs

z!IrqbalancePlugin._set_banned_cpuscCs4|j�}|dkrdS|j|�}|j|�r0|j�dS)N)r#r3r'r7)rr&rrr�_restore_banned_cpusas

z%IrqbalancePlugin._restore_banned_cpusrF)Z
per_devicec	Cs�d}|dk	rjt|jj|��}t|j�}|j|�rB|jjt|��}n(djdd�|jD��}tj	d||f�|sr|r~|dkr~dS|r�dS|r�|j
|�n|j�dS)N�,cSsg|]}t|��qSr)�str)�.0�xrrr�
<listcomp>rsz1IrqbalancePlugin._banned_cpus.<locals>.<listcomp>zGInvalid banned_cpus specified, '%s' does not match available cores '%s')�setr5Zcpulist_unpackr
�issubsetZcpulist2hex�listr0rr r8r9)	rZenabling�valueZverifyZignore_missingr)ZbannedZpresentZstr_cpusrrr�_banned_cpusis 

zIrqbalancePlugin._banned_cpus)�__name__�
__module__�__qualname__�__doc__rrr�classmethodrr#r'r*r3r7r8r9rrC�
__classcell__rr)rrrs			r)�rZ
decoratorsrZtunedrZ
tuned.logsrr	r-Zlogs�getrZPluginrrrrr�<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