__pycache__/__init__.cpython-36.opt-1.pyc000064400000000611147205120270014076 0ustar003 s__pycache__/__init__.cpython-36.pyc000064400000000611147205120270013137 0ustar003 s__pycache__/exceptions.cpython-36.opt-1.pyc000064400000000536147205120270014526 0ustar003 s__pycache__/exceptions.cpython-36.pyc000064400000000536147205120270013567 0ustar003 s__pycache__/factory.cpython-36.opt-1.pyc000064400000000736147205120270014016 0ustar003 s__pycache__/factory.cpython-36.pyc000064400000000736147205120270013057 0ustar003 s__pycache__/loader.cpython-36.opt-1.pyc000064400000010154147205120270013610 0ustar003 s   __pycache__/loader.cpython-36.pyc000064400000010154147205120270012651 0ustar003 s   __pycache__/locator.cpython-36.opt-1.pyc000064400000007170147205120270014011 0ustar003 }|j|tjj|}|dk r^||kr^d}q0tjj|r0|Sq0W|r|dkrd}|S)Nr-)reversedrrrrbasenameisfile)r profile_nameZ skip_filesretZconditional_loaddir_name config_filer r r get_configs   zLocator.get_configcCs|dk o|dkod|kS)Nr/r )r rr r r check_profile_name_format0sz!Locator.check_profile_name_formatcCs|j|sdS|j|}|dkr$dSyJtddddd}t|_t|"}|jdtjd|j WdQRX|St t t fk r}zdSd}~XnXdS)N=#TF)Z delimitersZinline_comment_prefixesZallow_no_valuestrict[z] ) r rrstrZ optionxformopenZ read_stringconstsZMAGIC_HEADER_NAMEreadIOErrorOSErrorr)r rrconfigfer r r parse_config3s   &zLocator.parse_configc Cs$y t|}Wntk r*|g}d}YnXy t|}Wntk rV|g}d}YnX||krv||dg||}|j|}|dkrddddgStj|jk}d|g}xtt||D]f\} } | dks| dkrd|d<|dg}q|o| |jtjkr||jtj| ddg}q|| g}qW|S)NrFrTr)raw) lenrr.r'ZPLUGIN_MAIN_UNIT_NAMEZsectionszipZoptionsget) r rZattrsZdefvalsZ attrs_lenZ defvals_lenr+Zmain_unit_in_configvalsattrZdefvalr r r get_profile_attrsGs2       zLocator.get_profile_attrsc Csjt}x^|jD]T}y:x4tj|D]&}|j||}tjj|r |j|q WWqtk r`YqXqW|S)N) setrrlistdirrrraddr*)r Zprofilesrrrr r r list_profileses    zLocator.list_profilescCs t|jS)N)sortedr:)r r r r get_known_namesqszLocator.get_known_namescsfddtjDS)Ncs(g|] }|j|tjgdgdfqS)r)r6r'ZPROFILE_ATTR_SUMMARY).0Zprofile)r r r usz3Locator.get_known_names_summary..)r;r:)r r )r r get_known_names_summarytszLocator.get_known_names_summary)N)N)__name__ __module__ __qualname____doc__ __slots__r propertyr rrr r.r6r:r<r@r r r r rs    r)rZ tuned.constsr'Ztuned.utils.config_parserrrobjectrr r r r s __pycache__/locator.cpython-36.pyc000064400000007170147205120270013052 0ustar003 }|j|tjj|}|dk r^||kr^d}q0tjj|r0|Sq0W|r|dkrd}|S)Nr-)reversedrrrrbasenameisfile)r profile_nameZ skip_filesretZconditional_loaddir_name config_filer r r get_configs   zLocator.get_configcCs|dk o|dkod|kS)Nr/r )r rr r r check_profile_name_format0sz!Locator.check_profile_name_formatcCs|j|sdS|j|}|dkr$dSyJtddddd}t|_t|"}|jdtjd|j WdQRX|St t t fk r}zdSd}~XnXdS)N=#TF)Z delimitersZinline_comment_prefixesZallow_no_valuestrict[z] ) r rrstrZ optionxformopenZ read_stringconstsZMAGIC_HEADER_NAMEreadIOErrorOSErrorr)r rrconfigfer r r parse_config3s   &zLocator.parse_configc Cs$y t|}Wntk r*|g}d}YnXy t|}Wntk rV|g}d}YnX||krv||dg||}|j|}|dkrddddgStj|jk}d|g}xtt||D]f\} } | dks| dkrd|d<|dg}q|o| |jtjkr||jtj| ddg}q|| g}qW|S)NrFrTr)raw) lenrr.r'ZPLUGIN_MAIN_UNIT_NAMEZsectionszipZoptionsget) r rZattrsZdefvalsZ attrs_lenZ defvals_lenr+Zmain_unit_in_configvalsattrZdefvalr r r get_profile_attrsGs2       zLocator.get_profile_attrsc Csjt}x^|jD]T}y:x4tj|D]&}|j||}tjj|r |j|q WWqtk r`YqXqW|S)N) setrrlistdirrrraddr*)r Zprofilesrrrr r r list_profileses    zLocator.list_profilescCs t|jS)N)sortedr:)r r r r get_known_namesqszLocator.get_known_namescsfddtjDS)Ncs(g|] }|j|tjgdgdfqS)r)r6r'ZPROFILE_ATTR_SUMMARY).0Zprofile)r r r usz3Locator.get_known_names_summary..)r;r:)r r )r r get_known_names_summarytszLocator.get_known_names_summary)N)N)__name__ __module__ __qualname____doc__ __slots__r propertyr rrr r.r6r:r<r@r r r r rs    r)rZ tuned.constsr'Ztuned.utils.config_parserrrobjectrr r r r s __pycache__/merger.cpython-36.opt-1.pyc000064400000003524147205120270013626 0ustar003 s __pycache__/merger.cpython-36.pyc000064400000003524147205120270012667 0ustar003 s __pycache__/profile.cpython-36.opt-1.pyc000064400000003433147205120270014004 0ustar003 s __pycache__/profile.cpython-36.pyc000064400000003433147205120270013045 0ustar003 s __pycache__/unit.cpython-36.opt-1.pyc000064400000007036147205120270013326 0ustar003 s__pycache__/unit.cpython-36.pyc000064400000007036147205120270012367 0ustar003 s__pycache__/variables.cpython-36.opt-1.pyc000064400000005664147205120270014324 0ustar003 s    __pycache__/variables.cpython-36.pyc000064400000005664147205120270013365 0ustar003 s    functions/__pycache__/function_assertion_non_equal.cpython-36.pyc000064400000002377147205120270021400 0ustar003 s     functions/__pycache__/function_calc_isolated_cores.cpython-36.opt-1.pyc000064400000003462147205120270022244 0ustar003 s    functions/__pycache__/function_calc_isolated_cores.cpython-36.pyc000064400000003462147205120270021305 0ustar003 s    functions/__pycache__/function_check_net_queue_count.cpython-36.opt-1.pyc000064400000002124147205120270022614 0ustar003 s  functions/__pycache__/function_check_net_queue_count.cpython-36.pyc000064400000002124147205120270021655 0ustar003 s  functions/__pycache__/function_cpuinfo_check.cpython-36.opt-1.pyc000064400000002643147205120270021063 0ustar003 s  functions/__pycache__/function_cpuinfo_check.cpython-36.pyc000064400000002643147205120270020124 0ustar003 s  functions/__pycache__/function_cpulist2devs.cpython-36.opt-1.pyc000064400000001614147205120270020707 0ustar003 s  functions/__pycache__/function_cpulist2devs.cpython-36.pyc000064400000001614147205120270017750 0ustar003 s  functions/__pycache__/function_cpulist2hex.cpython-36.opt-1.pyc000064400000001627147205120270020536 0ustar003 s    functions/__pycache__/function_cpulist2hex.cpython-36.pyc000064400000001627147205120270017577 0ustar003 s    functions/__pycache__/function_cpulist2hex_invert.cpython-36.opt-1.pyc000064400000002174147205120270022123 0ustar003 tt|j|sdS|jjdjdd|jjdj|DS)N,css|]}t|VqdS)N)str).0vr r r sz-cpulist2hex_invert.execute..z,,)rrexecuteZ_cmdZ cpulist2hexjoinZcpulist_invert)rargs)r r r rszcpulist2hex_invert.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist2hex_invert.cpython-36.pyc000064400000002174147205120270021164 0ustar003 tt|j|sdS|jjdjdd|jjdj|DS)N,css|]}t|VqdS)N)str).0vr r r sz-cpulist2hex_invert.execute..z,,)rrexecuteZ_cmdZ cpulist2hexjoinZcpulist_invert)rargs)r r r rszcpulist2hex_invert.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_invert.cpython-36.opt-1.pyc000064400000002335147205120270021333 0ustar003 sz)cpulist_invert.execute..z,,)rrexecutejoinZ_cmd)rargs)r r r rszcpulist_invert.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_invert.cpython-36.pyc000064400000002335147205120270020374 0ustar003 sz)cpulist_invert.execute..z,,)rrexecutejoinZ_cmd)rargs)r r r rszcpulist_invert.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_online.cpython-36.opt-1.pyc000064400000002312147205120270021303 0ustar003 sz)cpulist_online.execute..)rrexecuteZ_cmdZcpulist_unpackjoinZ read_file)rargsZcpus)r )rr rs zcpulist_online.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_online.cpython-36.pyc000064400000002312147205120270020344 0ustar003 sz)cpulist_online.execute..)rrexecuteZ_cmdZcpulist_unpackjoinZ read_file)rargsZcpus)r )rr rs zcpulist_online.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_pack.cpython-36.opt-1.pyc000064400000002307147205120270020741 0ustar003 sz'cpulist_pack.execute..z,,)rrexecutejoinZ_cmd)rargs)r r r rszcpulist_pack.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_pack.cpython-36.pyc000064400000002307147205120270020002 0ustar003 sz'cpulist_pack.execute..z,,)rrexecutejoinZ_cmd)rargs)r r r rszcpulist_pack.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_present.cpython-36.opt-1.pyc000064400000002403147205120270021500 0ustar003 sz*cpulist_present.execute..) rrexecuteZ_cmdZcpulist_unpackjoinZ read_filesortedlistset intersection)rargsZcpusZpresent)r r r rs zcpulist_present.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_present.cpython-36.pyc000064400000002403147205120270020541 0ustar003 sz*cpulist_present.execute..) rrexecuteZ_cmdZcpulist_unpackjoinZ read_filesortedlistset intersection)rargsZcpusZpresent)r r r rs zcpulist_present.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_unpack.cpython-36.opt-1.pyc000064400000002111147205120270021275 0ustar003 sz)cpulist_unpack.execute..z,,)rrexecutejoinZ_cmd)rargs)r r r rszcpulist_unpack.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_cpulist_unpack.cpython-36.pyc000064400000002111147205120270020336 0ustar003 sz)cpulist_unpack.execute..z,,)rrexecutejoinZ_cmd)rargs)r r r rszcpulist_unpack.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_exec.cpython-36.opt-1.pyc000064400000001556147205120270017211 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)executez0 Executes process and substitutes its output. cstt|jddddS)Nexecrr)superr__init__)self) __class__#/usr/lib/python3.6/function_exec.pyr szexecute.__init__cs4tt|j|sdS|jj|\}}|dkr0|SdS)Nr)rrZ_cmd)r argsretout)r r r rs zexecute.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_exec.cpython-36.pyc000064400000001556147205120270016252 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)executez0 Executes process and substitutes its output. cstt|jddddS)Nexecrr)superr__init__)self) __class__#/usr/lib/python3.6/function_exec.pyr szexecute.__init__cs4tt|j|sdS|jj|\}}|dkr0|SdS)Nr)rrZ_cmd)r argsretout)r r r rs zexecute.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_hex2cpulist.cpython-36.opt-1.pyc000064400000002073147205120270020532 0ustar003 sz&hex2cpulist.execute..r)rrexecutejoinZ_cmd)rargs)r r r rszhex2cpulist.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_hex2cpulist.cpython-36.pyc000064400000002073147205120270017573 0ustar003 sz&hex2cpulist.execute..r)rrexecutejoinZ_cmd)rargs)r r r rszhex2cpulist.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZlogsgetlogZFunctionrr r r r s    functions/__pycache__/function_kb2s.cpython-36.opt-1.pyc000064400000001573147205120270017125 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)kb2sz* Conversion function: kbytes to sectors cstt|jddddS)Nrr)superr__init__)self) __class__#/usr/lib/python3.6/function_kb2s.pyr sz kb2s.__init__c sBtt|j|sdSytt|ddStk r<dSXdS)Nr)rrexecutestrint ValueError)rargs)r r r r s z kb2s.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_kb2s.cpython-36.pyc000064400000001573147205120270016166 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)kb2sz* Conversion function: kbytes to sectors cstt|jddddS)Nrr)superr__init__)self) __class__#/usr/lib/python3.6/function_kb2s.pyr sz kb2s.__init__c sBtt|j|sdSytt|ddStk r<dSXdS)Nr)rrexecutestrint ValueError)rargs)r r r r s z kb2s.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_regex_search_ternary.cpython-36.opt-1.pyc000064400000001757147205120270022473 0ustar003 s functions/__pycache__/function_regex_search_ternary.cpython-36.pyc000064400000001757147205120270021534 0ustar003 s functions/__pycache__/function_s2kb.cpython-36.opt-1.pyc000064400000001612147205120270017117 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)s2kbz* Conversion function: sectors to kbytes cstt|jddddS)Nrr)superr__init__)self) __class__#/usr/lib/python3.6/function_s2kb.pyr sz s2kb.__init__c sJtt|j|sdSytttt|ddStk rDdSXdS)Nr)rrexecutestrintround ValueError)rargs)r r r r s z s2kb.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_s2kb.cpython-36.pyc000064400000001612147205120270016160 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)s2kbz* Conversion function: sectors to kbytes cstt|jddddS)Nrr)superr__init__)self) __class__#/usr/lib/python3.6/function_s2kb.pyr sz s2kb.__init__c sJtt|j|sdSytttt|ddStk rDdSXdS)Nr)rrexecutestrintround ValueError)rargs)r r r r s z s2kb.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_strip.cpython-36.opt-1.pyc000064400000001517147205120270017423 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)stripz0 Makes string from all arguments and strip it cstt|jddddS)Nrrr)superr__init__)self) __class__$/usr/lib/python3.6/function_strip.pyr szstrip.__init__cs"tt|j|sdSdj|jS)N)rrexecutejoin)rargs)r r r r sz strip.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedr rZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_strip.cpython-36.pyc000064400000001517147205120270016464 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS)stripz0 Makes string from all arguments and strip it cstt|jddddS)Nrrr)superr__init__)self) __class__$/usr/lib/python3.6/function_strip.pyr szstrip.__init__cs"tt|j|sdSdj|jS)N)rrexecutejoin)rargs)r r r r sz strip.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedr rZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_virt_check.cpython-36.opt-1.pyc000064400000002042147205120270020375 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS) virt_checkz Checks whether running inside virtual machine (VM) or on bare metal. If running inside VM expands to argument 1, otherwise expands to argument 2 (even on error). cstt|jddddS)Nr)superr__init__)self) __class__)/usr/lib/python3.6/function_virt_check.pyr szvirt_check.__init__csJtt|j|sdS|jjdg\}}|dkrBt|dkrB|dS|dS)Nz virt-whatrr)rrexecuteZ_cmdlen)r argsretout)r r r r s zvirt_check.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/function_virt_check.cpython-36.pyc000064400000002042147205120270017436 0ustar003 ddlZddlZddlmZddlmZGdddejZdS)N)base)commandscs,eZdZdZfddZfddZZS) virt_checkz Checks whether running inside virtual machine (VM) or on bare metal. If running inside VM expands to argument 1, otherwise expands to argument 2 (even on error). cstt|jddddS)Nr)superr__init__)self) __class__)/usr/lib/python3.6/function_virt_check.pyr szvirt_check.__init__csJtt|j|sdS|jjdg\}}|dkrBt|dkrB|dS|dS)Nz virt-whatrr)rrexecuteZ_cmdlen)r argsretout)r r r r s zvirt_check.execute)__name__ __module__ __qualname____doc__rr __classcell__r r )r r rs r) osZ tuned.logsZtunedrZtuned.utils.commandsrZFunctionrr r r r s  functions/__pycache__/functions.cpython-36.opt-1.pyc000064400000006102147205120270016360 0ustar003 1sz+Functions._process_func..z\w+$rzinvalid function name '%s'zfunction '%s' not implemented) resplitrr matchlogerrorrZ load_func ImportErrorZexecuter)rZ_fromZslfrr r r _process_func-s  zFunctions._process_funcc Cs|j|x|j|jkr|jdkrpy|jj}Wn$tk rVtjd||j SX|ds|j |dn|j ddkr|j |j |jdkrd|_ nd |_ |jd7_q Wt|jrtjd ||j S) N}z.invalid variable syntax, non pair '}' in: '%s'rrr"z${\TFz.invalid variable syntax, non pair '{' in: '%s')rr rrrpop IndexErrorr&r'rr*rrrr)rrZsir r r _process?s&     zFunctions._processcCs(|dks|dkr|Stjdd|j|S)Nr z \\(\${f:.*})z\1)r#subr/)rrr r r expandVszFunctions.expandN)r ) __name__ __module__ __qualname____doc__r rrrrrr*r/r1r r r r r s r)osr#Zglobr rZ tuned.logsZtunedZ tuned.constsZconstsZtuned.utils.commandsrZlogsgetr&cmdrr r r r s    functions/__pycache__/functions.cpython-36.pyc000064400000006102147205120270015421 0ustar003 1sz+Functions._process_func..z\w+$rzinvalid function name '%s'zfunction '%s' not implemented) resplitrr matchlogerrorrZ load_func ImportErrorZexecuter)rZ_fromZslfrr r r _process_func-s  zFunctions._process_funcc Cs|j|x|j|jkr|jdkrpy|jj}Wn$tk rVtjd||j SX|ds|j |dn|j ddkr|j |j |jdkrd|_ nd |_ |jd7_q Wt|jrtjd ||j S) N}z.invalid variable syntax, non pair '}' in: '%s'rrr"z${\TFz.invalid variable syntax, non pair '{' in: '%s')rr rrrpop IndexErrorr&r'rr*rrrr)rrZsir r r _process?s&     zFunctions._processcCs(|dks|dkr|Stjdd|j|S)Nr z \\(\${f:.*})z\1)r#subr/)rrr r r expandVszFunctions.expandN)r ) __name__ __module__ __qualname____doc__r rrrrrr*r/r1r r r r r s r)osr#Zglobr rZ tuned.logsZtunedZ tuned.constsZconstsZtuned.utils.commandsrZlogsgetr&cmdrr r r r s    functions/__pycache__/repository.cpython-36.opt-1.pyc000064400000003400147205120270016565 0ustar003 tjd|x*t|jjD]\}}||kr|j|=qWdS)Nzremoving function %s)rrlistr items)r Zfunctionkvr r r delete&szRepository.delete) __name__ __module__ __qualname__rpropertyrrrrr __classcell__r r )r r r s    r)Ztuned.utils.plugin_loaderrrZ tuned.logsrZ tuned.constsrZtuned.utils.commandsrZlogsgetrrr r r r s     functions/__pycache__/repository.cpython-36.pyc000064400000003463147205120270015637 0ustar003 s     functions/__pycache__/__init__.cpython-36.opt-1.pyc000064400000000236147205120270016111 0ustar003 sfunctions/__pycache__/__init__.cpython-36.pyc000064400000000236147205120270015152 0ustar003 sfunctions/__pycache__/base.cpython-36.opt-1.pyc000064400000002155147205120270015266 0ustar003 s  functions/__pycache__/base.cpython-36.pyc000064400000002155147205120270014327 0ustar003 s  functions/__pycache__/function_assertion.cpython-36.opt-1.pyc000064400000002323147205120270020265 0ustar003 s     functions/__pycache__/function_assertion.cpython-36.pyc000064400000002323147205120270017326 0ustar003 s     functions/__pycache__/function_assertion_non_equal.cpython-36.opt-1.pyc000064400000002377147205120270022337 0ustar003 s     functions/__init__.py000064400000000043147205120270010662 0ustar00from .repository import Repository functions/base.py000064400000002020147205120270010032 0ustar00import os import tuned.logs from tuned.utils.commands import commands log = tuned.logs.get() class Function(object): """ Built-in function """ def __init__(self, name, nargs_max, nargs_min = None): self._name = name self._nargs_max = nargs_max self._nargs_min = nargs_min self._cmd = commands() # checks arguments # nargs_max - maximal number of arguments, there mustn't be more arguments, # if nargs_max is 0, number of arguments is unlimited # nargs_min - minimal number of arguments, if not None there must # be the same number of arguments or more @classmethod def _check_args(cls, args, nargs_max, nargs_min = None): if args is None or nargs_max is None: return False la = len(args) return (nargs_max == 0 or nargs_max >= la) and (nargs_min is None or nargs_min <= la) def execute(self, args): if self._check_args(args, self._nargs_max, self._nargs_min): return True else: log.error("invalid number of arguments for builtin function '%s'" % self._name) return False functions/function_assertion.py000064400000001377147205120270013052 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands from tuned.profiles.exceptions import InvalidProfileException log = tuned.logs.get() class assertion(base.Function): """ Assertion: compares argument 2 with argument 3. If they don't match it logs text from argument 1 and throws InvalidProfileException. This exception will abort profile loading. """ def __init__(self): # 3 arguments super(assertion, self).__init__("assertion", 3, 3) def execute(self, args): if not super(assertion, self).execute(args): return None if args[1] != args[2]: log.error("assertion '%s' failed: '%s' != '%s'" % (args[0], args[1], args[2])) raise InvalidProfileException("Assertion '%s' failed." % args[0]) return None functions/function_assertion_non_equal.py000064400000001453147205120270015106 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands from tuned.profiles.exceptions import InvalidProfileException log = tuned.logs.get() class assertion_non_equal(base.Function): """ Assertion non equal: compares argument 2 with argument 3. If they match it logs text from argument 1 and throws InvalidProfileException. This exception will abort profile loading. """ def __init__(self): # 3 arguments super(assertion_non_equal, self).__init__("assertion_non_equal", 3, 3) def execute(self, args): if not super(assertion_non_equal, self).execute(args): return None if args[1] == args[2]: log.error("assertion '%s' failed: '%s' == '%s'" % (args[0], args[1], args[2])) raise InvalidProfileException("Assertion '%s' failed." % args[0]) return None functions/function_calc_isolated_cores.py000064400000003153147205120270015016 0ustar00import os import glob import tuned.logs from . import base import tuned.consts as consts log = tuned.logs.get() class calc_isolated_cores(base.Function): """ Calculates and returns isolated cores. The argument specifies how many cores per socket reserve for housekeeping. If not specified, 1 core per socket is reserved for housekeeping and the rest is isolated. """ def __init__(self): # max 1 argument super(calc_isolated_cores, self).__init__("calc_isolated_cores", 1) def execute(self, args): if not super(calc_isolated_cores, self).execute(args): return None cpus_reserve = 1 if len(args) > 0: if not args[0].isdecimal() or int(args[0]) < 0: log.error("invalid argument '%s' for builtin function '%s', it must be non-negative integer" % (args[0], self._name)) return None else: cpus_reserve = int(args[0]) topo = {} for cpu in glob.iglob(os.path.join(consts.SYSFS_CPUS_PATH, "cpu*")): cpuid = os.path.basename(cpu)[3:] if cpuid.isdecimal(): physical_package_id = os.path.join(cpu, "topology/physical_package_id") # Show no errors when the physical_package_id file does not exist -- the CPU may be offline. if not os.path.exists(physical_package_id): log.debug("file '%s' does not exist, cpu%s offline?" % (physical_package_id, cpuid)) continue socket = self._cmd.read_file(physical_package_id).strip() if socket.isdecimal(): topo[socket] = topo.get(socket, []) + [cpuid] isol_cpus = [] for cpus in topo.values(): cpus.sort(key = int) isol_cpus = isol_cpus + cpus[cpus_reserve:] isol_cpus.sort(key = int) return ",".join(isol_cpus) functions/function_check_net_queue_count.py000064400000001212147205120270015366 0ustar00import tuned.logs from . import base log = tuned.logs.get() class check_net_queue_count(base.Function): """ Checks whether the user has specified a queue count for net devices. If not, return the number of housekeeping CPUs. """ def __init__(self): # 1 argument super(check_net_queue_count, self).__init__("check_net_queue_count", 1, 1) def execute(self, args): if not super(check_net_queue_count, self).execute(args): return None if args[0].isdigit(): return args[0] (ret, out) = self._cmd.execute(["nproc"]) log.warn("net-dev queue count is not correctly specified, setting it to HK CPUs %s" % (out)) return out functions/function_cpuinfo_check.py000064400000001763147205120270013642 0ustar00import re import tuned.logs from . import base log = tuned.logs.get() class cpuinfo_check(base.Function): """ Checks regexes against /proc/cpuinfo. Accepts arguments in the following form: REGEX1, STR1, REGEX2, STR2, ...[, STR_FALLBACK] If REGEX1 matches something in /proc/cpuinfo it expands to STR1, if REGEX2 matches it expands to STR2. It stops on the first match, i.e. if REGEX1 matches, no more regexes are processed. If none regex matches it expands to STR_FALLBACK. If there is no fallback, it expands to empty string. """ def __init__(self): # unlimited number of arguments, min 2 arguments super(cpuinfo_check, self).__init__("cpuinfo_check", 0, 2) def execute(self, args): if not super(cpuinfo_check, self).execute(args): return None cpuinfo = self._cmd.read_file("/proc/cpuinfo") for i in range(0, len(args), 2): if i + 1 < len(args): if re.search(args[i], cpuinfo, re.MULTILINE): return args[i + 1] if len(args) % 2: return args[-1] else: return "" functions/function_cpulist2devs.py000064400000000714147205120270013464 0ustar00import tuned.logs from . import base log = tuned.logs.get() class cpulist2devs(base.Function): """ Conversion function: converts CPU list to device strings """ def __init__(self): # arbitrary number of arguments super(cpulist2devs, self).__init__("cpulist2devs", 0) def execute(self, args): if not super(cpulist2devs, self).execute(args): return None return self._cmd.cpulist2string(self._cmd.cpulist_unpack(",".join(args)), prefix = "cpu") functions/function_cpulist2hex.py000064400000000726147205120270013312 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist2hex(base.Function): """ Conversion function: converts CPU list to hexadecimal CPU mask """ def __init__(self): # arbitrary number of arguments super(cpulist2hex, self).__init__("cpulist2hex", 0) def execute(self, args): if not super(cpulist2hex, self).execute(args): return None return self._cmd.cpulist2hex(",,".join(args)) functions/function_cpulist2hex_invert.py000064400000001160147205120270014672 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist2hex_invert(base.Function): """ Converts CPU list to hexadecimal CPU mask and inverts it """ def __init__(self): # arbitrary number of arguments super(cpulist2hex_invert, self).__init__("cpulist2hex_invert", 0) def execute(self, args): if not super(cpulist2hex_invert, self).execute(args): return None # current implementation inverts the CPU list and then converts it to hexmask return self._cmd.cpulist2hex(",".join(str(v) for v in self._cmd.cpulist_invert(",,".join(args)))) functions/function_cpulist_invert.py000064400000001223147205120270014103 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist_invert(base.Function): """ Inverts list of CPUs (makes its complement). For the complement it gets number of online CPUs from the /sys/devices/system/cpu/online, e.g. system with 4 CPUs (0-3), the inversion of list "0,2,3" will be "1" """ def __init__(self): # arbitrary number of arguments super(cpulist_invert, self).__init__("cpulist_invert", 0) def execute(self, args): if not super(cpulist_invert, self).execute(args): return None return ",".join(str(v) for v in self._cmd.cpulist_invert(",,".join(args))) functions/function_cpulist_online.py000064400000001213147205120270014057 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist_online(base.Function): """ Checks whether CPUs from list are online, returns list containing only online CPUs """ def __init__(self): # arbitrary number of arguments super(cpulist_online, self).__init__("cpulist_online", 0) def execute(self, args): if not super(cpulist_online, self).execute(args): return None cpus = self._cmd.cpulist_unpack(",".join(args)) online = self._cmd.cpulist_unpack(self._cmd.read_file("/sys/devices/system/cpu/online")) return ",".join(str(v) for v in cpus if v in online) functions/function_cpulist_pack.py000064400000001175147205120270013520 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist_pack(base.Function): """ Conversion function: packs CPU list in form 1,2,3,5 to 1-3,5. The cpulist_unpack is used as a preprocessor, so it always returns optimal results. For details about input syntax see cpulist_unpack. """ def __init__(self): # arbitrary number of arguments super(cpulist_pack, self).__init__("cpulist_pack", 0) def execute(self, args): if not super(cpulist_pack, self).execute(args): return None return ",".join(str(v) for v in self._cmd.cpulist_pack(",,".join(args))) functions/function_cpulist_present.py000064400000001263147205120270014260 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist_present(base.Function): """ Checks whether CPUs from list are present, returns list containing only present CPUs """ def __init__(self): # arbitrary number of arguments super(cpulist_present, self).__init__("cpulist_present", 0) def execute(self, args): if not super(cpulist_present, self).execute(args): return None cpus = self._cmd.cpulist_unpack(",,".join(args)) present = self._cmd.cpulist_unpack(self._cmd.read_file("/sys/devices/system/cpu/present")) return ",".join(str(v) for v in sorted(list(set(cpus).intersection(set(present))))) functions/function_cpulist_unpack.py000064400000000777147205120270014072 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class cpulist_unpack(base.Function): """ Conversion function: unpacks CPU list in form 1-3,4 to 1,2,3,4 """ def __init__(self): # arbitrary number of arguments super(cpulist_unpack, self).__init__("cpulist_unpack", 0) def execute(self, args): if not super(cpulist_unpack, self).execute(args): return None return ",".join(str(v) for v in self._cmd.cpulist_unpack(",,".join(args))) functions/function_exec.py000064400000000747147205120270011767 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands class execute(base.Function): """ Executes process and substitutes its output. """ def __init__(self): # unlimited number of arguments, min 1 argument (the name of executable) super(execute, self).__init__("exec", 0, 1) def execute(self, args): if not super(execute, self).execute(args): return None (ret, out) = self._cmd.execute(args) if ret == 0: return out return None functions/function_hex2cpulist.py000064400000000730147205120270013305 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands log = tuned.logs.get() class hex2cpulist(base.Function): """ Conversion function: converts hexadecimal CPU mask to CPU list """ def __init__(self): # 1 argument super(hex2cpulist, self).__init__("hex2cpulist", 1, 1) def execute(self, args): if not super(hex2cpulist, self).execute(args): return None return ",".join(str(v) for v in self._cmd.hex2cpulist(args[0])) functions/function_kb2s.py000064400000000625147205120270011677 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands class kb2s(base.Function): """ Conversion function: kbytes to sectors """ def __init__(self): # 1 argument super(kb2s, self).__init__("kb2s", 1, 1) def execute(self, args): if not super(kb2s, self).execute(args): return None try: return str(int(args[0]) * 2) except ValueError: return None functions/function_regex_search_ternary.py000064400000001052147205120270015234 0ustar00import re from . import base class regex_search_ternary(base.Function): """ Ternary regex operator, it takes arguments in the following form STR1, REGEX, STR2, STR3 If REGEX matches STR1 (re.search is used), STR2 is returned, otherwise STR3 is returned """ def __init__(self): # 4 arguments super(regex_search_ternary, self).__init__("regex_search_ternary", 4, 4) def execute(self, args): if not super(regex_search_ternary, self).execute(args): return None if re.search(args[1], args[0]): return args[2] else: return args[3] functions/function_s2kb.py000064400000000641147205120270011675 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands class s2kb(base.Function): """ Conversion function: sectors to kbytes """ def __init__(self): # 1 argument super(s2kb, self).__init__("s2kb", 1, 1) def execute(self, args): if not super(s2kb, self).execute(args): return None try: return str(int(round(int(args[0]) / 2))) except ValueError: return None functions/function_strip.py000064400000000626147205120270012200 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands class strip(base.Function): """ Makes string from all arguments and strip it """ def __init__(self): # unlimited number of arguments, min 1 argument super(strip, self).__init__("strip", 0, 1) def execute(self, args): if not super(strip, self).execute(args): return None return "".join(args).strip() functions/function_virt_check.py000064400000001123147205120270013151 0ustar00import os import tuned.logs from . import base from tuned.utils.commands import commands class virt_check(base.Function): """ Checks whether running inside virtual machine (VM) or on bare metal. If running inside VM expands to argument 1, otherwise expands to argument 2 (even on error). """ def __init__(self): # 2 arguments super(virt_check, self).__init__("virt_check", 2, 2) def execute(self, args): if not super(virt_check, self).execute(args): return None (ret, out) = self._cmd.execute(["virt-what"]) if ret == 0 and len(out) > 0: return args[0] return args[1] functions/functions.py000064400000004142147205120270011137 0ustar00import os import re import glob from . import repository import tuned.logs import tuned.consts as consts from tuned.utils.commands import commands log = tuned.logs.get() cmd = commands() class Functions(): """ Built-in functions """ def __init__(self): self._repository = repository.Repository() self._parse_init() def _parse_init(self, s = ""): self._cnt = 0 self._str = s self._len = len(s) self._stack = [] self._esc = False def _curr_char(self): return self._str[self._cnt] if self._cnt < self._len else "" def _curr_substr(self, _len): return self._str[self._cnt:self._cnt + _len] def _push_pos(self, esc): self._stack.append((esc, self._cnt)) def _sub(self, a, b, s): self._str = self._str[:a] + s + self._str[b + 1:] self._len = len(self._str) self._cnt += len(s) - (b - a + 1) if self._cnt < 0: self._cnt = 0 def _process_func(self, _from): sl = re.split(r'(? 1: log.info("loading profiles: %s" % ", ".join(profile_names)) else: log.info("loading profile: %s" % profile_names[0]) profiles = [] processed_files = [] self._load_profile(profile_names, profiles, processed_files) if len(profiles) > 1: final_profile = self._profile_merger.merge(profiles) else: final_profile = profiles[0] final_profile.name = " ".join(profile_names) if "variables" in final_profile.units: self._variables.add_from_cfg(final_profile.units["variables"].options) del(final_profile.units["variables"]) # FIXME hack, do all variable expansions in one place self._expand_vars_in_devices(final_profile) self._expand_vars_in_regexes(final_profile) return final_profile def _expand_vars_in_devices(self, profile): for unit in profile.units: profile.units[unit].devices = self._variables.expand(profile.units[unit].devices) def _expand_vars_in_regexes(self, profile): for unit in profile.units: profile.units[unit].cpuinfo_regex = self._variables.expand(profile.units[unit].cpuinfo_regex) profile.units[unit].uname_regex = self._variables.expand(profile.units[unit].uname_regex) def _load_profile(self, profile_names, profiles, processed_files): for name in profile_names: filename = self._profile_locator.get_config(name, processed_files) if filename == "": continue if filename is None: raise InvalidProfileException("Cannot find profile '%s' in '%s'." % (name, list(reversed(self._profile_locator._load_directories)))) processed_files.append(filename) config = self._load_config_data(filename) profile = self._profile_factory.create(name, config) if "include" in profile.options: include_names = re.split(r"\s*[,;]\s*", self._variables.expand(profile.options.pop("include"))) self._load_profile(include_names, profiles, processed_files) profiles.append(profile) def _expand_profile_dir(self, profile_dir, string): return re.sub(r'(?