+
     Gi  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^ RIHt ]P                  P                  4       tR.t ! R R]4      tR# )i    N)GlobalConfig)commandsManagerc                   s   a a ] tR t^t oRtRV 3R llt]R 4       t]R 4       t]R 4       t	R t
R tR tR	 tR
 tR tR tR tR t]P(                  3R ltRtVtV ;t# )r   z=
Manager creates plugin instances and keeps a track of them.
c                s   < \         \        V `  4        Wn        W n        W0n        W@n        . V n        . V n        T;'       g    \        4       V n
        \        4       V n        R # N)Zsuperr   __init___plugins_repository_monitors_repository_def_instance_priority_hardware_inventory
_instances_pluginsr    _configr   _cmd)selfplugins_repositoryZmonitors_repositoryZdef_instance_priorityZhardware_inventoryZconfig	__class__s   &&&&&&8/usr/lib/python3.14/site-packages/tuned/units/manager.pyr   ZManager.__init__   sP    !/1 5/$/$-))<>$,j$)    c                    V P                   # r   )r
   r      &r   pluginsZManager.plugins!   s    	r   c                r   r   )r	   r   r   r   	instancesZManager.instances%   s    	r   c                r   r   )r   r   r   r   r   ZManager.plugins_repository)   s    		!	!!r   c                s   VP                   f   R# V P                  P                  \        P                  4      pVf   V P
                  P                  R4      p\        P                  ! VP                   V\        P                  4      R J# )NTz/proc/cpuinfo)
Zcpuinfo_regexr   getconstsZCFG_CPUINFO_STRINGr   Z	read_fileresearch	MULTILINE)r   unitZcpuinfo_string   && r   _unit_matches_cpuinfoZManager._unit_matches_cpuinfo-   so    	
<<##F$=$=>.II''8>	4%%~LL

 r   c                s(   VP                   f   R# V P                  P                  \        P                  4      pVf%   RP                  \        P                  ! 4       4      p\        P                  ! VP                   V\        P                  4      R J# )NTZ )Zuname_regexr   r   r   ZCFG_UNAME_STRINGZjoinosZunamer   r   r   )r   r   Zuname_stringr   r   _unit_matches_unameZManager._unit_matches_uname6   so    	
!!&"9"9:,((288:&<	4##\LL

 r   c           
     s:   . p\        VP                  4       4       F  w  r4VP                  '       g   \        P	                  R V,          4       K5  V P                  V4      '       g   \        P	                  RV,          4       Kj  V P                  V4      '       g   \        P	                  RV,          4       K  VP                  f   \        V P                  4      Vn        M\        VP                  4      Vn        VP                  V4       K  	  VP                  R R7       \        P                  ! 4       pV F  pRWTP                  &   K  	  \        VP                  4       4       F@  w  rg V P                  P!                  V4      pWV&   V P"                  P                  V4       KB  	  . p
V F  pWTP                  ,          pVf   K  \        P	                  R	VP4                  : R
VP                  : R24       VP7                  VP4                  VP                  VP8                  VP:                  VP<                  VP>                  VP@                  4      pV
P                  V4       K  	  V
 FS  pVPB                  PE                  4        VPB                  PG                  V4       VPB                  PI                  V4       KU  	  V PJ                  PM                  4        V PN                  PQ                  V
4       R#   \$        P&                  P(                  P*                   d*   p	\        P-                  RT: RT	: 24        Rp	?	EK  Rp	?	i\.         d>   p	\        P1                  RT,          4       \        P3                  T	4        Rp	?	EK*  Rp	?	ii ; i)zskipping disabled instance '%s'z.skipping instance '%s', cpuinfo does not matchz,skipping instance '%s', uname does not matchNc                 r   r   )priority)Zxr   r   Z<lambda>Z Manager.create.<locals>.<lambda>R   s    

r   )Zkeyzskipping plugin 'z!', not supported on your system: zfailed to initialize plugin %sz
creating 'z' (Z)))ZlistZitemsZenabledlogdebugr   r    r!   Zintr   ZappendZsortcollectionsZOrderedDictZtyper   creater
   tunedr   Z
exceptionsZNotSupportedPluginExceptionZinfo	ExceptionerrorZ	exceptionnameZcreate_instanceZdevicesZdevices_udev_regexZ
script_preZscript_postZoptionspluginZinit_devicesZassign_free_devicesZinitialize_instancer   Zstart_processing_eventsr	   Zextend)r   Zinstances_configZinstance_info_listZinstance_nameZinstance_infoZplugins_by_nameZplugin_nameZnoner*   er   Znew_instanceinstances   &&           r   r%   ZManager.create?   s   &*+;+A+A+C&D"m



II/-?@

$
$]
3
3II>NO

"
"=
1
1II<}LM$ !<!<=M !7!78M]+ 'E" 23++-/)m)-?%%& *   5 5 78k
%%,,[9F#)K MM 	 9 ))m../6n99]%7%79K9KLM((););]=S=S=;;m779N9NP< L! * h??!??&&x0??&&x0  224//#3 --
"
"
>
> HHVWXY
 II.<=MM!s*   1:L)N+MNN1NNc           	     s     V! V/ VB #   \          d]   p\        P                  ! 4       p\        P	                  R T: R\        T4      : 24       \        P	                  T4       Tu Rp?# Rp?ii ; i)zBUG: Unhandled exception in z: N)r'   	tracebackZ
format_excr"   r(   Zstr)r   ZcallerZexc_retZfZargsZkwargsr+   Ztraces   &&&&*,  r   	_try_callZManager._try_callw   s`    
T
V
	 !599A 99U
>s   
 A1AA,&A1,A1c                s   V P                    FQ  p\        P                  R VP                  ,          4       V P	                  RRVP
                  P                  V4       KS  	  V P                   FF  p\        P                  RVP                  ,          4       V P	                  RRVP                  4       KH  	  V P                  P                  P                  4        V P                  R V P                   R R# )zdestroying instance %sdestroy_allNzcleaning plugin '%s':NNN)r	   r"   r#   r)   r.   r*   Zdestroy_instancer
   Zcleanupr   r   Zclear)r   r,   r*   s   &  r   r/   ZManager.destroy_all   s    //h99%56>>-__%% "
 f99#fkk12>>-v~~6  ""((*
