__pycache__/function_assertion_non_equal.cpython-39.pyc000064400000002466151116471670017403 0ustar00a ,¡g+ã@sTddlZddlZddlmZddlmZddlmZej   ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommands)ÚInvalidProfileExceptioncs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úassertion_non_equalzº 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. cstt|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úY/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_assertion_non_equal.pyr szassertion_non_equal.__init__csXtt|ƒ |¡sdS|d|dkrTt d|d|d|df¡td|dƒ‚dS)Nréz#assertion '%s' failed: '%s' == '%s'rzAssertion '%s' failed.)rrÚexecuteÚlogÚerrorr)r Úargsr r rrs  zassertion_non_equal.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rÚ __classcell__r r r rr s r)ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZtuned.profiles.exceptionsrZlogsÚgetrZFunctionrr r r rÚs     __pycache__/function_calc_isolated_cores.cpython-39.opt-1.pyc000064400000003543151116471670020250 0ustar00a ,¡gkã@sPddlZddlZddlZddlmZddlmZej  ¡Z Gdd„dej ƒZ dS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcalc_isolated_coreszÒ 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. cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úY/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_calc_isolated_cores.pyrszcalc_isolated_cores.__init__c sFtt|ƒ |¡sdSd}t|ƒdkrh|d ¡r@t|dƒdkr\t d|d|jf¡dSt|dƒ}i}t   t j   tjd¡¡D]|}t j  |¡dd…}| ¡r‚t j   |d¡}t j  |¡sÐt d||f¡q‚|j |¡ ¡}| ¡r‚| |g¡|g||<q‚g}| ¡D]"} | jtd|| |d…}q |jtdd   |¡S) NrrzPinvalid argument '%s' for builtin function '%s', it must be non-negative integerzcpu*éztopology/physical_package_idz(file '%s' does not exist, cpu%s offline?)Úkeyú,)rrÚexecuteÚlenÚ isdecimalÚintÚlogÚerrorÚ_nameÚglobZiglobÚosÚpathÚjoinÚconstsZSYSFS_CPUS_PATHÚbasenameÚexistsÚdebugZ_cmdZ read_fileÚstripÚgetÚvaluesÚsort) rÚargsZ cpus_reserveZtopoZcpuZcpuidZphysical_package_idZsocketZ isol_cpusZcpusrr r rs6  ÿ     zcalc_isolated_cores.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r rr r s r) rrZ tuned.logsZtunedÚrZ tuned.constsrZlogsrrZFunctionrr r r r Ús    __pycache__/function_calc_isolated_cores.cpython-39.pyc000064400000003543151116471670017311 0ustar00a ,¡gkã@sPddlZddlZddlZddlmZddlmZej  ¡Z Gdd„dej ƒZ dS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcalc_isolated_coreszÒ 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. cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úY/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_calc_isolated_cores.pyrszcalc_isolated_cores.__init__c sFtt|ƒ |¡sdSd}t|ƒdkrh|d ¡r@t|dƒdkr\t d|d|jf¡dSt|dƒ}i}t   t j   tjd¡¡D]|}t j  |¡dd…}| ¡r‚t j   |d¡}t j  |¡sÐt d||f¡q‚|j |¡ ¡}| ¡r‚| |g¡|g||<q‚g}| ¡D]"} | jtd|| |d…}q |jtdd   |¡S) NrrzPinvalid argument '%s' for builtin function '%s', it must be non-negative integerzcpu*éztopology/physical_package_idz(file '%s' does not exist, cpu%s offline?)Úkeyú,)rrÚexecuteÚlenÚ isdecimalÚintÚlogÚerrorÚ_nameÚglobZiglobÚosÚpathÚjoinÚconstsZSYSFS_CPUS_PATHÚbasenameÚexistsÚdebugZ_cmdZ read_fileÚstripÚgetÚvaluesÚsort) rÚargsZ cpus_reserveZtopoZcpuZcpuidZphysical_package_idZsocketZ isol_cpusZcpusrr r rs6  ÿ     zcalc_isolated_cores.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r rr r s r) rrZ tuned.logsZtunedÚrZ tuned.constsrZlogsrrZFunctionrr r r r Ús    __pycache__/function_check_net_queue_count.cpython-39.opt-1.pyc000064400000002216151116471670020622 0ustar00a ,¡gã@s4ddlZddlmZej ¡ZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcheck_net_queue_countz€ Checks whether the user has specified a queue count for net devices. If not, return the number of housekeeping CPUs. cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©ú[/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_check_net_queue_count.pyr szcheck_net_queue_count.__init__csLtt|ƒ |¡sdS|d ¡r(|dS|j dg¡\}}t d|¡|S)NrZnproczHnet-dev queue count is not correctly specified, setting it to HK CPUs %s)rrÚexecuteÚisdigitZ_cmdÚlogZwarning)rÚargsÚretÚoutrr r r s zcheck_net_queue_count.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr Ú __classcell__r r rr rs r) Z tuned.logsZtunedÚrZlogsÚgetrZFunctionrr r r r Ús  __pycache__/function_check_net_queue_count.cpython-39.pyc000064400000002216151116471670017663 0ustar00a ,¡gã@s4ddlZddlmZej ¡ZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcheck_net_queue_countz€ Checks whether the user has specified a queue count for net devices. If not, return the number of housekeeping CPUs. cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©ú[/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_check_net_queue_count.pyr szcheck_net_queue_count.__init__csLtt|ƒ |¡sdS|d ¡r(|dS|j dg¡\}}t d|¡|S)NrZnproczHnet-dev queue count is not correctly specified, setting it to HK CPUs %s)rrÚexecuteÚisdigitZ_cmdÚlogZwarning)rÚargsÚretÚoutrr r r s zcheck_net_queue_count.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr Ú __classcell__r r rr rs r) Z tuned.logsZtunedÚrZlogsÚgetrZFunctionrr r r r Ús  __pycache__/function_cpuinfo_check.cpython-39.opt-1.pyc000064400000002732151116471670017066 0ustar00a ,¡góã@s<ddlZddlZddlmZej ¡ZGdd„dejƒZ dS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpuinfo_checkaª 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. cstt|ƒ ddd¡dS)Nrré)ÚsuperrÚ__init__)Úself©Ú __class__©úS/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpuinfo_check.pyrszcpuinfo_check.__init__cs†tt|ƒ |¡sdS|j d¡}tdt|ƒdƒD]8}|dt|ƒkr0t |||tj ¡r0||dSq0t|ƒdr~|dSdSdS)Nz /proc/cpuinforrréÿÿÿÿÚ) rrÚexecuteZ_cmdZ read_fileÚrangeÚlenÚreÚsearchÚ MULTILINE)rÚargsZcpuinfoÚir r r rs  zcpuinfo_check.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) rZ tuned.logsZtunedrrZlogsÚgetÚlogZFunctionrr r r r Ús  __pycache__/function_cpuinfo_check.cpython-39.pyc000064400000002732151116471670016127 0ustar00a ,¡góã@s<ddlZddlZddlmZej ¡ZGdd„dejƒZ dS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpuinfo_checkaª 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. cstt|ƒ ddd¡dS)Nrré)ÚsuperrÚ__init__)Úself©Ú __class__©úS/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpuinfo_check.pyrszcpuinfo_check.__init__cs†tt|ƒ |¡sdS|j d¡}tdt|ƒdƒD]8}|dt|ƒkr0t |||tj ¡r0||dSq0t|ƒdr~|dSdSdS)Nz /proc/cpuinforrréÿÿÿÿÚ) rrÚexecuteZ_cmdZ read_fileÚrangeÚlenÚreÚsearchÚ MULTILINE)rÚargsZcpuinfoÚir r r rs  zcpuinfo_check.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) rZ tuned.logsZtunedrrZlogsÚgetÚlogZFunctionrr r r r Ús  __pycache__/function_cpulist2devs.cpython-39.opt-1.pyc000064400000001703151116471670016712 0ustar00a ,¡gÌã@s4ddlZddlmZej ¡ZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpulist2devsz< Conversion function: converts CPU list to device strings cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úR/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist2devs.pyr szcpulist2devs.__init__cs2tt|ƒ |¡sdS|jj|j d |¡¡ddS)Nú,Zcpu)Úprefix)rrÚexecuteZ_cmdZcpulist2stringZcpulist_unpackÚjoin)rÚargsrr r rszcpulist2devs.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r rr rs r) Z tuned.logsZtunedÚrZlogsÚgetÚlogZFunctionrr r r r Ús  __pycache__/function_cpulist2devs.cpython-39.pyc000064400000001703151116471670015753 0ustar00a ,¡gÌã@s4ddlZddlmZej ¡ZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpulist2devsz< Conversion function: converts CPU list to device strings cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úR/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist2devs.pyr szcpulist2devs.__init__cs2tt|ƒ |¡sdS|jj|j d |¡¡ddS)Nú,Zcpu)Úprefix)rrÚexecuteZ_cmdZcpulist2stringZcpulist_unpackÚjoin)rÚargsrr r rszcpulist2devs.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r rr rs r) Z tuned.logsZtunedÚrZlogsÚgetÚlogZFunctionrr r r r Ús  __pycache__/function_cpulist2hex.cpython-39.opt-1.pyc000064400000001716151116471670016541 0ustar00a ,¡gÖã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpulist2hexzB Conversion function: converts CPU list to hexadecimal CPU mask cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úQ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist2hex.pyr szcpulist2hex.__init__cs&tt|ƒ |¡sdS|j d |¡¡S)Nz,,)rrÚexecuteZ_cmdÚjoin)rÚargsr r r r szcpulist2hex.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr Ú __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist2hex.cpython-39.pyc000064400000001716151116471670015602 0ustar00a ,¡gÖã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpulist2hexzB Conversion function: converts CPU list to hexadecimal CPU mask cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úQ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist2hex.pyr szcpulist2hex.__init__cs&tt|ƒ |¡sdS|j d |¡¡S)Nz,,)rrÚexecuteZ_cmdÚjoin)rÚargsr r r r szcpulist2hex.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr Ú __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist2hex_invert.cpython-39.opt-1.pyc000064400000002265151116471670020130 0ustar00a ,¡gpã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist2hex_invertz< Converts CPU list to hexadecimal CPU mask and inverts it cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úX/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist2hex_invert.pyr szcpulist2hex_invert.__init__c s>tt|ƒ |¡sdS|j d dd„|j d |¡¡Dƒ¡¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz-cpulist2hex_invert.execute..z,,)rrÚexecuteZ_cmdZ cpulist2hexÚjoinZcpulist_invert)rÚargsr r r rszcpulist2hex_invert.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist2hex_invert.cpython-39.pyc000064400000002265151116471670017171 0ustar00a ,¡gpã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist2hex_invertz< Converts CPU list to hexadecimal CPU mask and inverts it cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úX/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist2hex_invert.pyr szcpulist2hex_invert.__init__c s>tt|ƒ |¡sdS|j d dd„|j d |¡¡Dƒ¡¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz-cpulist2hex_invert.execute..z,,)rrÚexecuteZ_cmdZ cpulist2hexÚjoinZcpulist_invert)rÚargsr r r rszcpulist2hex_invert.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_invert.cpython-39.opt-1.pyc000064400000002426151116471670017340 0ustar00a ,¡g“ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_invertzÖ 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" cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úT/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_invert.pyrszcpulist_invert.__init__cs6tt|ƒ |¡sdSd dd„|j d |¡¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz)cpulist_invert.execute..z,,)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszcpulist_invert.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_invert.cpython-39.pyc000064400000002426151116471670016401 0ustar00a ,¡g“ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_invertzÖ 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" cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úT/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_invert.pyrszcpulist_invert.__init__cs6tt|ƒ |¡sdSd dd„|j d |¡¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz)cpulist_invert.execute..z,,)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszcpulist_invert.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_online.cpython-39.opt-1.pyc000064400000002401151116471670017306 0ustar00a ,¡g‹ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_onlinezW Checks whether CPUs from list are online, returns list containing only online CPUs cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úT/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_online.pyr szcpulist_online.__init__csRtt|ƒ |¡sdS|j d |¡¡}|j |j d¡¡‰d ‡fdd„|Dƒ¡S)Nú,z/sys/devices/system/cpu/onlinec3s|]}|ˆvrt|ƒVqdS)N)Ústr)Ú.0Úv©Zonliner r Ú óz)cpulist_online.execute..)rrÚexecuteZ_cmdZcpulist_unpackÚjoinZ read_file)rÚargsZcpusr rr rs zcpulist_online.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_online.cpython-39.pyc000064400000002401151116471670016347 0ustar00a ,¡g‹ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_onlinezW Checks whether CPUs from list are online, returns list containing only online CPUs cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úT/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_online.pyr szcpulist_online.__init__csRtt|ƒ |¡sdS|j d |¡¡}|j |j d¡¡‰d ‡fdd„|Dƒ¡S)Nú,z/sys/devices/system/cpu/onlinec3s|]}|ˆvrt|ƒVqdS)N)Ústr)Ú.0Úv©Zonliner r Ú óz)cpulist_online.execute..)rrÚexecuteZ_cmdZcpulist_unpackÚjoinZ read_file)rÚargsZcpusr rr rs zcpulist_online.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_pack.cpython-39.opt-1.pyc000064400000002400151116471670016737 0ustar00a ,¡g}ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpulist_packzÊ 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. cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úR/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_pack.pyrszcpulist_pack.__init__cs6tt|ƒ |¡sdSd dd„|j d |¡¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz'cpulist_pack.execute..z,,)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszcpulist_pack.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_pack.cpython-39.pyc000064400000002400151116471670016000 0ustar00a ,¡g}ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú cpulist_packzÊ 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. cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úR/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_pack.pyrszcpulist_pack.__init__cs6tt|ƒ |¡sdSd dd„|j d |¡¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz'cpulist_pack.execute..z,,)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszcpulist_pack.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_present.cpython-39.opt-1.pyc000064400000002474151116471670017514 0ustar00a ,¡g³ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_presentzY Checks whether CPUs from list are present, returns list containing only present CPUs cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úU/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_present.pyr szcpulist_present.__init__c sdtt|ƒ |¡sdS|j d |¡¡}|j |j d¡¡}d dd„ttt |ƒ  t |ƒ¡ƒƒDƒ¡S)Nz,,z/sys/devices/system/cpu/presentú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz*cpulist_present.execute..) rrÚexecuteZ_cmdZcpulist_unpackÚjoinZ read_fileÚsortedÚlistÚsetÚ intersection)rÚargsZcpusZpresentr r r rs zcpulist_present.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_present.cpython-39.pyc000064400000002474151116471670016555 0ustar00a ,¡g³ã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_presentzY Checks whether CPUs from list are present, returns list containing only present CPUs cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úU/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_present.pyr szcpulist_present.__init__c sdtt|ƒ |¡sdS|j d |¡¡}|j |j d¡¡}d dd„ttt |ƒ  t |ƒ¡ƒƒDƒ¡S)Nz,,z/sys/devices/system/cpu/presentú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz*cpulist_present.execute..) rrÚexecuteZ_cmdZcpulist_unpackÚjoinZ read_fileÚsortedÚlistÚsetÚ intersection)rÚargsZcpusZpresentr r r rs zcpulist_present.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_unpack.cpython-39.opt-1.pyc000064400000002202151116471670017302 0ustar00a ,¡gÿã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_unpackzB Conversion function: unpacks CPU list in form 1-3,4 to 1,2,3,4 cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úT/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_unpack.pyr szcpulist_unpack.__init__cs6tt|ƒ |¡sdSd dd„|j d |¡¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz)cpulist_unpack.execute..z,,)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszcpulist_unpack.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_cpulist_unpack.cpython-39.pyc000064400000002202151116471670016343 0ustar00a ,¡gÿã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úcpulist_unpackzB Conversion function: unpacks CPU list in form 1-3,4 to 1,2,3,4 cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úT/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_cpulist_unpack.pyr szcpulist_unpack.__init__cs6tt|ƒ |¡sdSd dd„|j d |¡¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz)cpulist_unpack.execute..z,,)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszcpulist_unpack.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_exec.cpython-39.opt-1.pyc000064400000001645151116471670015214 0ustar00a ,¡gçã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úexecutez0 Executes process and substitutes its output. cstt|ƒ ddd¡dS)NÚexecrr)ÚsuperrÚ__init__)Úself©Ú __class__©úJ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_exec.pyr szexecute.__init__cs4tt|ƒ |¡sdS|j |¡\}}|dkr0|SdS)Nr)rrZ_cmd)r ÚargsÚretÚoutr r r rs zexecute.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_exec.cpython-39.pyc000064400000001645151116471670014255 0ustar00a ,¡gçã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úexecutez0 Executes process and substitutes its output. cstt|ƒ ddd¡dS)NÚexecrr)ÚsuperrÚ__init__)Úself©Ú __class__©úJ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_exec.pyr szexecute.__init__cs4tt|ƒ |¡sdS|j |¡\}}|dkr0|SdS)Nr)rrZ_cmd)r ÚargsÚretÚoutr r r rs zexecute.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_hex2cpulist.cpython-39.opt-1.pyc000064400000002164151116471670016537 0ustar00a ,¡gØã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú hex2cpulistzB Conversion function: converts hexadecimal CPU mask to CPU list cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úQ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_hex2cpulist.pyr szhex2cpulist.__init__cs4tt|ƒ |¡sdSd dd„|j |d¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz&hex2cpulist.execute..r)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszhex2cpulist.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_hex2cpulist.cpython-39.pyc000064400000002164151116471670015600 0ustar00a ,¡gØã@sHddlZddlZddlmZddlmZej ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú hex2cpulistzB Conversion function: converts hexadecimal CPU mask to CPU list cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úQ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_hex2cpulist.pyr szhex2cpulist.__init__cs4tt|ƒ |¡sdSd dd„|j |d¡Dƒ¡S)Nú,css|]}t|ƒVqdS)N)Ústr)Ú.0Úvr r r Ú óz&hex2cpulist.execute..r)rrÚexecuteÚjoinZ_cmd)rÚargsr r r rszhex2cpulist.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZlogsÚgetÚlogZFunctionrr r r r Ús    __pycache__/function_kb2s.cpython-39.opt-1.pyc000064400000001664151116471670015132 0ustar00a ,¡g•ã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úkb2sz* Conversion function: kbytes to sectors cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úJ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_kb2s.pyr sz kb2s.__init__csDtt|ƒ |¡sdSztt|dƒdƒWSty>YdS0dS)Nré)rrÚexecuteÚstrÚintÚ ValueError)rÚargsr r r rs  z kb2s.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_kb2s.cpython-39.pyc000064400000001664151116471670014173 0ustar00a ,¡g•ã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úkb2sz* Conversion function: kbytes to sectors cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úJ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_kb2s.pyr sz kb2s.__init__csDtt|ƒ |¡sdSztt|dƒdƒWSty>YdS0dS)Nré)rrÚexecuteÚstrÚintÚ ValueError)rÚargsr r r rs  z kb2s.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_regex_search_ternary.cpython-39.opt-1.pyc000064400000002046151116471670020467 0ustar00a ,¡g*ã@s*ddlZddlmZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úregex_search_ternaryz· 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 cstt|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úZ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_regex_search_ternary.pyr szregex_search_ternary.__init__cs<tt|ƒ |¡sdSt |d|d¡r0|dS|dSdS)Nrréé)rrÚexecuteÚreÚsearch)rÚargsr r r rs zregex_search_ternary.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r)rÚrZFunctionrr r r r Ús __pycache__/function_regex_search_ternary.cpython-39.pyc000064400000002046151116471670017530 0ustar00a ,¡g*ã@s*ddlZddlmZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úregex_search_ternaryz· 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 cstt|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úZ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_regex_search_ternary.pyr szregex_search_ternary.__init__cs<tt|ƒ |¡sdSt |d|d¡r0|dS|dSdS)Nrréé)rrÚexecuteÚreÚsearch)rÚargsr r r rs zregex_search_ternary.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r)rÚrZFunctionrr r r r Ús __pycache__/function_s2kb.cpython-39.opt-1.pyc000064400000001703151116471670015124 0ustar00a ,¡g¡ã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ús2kbz* Conversion function: sectors to kbytes cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úJ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_s2kb.pyr sz s2kb.__init__csLtt|ƒ |¡sdSztttt|dƒdƒƒƒWStyFYdS0dS)Nré)rrÚexecuteÚstrÚintÚroundÚ ValueError)rÚargsr r r rs  z s2kb.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_s2kb.cpython-39.pyc000064400000001703151116471670014165 0ustar00a ,¡g¡ã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ús2kbz* Conversion function: sectors to kbytes cstt|ƒ ddd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úJ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_s2kb.pyr sz s2kb.__init__csLtt|ƒ |¡sdSztttt|dƒdƒƒƒWStyFYdS0dS)Nré)rrÚexecuteÚstrÚintÚroundÚ ValueError)rÚargsr r r rs  z s2kb.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_strip.cpython-39.opt-1.pyc000064400000001606151116471670015426 0ustar00a ,¡g–ã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ústripz0 Makes string from all arguments and strip it cstt|ƒ ddd¡dS)Nrrr)ÚsuperrÚ__init__)Úself©Ú __class__©úK/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_strip.pyr szstrip.__init__cs"tt|ƒ |¡sdSd |¡ ¡S)NÚ)rrÚexecuteÚjoin)rÚargsr r r rsz strip.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedr rZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_strip.cpython-39.pyc000064400000001606151116471670014467 0ustar00a ,¡g–ã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ústripz0 Makes string from all arguments and strip it cstt|ƒ ddd¡dS)Nrrr)ÚsuperrÚ__init__)Úself©Ú __class__©úK/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_strip.pyr szstrip.__init__cs"tt|ƒ |¡sdSd |¡ ¡S)NÚ)rrÚexecuteÚjoin)rÚargsr r r rsz strip.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedr rZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_virt_check.cpython-39.opt-1.pyc000064400000002131151116471670016400 0ustar00a ,¡gSã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú 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|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úP/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_virt_check.pyr szvirt_check.__init__csJtt|ƒ |¡sdS|j dg¡\}}|dkrBt|ƒdkrB|dS|dS)Nz virt-whatrr)rrÚexecuteZ_cmdÚlen)r ÚargsÚretÚoutr r r rs zvirt_check.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/function_virt_check.cpython-39.pyc000064400000002131151116471670015441 0ustar00a ,¡gSã@s>ddlZddlZddlmZddlmZGdd„dejƒZdS)éNé)Úbase)Úcommandscs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú 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|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úP/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_virt_check.pyr szvirt_check.__init__csJtt|ƒ |¡sdS|j dg¡\}}|dkrBt|ƒdkrB|dS|dS)Nz virt-whatrr)rrÚexecuteZ_cmdÚlen)r ÚargsÚretÚoutr r r rs zvirt_check.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZFunctionrr r r r Ús  __pycache__/repository.cpython-39.opt-1.pyc000064400000004114151116471670014574 0ustar00a ,¡g³ã@sVddlmZddlmZddlmZddlZddlm Z ej   ¡Z Gdd„deƒZ dS)é)Ú ClassLoader)ÚParser)ÚFunctionNcsTeZdZdZ‡fdd„Zedd„ƒZdd„Zdd „Zd d „Z d d „Z dd„Z ‡Z S)Ú Repositoryzk Repository of functions used within TuneD profiles. The functions are loaded lazily (when first used). cstt|ƒ ¡i|_dS©N)ÚsuperrÚ__init__Ú _functions©Úself©Ú __class__©úG/usr/lib/python3.9/site-packages/tuned/profiles/functions/repository.pyrszRepository.__init__cCs|jSr)r r rrrÚ functionsszRepository.functionscCsd|_tj|_t|_dS)Nztuned.profiles.functions)Z _namespaceÚconstsZFUNCTION_PREFIXÚ_prefixrZ _interfacer rrrÚ_set_loader_parameterssz!Repository._set_loader_parameterscCs,t d|¡| |¡}|ƒ}||j|<|S)Nzcreating function %s)ÚlogÚdebugZ load_classr )r Ú function_nameZ function_clsZfunction_instancerrrÚcreates   zRepository.createcCs||jvr| |¡S|j|Sr)r r)r rrrrÚ load_func%s  zRepository.load_funccCs:t d|¡t|j ¡ƒD]\}}||kr|j|=qdS)Nzremoving function %s)rrÚlistr Úitems)r ÚfunctionÚkÚvrrrÚdelete*szRepository.deletecCst|ƒ |¡Sr)rÚexpand)r Úsrrrr1szRepository.expand) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚpropertyrrrrrrÚ __classcell__rrr rr s   r)Ztuned.utils.class_loaderrZtuned.profiles.functions.parserrZtuned.profiles.functions.baserZ tuned.logsZtunedZ tuned.constsrZlogsÚgetrrrrrrÚs     __pycache__/repository.cpython-39.pyc000064400000004157151116471670013644 0ustar00a ,¡g³ã@sVddlmZddlmZddlmZddlZddlm Z ej   ¡Z Gdd„deƒZ dS)é)Ú ClassLoader)ÚParser)ÚFunctionNcsTeZdZdZ‡fdd„Zedd„ƒZdd„Zdd „Zd d „Z d d „Z dd„Z ‡Z S)Ú Repositoryzk Repository of functions used within TuneD profiles. The functions are loaded lazily (when first used). cstt|ƒ ¡i|_dS©N)ÚsuperrÚ__init__Ú _functions©Úself©Ú __class__©úG/usr/lib/python3.9/site-packages/tuned/profiles/functions/repository.pyrszRepository.__init__cCs|jSr)r r rrrÚ functionsszRepository.functionscCsd|_tj|_t|_dS)Nztuned.profiles.functions)Z _namespaceÚconstsZFUNCTION_PREFIXÚ_prefixrÚ _interfacer rrrÚ_set_loader_parameterssz!Repository._set_loader_parameterscCs,t d|¡| |¡}|ƒ}||j|<|S)Nzcreating function %s)ÚlogÚdebugZ load_classr )r Ú function_nameZ function_clsZfunction_instancerrrÚcreates   zRepository.createcCs||jvr| |¡S|j|Sr)r r)r rrrrÚ load_func%s  zRepository.load_funccCsJt||jƒsJ‚t d|¡t|j ¡ƒD]\}}||kr,|j|=q,dS)Nzremoving function %s)Ú isinstancerrrÚlistr Úitems)r ÚfunctionÚkÚvrrrÚdelete*s zRepository.deletecCst|ƒ |¡Sr)rÚexpand)r Úsrrrr!1szRepository.expand) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚpropertyrrrrr r!Ú __classcell__rrr rr s   r)Ztuned.utils.class_loaderrZtuned.profiles.functions.parserrZtuned.profiles.functions.baserZ tuned.logsZtunedZ tuned.constsrZlogsÚgetrrrrrrÚs     __pycache__/function_lscpu_check.cpython-39.opt-1.pyc000064400000002705151116471670016551 0ustar00a ,¡gã@s<ddlZddlZddlmZej ¡ZGdd„dejƒZ dS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú lscpu_checka­ Checks regexes against the output of lscpu. Accepts arguments in the following form: REGEX1, STR1, REGEX2, STR2, ...[, STR_FALLBACK] If REGEX1 matches something in the output 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. cstt|ƒ ddd¡dS)Nrré)ÚsuperrÚ__init__)Úself©Ú __class__©úQ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_lscpu_check.pyrszlscpu_check.__init__csŠtt|ƒ |¡sdS|j d¡\}}tdt|ƒdƒD]8}|dt|ƒkr4t |||tj¡r4||dSq4t|ƒdr‚|dSdSdS)NÚlscpurrréÿÿÿÿÚ) rrÚexecuteZ_cmdÚrangeÚlenÚreÚsearchÚ MULTILINE)rÚargsÚ_r Úir r r rs zlscpu_check.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) rZ tuned.logsZtunedrrZlogsÚgetÚlogZFunctionrr r r r Ús  __pycache__/function_lscpu_check.cpython-39.pyc000064400000002705151116471670015612 0ustar00a ,¡gã@s<ddlZddlZddlmZej ¡ZGdd„dejƒZ dS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú lscpu_checka­ Checks regexes against the output of lscpu. Accepts arguments in the following form: REGEX1, STR1, REGEX2, STR2, ...[, STR_FALLBACK] If REGEX1 matches something in the output 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. cstt|ƒ ddd¡dS)Nrré)ÚsuperrÚ__init__)Úself©Ú __class__©úQ/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_lscpu_check.pyrszlscpu_check.__init__csŠtt|ƒ |¡sdS|j d¡\}}tdt|ƒdƒD]8}|dt|ƒkr4t |||tj¡r4||dSq4t|ƒdr‚|dSdSdS)NÚlscpurrréÿÿÿÿÚ) rrÚexecuteZ_cmdÚrangeÚlenÚreÚsearchÚ MULTILINE)rÚargsÚ_r Úir r r rs zlscpu_check.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) rZ tuned.logsZtunedrrZlogsÚgetÚlogZFunctionrr r r r Ús  __pycache__/function_package2cpus.cpython-39.pyc000064400000003174151116471670015700 0ustar00a ,¡gõã@s\ddlZddlZddlmZddlmZddlmZe ¡Z eƒZ dZ Gdd„dej ƒZ dS) éNé)Úbase)Úcommands)Úlogsz/sys/devices/system/cpu/cs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú package2cpusz3 Provides cpu device list for a package (socket) cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úR/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_package2cpus.pyrszpackage2cpus.__init__c s8tt|ƒ |¡sdSt|ƒdkr$dSzt t t¡d¡}Wnt yNYdS0g}|D]Â}t|d}tj   |¡s„t   d|¡qXt |¡}z t|ƒ}Wn(tyÂt   d||f¡YqXYn0|D]P}z t|ƒ} Wn,tyt ||¡r| |¡YqÈ0|| krÈ| |¡qÈqXt|ƒdkr4d |¡SdS)Nrz cpu[0-9]*z/topology/physical_package_idzFile '%s' does not existz$Invalid package id '%s' for cpu '%s'ú,)rrÚexecuteÚlenÚfnmatchÚfilterÚosÚlistdirÚ SYSFS_DIRÚOSErrorÚpathÚexistsÚlogZwarningÚcmdZ read_fileÚintÚ ValueErrorÚappendÚjoin) r ÚargsZall_cpusZdevicesZcpuÚfÚvalueZ package_idZpackage_patternZthis_package_idr r r rs:         zpackage2cpus.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r r s r)rrÚrZtuned.utils.commandsrZtunedrÚgetrrrZFunctionrr r r r Ús   __pycache__/function_package2uncores.cpython-39.pyc000064400000003370151116471670016402 0ustar00a ,¡gdã@s\ddlZddlZddlmZddlmZddlmZe ¡Z eƒZ dZ Gdd„dej ƒZ dS) éNé)Úbase)Úcommands)Úlogsz//sys/devices/system/cpu/intel_uncore_frequency/cs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úpackage2uncoresz6 Provides uncore device list for a package (socket) cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úU/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_package2uncores.pyrszpackage2uncores.__init__c shtt|ƒ |¡sdSt|ƒdkr$dSzt t¡}WntyFYdS0t  |d¡}t|ƒdkrjd}|}nd}g}|D]Ô}|r²t|d}tj   |¡s¦t   d|¡qvt |¡}n |dd…}z t|ƒ} Wn(tyòt   d ||f¡YqvYn0|D]P} z t| ƒ} Wn,ty4t || ¡r0| |¡Yqø0| | krø| |¡qøqvt|ƒdkrdd  |¡SdS) Nrzuncore*TFz /package_idzFile '%s' does not existéé z'Invalid package id '%s' for uncore '%s'ú,)rrÚexecuteÚlenÚosÚlistdirÚ SYSFS_DIRÚOSErrorÚfnmatchÚfilterÚpathÚexistsÚlogZwarningÚcmdZ read_fileÚintÚ ValueErrorÚappendÚjoin) r ÚargsZ all_uncoresZ tpmi_devicesZis_tpmiZdevicesZuncoreÚfÚvalueZ package_idZpackage_patternZthis_package_idr r r rsH            zpackage2uncores.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r r s r)rrÚrZtuned.utils.commandsrZtunedrÚgetrrrZFunctionrr r r r Ús   __pycache__/parser.cpython-39.opt-1.pyc000064400000006142151116471670013654 0ustar00a ,¡gaã@s>ddlZddlZddlmZej ¡ZeƒZGdd„dƒZ dS)éN)Úcommandsc@sZeZdZdZdd„Zddd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dS)ÚParserz; Parser used for expanding strings containing functions. cCs ||_dS©N)Ú _repository)ÚselfZ repository©rúC/usr/lib/python3.9/site-packages/tuned/profiles/functions/parser.pyÚ__init__szParser.__init__ÚcCs&d|_||_t|ƒ|_g|_d|_dS)NrF)Ú_cntÚ_strÚlenÚ_lenÚ_stackÚ_esc©rÚsrrrÚ _parse_inits  zParser._parse_initcCs|j|jkr|j|jSdS)Nr )r rr )rrrrÚ _curr_charszParser._curr_charcCs|j|j|j|…Sr)r r )rrrrrÚ _curr_substrszParser._curr_substrcCs|j ||jf¡dSr)rÚappendr )rZescrrrÚ _push_posszParser._push_poscCsd|jd|…||j|dd…|_t|jƒ|_|jt|ƒ||d7_|jdkr`d|_dS)Nér)r r rr )rÚaÚbrrrrÚ_sub!s &  z Parser._subcCsêt d|j||j…¡}|ddkr(dSdd„|Dƒ}t d|d¡s\t d|d¡dSz|j |d¡}Wn&t y–t d |d¡YdS0|  |d d…¡}t  d d   |dd…¡|f¡|durÖdS|  ||j|¡dS) Nz(?,óz(Parser._process_func..z\w+$rzinvalid function name '%s'zfunction '%s' not implementedéz${f:%s} expands to: '%s'r)ÚreÚsplitr r ÚmatchÚlogÚerrorrZ load_funcÚ ImportErrorZexecuteÚdebugÚjoinr)rZ_fromÚslÚfrrrrÚ _process_func(s"   zParser._process_funccCsÒ| |¡|j|jkr´| ¡dkrpz|j ¡}Wn&tyVt d|¡|j YS0|dsŠ|  |d¡n|  d¡dkrŠ|  |j ¡| ¡dkržd|_ nd |_ |jd7_q t|jƒrÌt d |¡|j S) NÚ}z.invalid variable syntax, non pair '}' in: '%s'rrr#z${ú\TFz.invalid variable syntax, non pair '{' in: '%s')rr rrrÚpopÚ IndexErrorr'r(r r.rrrr )rrÚsirrrÚ_process;s&        zParser._processcCs(|dus|dkr|St dd| |¡¡S)Nr z \\(\${f:.*})z\1)r$Úsubr4rrrrÚexpandRsz Parser.expandN)r ) Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrrrr.r4r6rrrrr s r) r$Z tuned.logsZtunedZtuned.utils.commandsrZlogsÚgetr'ÚcmdrrrrrÚs   __pycache__/__init__.cpython-39.opt-1.pyc000064400000000315151116471670014113 0ustar00a ,¡g#ã@sddlmZdS)é)Ú RepositoryN)Z repositoryr©rrúE/usr/lib/python3.9/site-packages/tuned/profiles/functions/__init__.pyÚó__pycache__/__init__.cpython-39.pyc000064400000000315151116471670013154 0ustar00a ,¡g#ã@sddlmZdS)é)Ú RepositoryN)Z repositoryr©rrúE/usr/lib/python3.9/site-packages/tuned/profiles/functions/__init__.pyÚó__pycache__/base.cpython-39.opt-1.pyc000064400000002254151116471670013272 0ustar00a ,¡gã@s:ddlZddlZddlmZej ¡ZGdd„deƒZ dS)éN)Úcommandsc@s0eZdZdZd dd„Zed dd„ƒZdd„ZdS) ÚFunctionz Built-in function NcCs||_||_||_tƒ|_dS)N)Ú_nameÚ _nargs_maxÚ _nargs_minrZ_cmd)ÚselfÚnameÚ nargs_maxÚ nargs_min©r úA/usr/lib/python3.9/site-packages/tuned/profiles/functions/base.pyÚ__init__ szFunction.__init__cCs<|dus|durdSt|ƒ}|dks,||ko:|dup:||kS)NFr)Úlen)ÚclsÚargsr r Zlar r r Ú _check_argsszFunction._check_argscCs*| ||j|j¡rdSt d|j¡dS)NTz5invalid number of arguments for builtin function '%s'F)rrrÚlogÚerrorr)rrr r r ÚexecuteszFunction.execute)N)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r Ú classmethodrrr r r r rs   r) ÚosZ tuned.logsZtunedZtuned.utils.commandsrZlogsÚgetrÚobjectrr r r r Ús  __pycache__/base.cpython-39.pyc000064400000002254151116471670012333 0ustar00a ,¡gã@s:ddlZddlZddlmZej ¡ZGdd„deƒZ dS)éN)Úcommandsc@s0eZdZdZd dd„Zed dd„ƒZdd„ZdS) ÚFunctionz Built-in function NcCs||_||_||_tƒ|_dS)N)Ú_nameÚ _nargs_maxÚ _nargs_minrZ_cmd)ÚselfÚnameÚ nargs_maxÚ nargs_min©r úA/usr/lib/python3.9/site-packages/tuned/profiles/functions/base.pyÚ__init__ szFunction.__init__cCs<|dus|durdSt|ƒ}|dks,||ko:|dup:||kS)NFr)Úlen)ÚclsÚargsr r Zlar r r Ú _check_argsszFunction._check_argscCs*| ||j|j¡rdSt d|j¡dS)NTz5invalid number of arguments for builtin function '%s'F)rrrÚlogÚerrorr)rrr r r ÚexecuteszFunction.execute)N)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r Ú classmethodrrr r r r rs   r) ÚosZ tuned.logsZtunedZtuned.utils.commandsrZlogsÚgetrÚobjectrr r r r Ús  __pycache__/function_assertion.cpython-39.opt-1.pyc000064400000002412151116471670016270 0ustar00a ,¡gÿã@sTddlZddlZddlmZddlmZddlmZej   ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommands)ÚInvalidProfileExceptioncs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú assertionz¶ 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. cstt|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úO/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_assertion.pyr szassertion.__init__csXtt|ƒ |¡sdS|d|dkrTt d|d|d|df¡td|dƒ‚dS)Nréz#assertion '%s' failed: '%s' != '%s'rzAssertion '%s' failed.)rrÚexecuteÚlogÚerrorr)r Úargsr r rrs  zassertion.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rÚ __classcell__r r r rr s r)ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZtuned.profiles.exceptionsrZlogsÚgetrZFunctionrr r r rÚs     __pycache__/function_assertion.cpython-39.pyc000064400000002412151116471670015331 0ustar00a ,¡gÿã@sTddlZddlZddlmZddlmZddlmZej   ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommands)ÚInvalidProfileExceptioncs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú assertionz¶ 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. cstt|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úO/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_assertion.pyr szassertion.__init__csXtt|ƒ |¡sdS|d|dkrTt d|d|d|df¡td|dƒ‚dS)Nréz#assertion '%s' failed: '%s' != '%s'rzAssertion '%s' failed.)rrÚexecuteÚlogÚerrorr)r Úargsr r rrs  zassertion.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rÚ __classcell__r r r rr s r)ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZtuned.profiles.exceptionsrZlogsÚgetrZFunctionrr r r rÚs     __pycache__/function_assertion_non_equal.cpython-39.opt-1.pyc000064400000002466151116471670020342 0ustar00a ,¡g+ã@sTddlZddlZddlmZddlmZddlmZej   ¡Z Gdd„dej ƒZ dS)éNé)Úbase)Úcommands)ÚInvalidProfileExceptioncs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úassertion_non_equalzº 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. cstt|ƒ ddd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©úY/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_assertion_non_equal.pyr szassertion_non_equal.__init__csXtt|ƒ |¡sdS|d|dkrTt d|d|d|df¡td|dƒ‚dS)Nréz#assertion '%s' failed: '%s' == '%s'rzAssertion '%s' failed.)rrÚexecuteÚlogÚerrorr)r Úargsr r rrs  zassertion_non_equal.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rÚ __classcell__r r r rr s r)ÚosZ tuned.logsZtunedÚrZtuned.utils.commandsrZtuned.profiles.exceptionsrZlogsÚgetrZFunctionrr r r rÚs     __pycache__/function_intel_recommended_pstate.cpython-39.opt-1.pyc000064400000003311151116471670021315 0ustar00a ,¡gOã@s2ddlmZdZdZdZdZGdd„dejƒZdS) é)Úbase)Z sandybridgeZ ivybridgeZhaswellZ broadwellZskylakez/sys/devices/cpu/caps/pmu_nameZactiveÚdisablecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úintel_recommended_pstatea‡ Checks the processor code name and return the recommended intel_pstate CPUFreq driver mode. Active is returned for the newer generation of processors not in the PROCESSOR_NAME list. Intel recommends to use the intel_pstate CPUFreq driver in active mode with HWP enabled on Ice Lake and later generations processors. This function allows dynamically setting intel_pstate based on the processor's model. For pre-IceLake processors setting pstate to active can introduce jitters which were historically seen around and tested with RHEL-7.4. From IceLake generation, intel has fixed these issues. cstt|ƒ dd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©ú^/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_intel_recommended_pstate.pyrsz!intel_recommended_pstate.__init__cs<tt|ƒ |¡sdS|j t¡ ¡}|dks4|tvr8tSt S)NÚ) rrÚexecuteZ_cmdZ read_fileÚPMU_PATHÚstripÚPROCESSOR_NAMEÚDISABLEÚACTIVE)rÚargsZcurrent_processor_namer r r rs z intel_recommended_pstate.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r r s rN)r rrrrrZFunctionrr r r r Ús __pycache__/function_intel_recommended_pstate.cpython-39.pyc000064400000003311151116471670020356 0ustar00a ,¡gOã@s2ddlmZdZdZdZdZGdd„dejƒZdS) é)Úbase)Z sandybridgeZ ivybridgeZhaswellZ broadwellZskylakez/sys/devices/cpu/caps/pmu_nameZactiveÚdisablecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úintel_recommended_pstatea‡ Checks the processor code name and return the recommended intel_pstate CPUFreq driver mode. Active is returned for the newer generation of processors not in the PROCESSOR_NAME list. Intel recommends to use the intel_pstate CPUFreq driver in active mode with HWP enabled on Ice Lake and later generations processors. This function allows dynamically setting intel_pstate based on the processor's model. For pre-IceLake processors setting pstate to active can introduce jitters which were historically seen around and tested with RHEL-7.4. From IceLake generation, intel has fixed these issues. cstt|ƒ dd¡dS)Nré)ÚsuperrÚ__init__)Úself©Ú __class__©ú^/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_intel_recommended_pstate.pyrsz!intel_recommended_pstate.__init__cs<tt|ƒ |¡sdS|j t¡ ¡}|dks4|tvr8tSt S)NÚ) rrÚexecuteZ_cmdZ read_fileÚPMU_PATHÚstripÚPROCESSOR_NAMEÚDISABLEÚACTIVE)rÚargsZcurrent_processor_namer r r rs z intel_recommended_pstate.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r r s rN)r rrrrrZFunctionrr r r r Ús __pycache__/function_log.cpython-39.opt-1.pyc000064400000001632151116471670015045 0ustar00a ,¡gÃã@s4ddlZddlmZej ¡ZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)ÚexecutezT Expands to concatenation of arguments and logs the result, useful for debugging. cstt|ƒ ddd¡dS)NÚlogrr)ÚsuperrÚ__init__)Úself©Ú __class__©úI/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_log.pyr szexecute.__init__cs,tt|ƒ |¡sdSd |¡}t |¡|S)NÚ)rrÚjoinrÚinfo)rÚargsÚsr r r rs   zexecute.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) Z tuned.logsZtunedr rZlogsÚgetrZFunctionrr r r r Ús  __pycache__/function_log.cpython-39.pyc000064400000001632151116471670014106 0ustar00a ,¡gÃã@s4ddlZddlmZej ¡ZGdd„dejƒZdS)éNé)Úbasecs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)ÚexecutezT Expands to concatenation of arguments and logs the result, useful for debugging. cstt|ƒ ddd¡dS)NÚlogrr)ÚsuperrÚ__init__)Úself©Ú __class__©úI/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_log.pyr szexecute.__init__cs,tt|ƒ |¡sdSd |¡}t |¡|S)NÚ)rrÚjoinrÚinfo)rÚargsÚsr r r rs   zexecute.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r rs r) Z tuned.logsZtunedr rZlogsÚgetrZFunctionrr r r r Ús  __pycache__/function_package2cpus.cpython-39.opt-1.pyc000064400000003174151116471670016637 0ustar00a ,¡gõã@s\ddlZddlZddlmZddlmZddlmZe ¡Z eƒZ dZ Gdd„dej ƒZ dS) éNé)Úbase)Úcommands)Úlogsz/sys/devices/system/cpu/cs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú package2cpusz3 Provides cpu device list for a package (socket) cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úR/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_package2cpus.pyrszpackage2cpus.__init__c s8tt|ƒ |¡sdSt|ƒdkr$dSzt t t¡d¡}Wnt yNYdS0g}|D]Â}t|d}tj   |¡s„t   d|¡qXt |¡}z t|ƒ}Wn(tyÂt   d||f¡YqXYn0|D]P}z t|ƒ} Wn,tyt ||¡r| |¡YqÈ0|| krÈ| |¡qÈqXt|ƒdkr4d |¡SdS)Nrz cpu[0-9]*z/topology/physical_package_idzFile '%s' does not existz$Invalid package id '%s' for cpu '%s'ú,)rrÚexecuteÚlenÚfnmatchÚfilterÚosÚlistdirÚ SYSFS_DIRÚOSErrorÚpathÚexistsÚlogZwarningÚcmdZ read_fileÚintÚ ValueErrorÚappendÚjoin) r ÚargsZall_cpusZdevicesZcpuÚfÚvalueZ package_idZpackage_patternZthis_package_idr r r rs:         zpackage2cpus.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r r s r)rrÚrZtuned.utils.commandsrZtunedrÚgetrrrZFunctionrr r r r Ús   __pycache__/function_package2uncores.cpython-39.opt-1.pyc000064400000003370151116471670017341 0ustar00a ,¡gdã@s\ddlZddlZddlmZddlmZddlmZe ¡Z eƒZ dZ Gdd„dej ƒZ dS) éNé)Úbase)Úcommands)Úlogsz//sys/devices/system/cpu/intel_uncore_frequency/cs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Úpackage2uncoresz6 Provides uncore device list for a package (socket) cstt|ƒ dd¡dS)Nrr)ÚsuperrÚ__init__)Úself©Ú __class__©úU/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_package2uncores.pyrszpackage2uncores.__init__c shtt|ƒ |¡sdSt|ƒdkr$dSzt t¡}WntyFYdS0t  |d¡}t|ƒdkrjd}|}nd}g}|D]Ô}|r²t|d}tj   |¡s¦t   d|¡qvt |¡}n |dd…}z t|ƒ} Wn(tyòt   d ||f¡YqvYn0|D]P} z t| ƒ} Wn,ty4t || ¡r0| |¡Yqø0| | krø| |¡qøqvt|ƒdkrdd  |¡SdS) Nrzuncore*TFz /package_idzFile '%s' does not existéé z'Invalid package id '%s' for uncore '%s'ú,)rrÚexecuteÚlenÚosÚlistdirÚ SYSFS_DIRÚOSErrorÚfnmatchÚfilterÚpathÚexistsÚlogZwarningÚcmdZ read_fileÚintÚ ValueErrorÚappendÚjoin) r ÚargsZ all_uncoresZ tpmi_devicesZis_tpmiZdevicesZuncoreÚfÚvalueZ package_idZpackage_patternZthis_package_idr r r rsH            zpackage2uncores.execute)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__r r r r r s r)rrÚrZtuned.utils.commandsrZtunedrÚgetrrrZFunctionrr r r r Ús   __pycache__/parser.cpython-39.pyc000064400000006142151116471670012715 0ustar00a ,¡gaã@s>ddlZddlZddlmZej ¡ZeƒZGdd„dƒZ dS)éN)Úcommandsc@sZeZdZdZdd„Zddd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dS)ÚParserz; Parser used for expanding strings containing functions. cCs ||_dS©N)Ú _repository)ÚselfZ repository©rúC/usr/lib/python3.9/site-packages/tuned/profiles/functions/parser.pyÚ__init__szParser.__init__ÚcCs&d|_||_t|ƒ|_g|_d|_dS)NrF)Ú_cntÚ_strÚlenÚ_lenÚ_stackÚ_esc©rÚsrrrÚ _parse_inits  zParser._parse_initcCs|j|jkr|j|jSdS)Nr )r rr )rrrrÚ _curr_charszParser._curr_charcCs|j|j|j|…Sr)r r )rrrrrÚ _curr_substrszParser._curr_substrcCs|j ||jf¡dSr)rÚappendr )rZescrrrÚ _push_posszParser._push_poscCsd|jd|…||j|dd…|_t|jƒ|_|jt|ƒ||d7_|jdkr`d|_dS)Nér)r r rr )rÚaÚbrrrrÚ_sub!s &  z Parser._subcCsêt d|j||j…¡}|ddkr(dSdd„|Dƒ}t d|d¡s\t d|d¡dSz|j |d¡}Wn&t y–t d |d¡YdS0|  |d d…¡}t  d d   |dd…¡|f¡|durÖdS|  ||j|¡dS) Nz(?,óz(Parser._process_func..z\w+$rzinvalid function name '%s'zfunction '%s' not implementedéz${f:%s} expands to: '%s'r)ÚreÚsplitr r ÚmatchÚlogÚerrorrZ load_funcÚ ImportErrorZexecuteÚdebugÚjoinr)rZ_fromÚslÚfrrrrÚ _process_func(s"   zParser._process_funccCsÒ| |¡|j|jkr´| ¡dkrpz|j ¡}Wn&tyVt d|¡|j YS0|dsŠ|  |d¡n|  d¡dkrŠ|  |j ¡| ¡dkržd|_ nd |_ |jd7_q t|jƒrÌt d |¡|j S) NÚ}z.invalid variable syntax, non pair '}' in: '%s'rrr#z${ú\TFz.invalid variable syntax, non pair '{' in: '%s')rr rrrÚpopÚ IndexErrorr'r(r r.rrrr )rrÚsirrrÚ_process;s&        zParser._processcCs(|dus|dkr|St dd| |¡¡S)Nr z \\(\${f:.*})z\1)r$Úsubr4rrrrÚexpandRsz Parser.expandN)r ) Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrrrr.r4r6rrrrr s r) r$Z tuned.logsZtunedZtuned.utils.commandsrZlogsÚgetr'ÚcmdrrrrrÚs   __init__.py000064400000000043151116471670006663 0ustar00from .repository import Repository base.py000064400000002020151116471670006033 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 function_assertion.py000064400000001377151116471670011053 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 function_assertion_non_equal.py000064400000001453151116471670013107 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 function_calc_isolated_cores.py000064400000003153151116471670013017 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) function_check_net_queue_count.py000064400000001215151116471670013372 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.warning("net-dev queue count is not correctly specified, setting it to HK CPUs %s" % (out)) return out function_cpuinfo_check.py000064400000001763151116471670011643 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 "" function_cpulist2devs.py000064400000000714151116471670011465 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") function_cpulist2hex.py000064400000000726151116471670011313 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)) function_cpulist2hex_invert.py000064400000001160151116471670012673 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)))) function_cpulist_invert.py000064400000001223151116471670012104 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))) function_cpulist_online.py000064400000001213151116471670012060 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) function_cpulist_pack.py000064400000001175151116471670011521 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))) function_cpulist_present.py000064400000001263151116471670012261 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))))) function_cpulist_unpack.py000064400000000777151116471670012073 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))) function_exec.py000064400000000747151116471670007770 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 function_hex2cpulist.py000064400000000730151116471670011306 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])) function_kb2s.py000064400000000625151116471670007700 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 function_regex_search_ternary.py000064400000001052151116471670013235 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] function_s2kb.py000064400000000641151116471670007676 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 function_strip.py000064400000000626151116471670010201 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() function_virt_check.py000064400000001123151116471670011152 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] repository.py000064400000002663151116471670007355 0ustar00from tuned.utils.class_loader import ClassLoader from tuned.profiles.functions.parser import Parser from tuned.profiles.functions.base import Function import tuned.logs import tuned.consts as consts log = tuned.logs.get() class Repository(ClassLoader): """ Repository of functions used within TuneD profiles. The functions are loaded lazily (when first used). """ def __init__(self): super(Repository, self).__init__() self._functions = {} @property def functions(self): return self._functions def _set_loader_parameters(self): self._namespace = "tuned.profiles.functions" self._prefix = consts.FUNCTION_PREFIX self._interface = Function def create(self, function_name): log.debug("creating function %s" % function_name) function_cls = self.load_class(function_name) function_instance = function_cls() self._functions[function_name] = function_instance return function_instance # load a function from its file and return it # if it is already loaded, just return it, it is not loaded again def load_func(self, function_name): if not function_name in self._functions: return self.create(function_name) return self._functions[function_name] def delete(self, function): assert isinstance(function, self._interface) log.debug("removing function %s" % function) for k, v in list(self._functions.items()): if v == function: del self._functions[k] def expand(self, s): return Parser(self).expand(s) function_intel_recommended_pstate.py000064400000002517151116471670014076 0ustar00from . import base PROCESSOR_NAME = ("sandybridge", "ivybridge", "haswell", "broadwell", "skylake") PMU_PATH = "/sys/devices/cpu/caps/pmu_name" ACTIVE = "active" DISABLE = "disable" class intel_recommended_pstate(base.Function): """ Checks the processor code name and return the recommended intel_pstate CPUFreq driver mode. Active is returned for the newer generation of processors not in the PROCESSOR_NAME list. Intel recommends to use the intel_pstate CPUFreq driver in active mode with HWP enabled on Ice Lake and later generations processors. This function allows dynamically setting intel_pstate based on the processor's model. For pre-IceLake processors setting pstate to active can introduce jitters which were historically seen around and tested with RHEL-7.4. From IceLake generation, intel has fixed these issues. """ def __init__(self): super(intel_recommended_pstate, self).__init__("intel_recommended_pstate", 0) def execute(self, args): if not super(intel_recommended_pstate, self).execute(args): return None current_processor_name = self._cmd.read_file(PMU_PATH).strip() if current_processor_name == "" or current_processor_name in PROCESSOR_NAME: return DISABLE return ACTIVEfunction_log.py000064400000000703151116471670007615 0ustar00import tuned.logs from . import base log = tuned.logs.get() class execute(base.Function): """ Expands to concatenation of arguments and logs the result, useful for debugging. """ def __init__(self): # unlimited number of arguments, min 1 argument (the value to log) super(execute, self).__init__("log", 0, 1) def execute(self, args): if not super(execute, self).execute(args): return None s = "".join(args) log.info(s) return s function_lscpu_check.py000064400000002026151116471670011317 0ustar00import re import tuned.logs from . import base log = tuned.logs.get() class lscpu_check(base.Function): """ Checks regexes against the output of lscpu. Accepts arguments in the following form: REGEX1, STR1, REGEX2, STR2, ...[, STR_FALLBACK] If REGEX1 matches something in the output 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(lscpu_check, self).__init__("lscpu_check", 0, 2) def execute(self, args): if not super(lscpu_check, self).execute(args): return None # Stdout is the 2nd result from the execute call _, lscpu = self._cmd.execute("lscpu") for i in range(0, len(args), 2): if i + 1 < len(args): if re.search(args[i], lscpu, re.MULTILINE): return args[i + 1] if len(args) % 2: return args[-1] else: return "" function_package2cpus.py000064400000002365151116471670011412 0ustar00import os import fnmatch from . import base from tuned.utils.commands import commands from tuned import logs log = logs.get() cmd = commands() SYSFS_DIR = "/sys/devices/system/cpu/" class package2cpus(base.Function): """ Provides cpu device list for a package (socket) """ def __init__(self): super(package2cpus, self).__init__("package2cpus", 0) def execute(self, args): if not super(package2cpus, self).execute(args): return None if len(args) <= 0: return None try: all_cpus = fnmatch.filter(os.listdir(SYSFS_DIR), "cpu[0-9]*") except OSError: return None devices = [] for cpu in all_cpus: f = SYSFS_DIR + cpu + "/topology/physical_package_id" if not os.path.exists(f): log.warning("File '%s' does not exist" % f) continue value = cmd.read_file(f) try: package_id = int(value) except ValueError: log.warning("Invalid package id '%s' for cpu '%s'" % (value, cpu)) continue for package_pattern in args: try: this_package_id = int(package_pattern) except ValueError: if fnmatch.fnmatch(value, package_pattern): devices.append(cpu) else: if package_id == this_package_id: devices.append(cpu) return ",".join(devices) if len(devices) > 0 else None parser.py000064400000004141151116471670006423 0ustar00import re import tuned.logs from tuned.utils.commands import commands log = tuned.logs.get() cmd = commands() class Parser(): """ Parser used for expanding strings containing functions. """ def __init__(self, repository): self._repository = repository 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'(? 0: is_tpmi = True all_uncores = tpmi_devices else: is_tpmi = False devices = [] for uncore in all_uncores: if is_tpmi: f = SYSFS_DIR + uncore + "/package_id" if not os.path.exists(f): log.warning("File '%s' does not exist" % f) continue value = cmd.read_file(f) else: # uncore string is in form: package_NN_die_MM, do not expect more than 99 packages value = uncore[8:10] try: package_id = int(value) except ValueError: log.warning("Invalid package id '%s' for uncore '%s'" % (value, uncore)) continue for package_pattern in args: try: this_package_id = int(package_pattern) except ValueError: if fnmatch.fnmatch(value, package_pattern): devices.append(uncore) else: if package_id == this_package_id: devices.append(uncore) return ",".join(devices) if len(devices) > 0 else None