mmA
ooar   c                s    V P                   P                   F<  p\        P                  R V,          4       V P	                  RRVP
                  4       K>  	  R# )zupdating monitor %supdate_monitorsN)r   Zmonitorsr"   r#   r.   Zupdate)r   Zmonitor   & r   r0   ZManager.update_monitors   s?    **33g99"W,->>#T7>>: 4r   c                f    V P                    F   pV P                  R RVP                  4       K"  	  R# )start_tuningN)r	   r.   Zapply_tuningr   r,   r1   r   r3   ZManager.start_tuning   s)    //h>>.$ "r   c                s    R pV P                    F,  pV P                  RRVP                  V4      pVR8X  g   K*  RpK.  	  V# )Tverify_tuningF)r	   r.   r5   )r   Zignore_missingZretr,   Zress   &&   r   r5   ZManager.verify_tuning   sE    #//h	^
-3	Ul
C	 "
 
*r   c                r2   )update_tuningN)r	   r.   r6   r4   r1   r   r6   ZManager.update_tuning   s)    //h>>/4 "r   c                s    V P                   P                  4        \        V P                  4       F!  pV P	                  R RVP
                  V4       K#  	  R# )stop_tuningN)r   Zstop_processing_eventsZreversedr	   r.   Zunapply_tuning)r   Zrollbackr,   r   r   r7   ZManager.stop_tuning   sB    1134??+h>>-h( ,r   )r   r   r   r   r	   r   r
   r   r   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   Zpropertyr   r   r   r   r    r%   r.   r/   r0   r3   r5   r6   r   ZROLLBACK_SOFTr7   Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r      s     
     " "6$p;

 #)"6"6 ( (r   )r$   r   r   r-   Ztuned.exceptionsr&   Z
tuned.logsZtuned.plugins.exceptionsZtuned.constsr   Ztuned.utils.global_configr    Ztuned.utils.commandsr   Zlogsr   r"   Z__all__Zobjectr   ) r   r   <module>r8      sH     	 	      2 )jjnn+b(f b(r   