VULN_CHECK_I913V6 Gi ddlmZddlZddlZddlZddlddlZddl m Z ddl ddl m Z ejjZGddej"Zy))baseN)*)commandscjeZdZdZfdZdZdZdZdZe jfdZ dZ d Z d ZxZS) SysfsPluginai Sets various `sysfs` settings specified by the plug-in options. The syntax is `_name_=_value_`, where `_name_` is the `sysfs` path to use and `_value_` is the value to write. The `sysfs` path supports the shell-style wildcard characters (see `man 7 glob` for additional detail). Use this plugin in case you need to change some settings that are not covered by other plug-ins. Prefer specific plug-ins if they cover the required settings. .Ignore corrected errors and associated scans that cause latency spikes ==== ---- [sysfs] /sys/devices/system/machinecheck/machinecheck*/ignore_ce=1 ---- ==== cXtt| |i|d|_t |_y)NT)superr__init___has_dynamic_optionsr_cmd)selfargskwargs __class__s ?/usr/lib/python3.12/site-packages/tuned/plugins/plugin_sysfs.pyr zSysfsPlugin.__init__%s( T#T4V4"$j$)c d|_d|_tt|jj Dcgc])}t jj|d|df+c}|_ i|_ ycc}w)NFTrr) _has_dynamic_tuning_has_static_tuningdictlistoptionsitemsospathnormpath_sysfs_sysfs_original)rinstance key_values r_instance_initzSysfsPlugin._instance_init*so!&( $(Z^_g_o_o_u_u_wZxyZxY277++IaL99Q<HZxyz(/(zs.A;cyN)rr s r_instance_cleanupzSysfsPlugin._instance_cleanup1srcxt|jjD]\}}|jj |}t j |D]\}|j|r1|j||j|<|j||Etjd|z^y)Nz)rejecting write to '%s' (not inside /sys)) rrr _variablesexpandglobiglob _check_sysfs _read_sysfsr _write_sysfslogerror)rr keyvaluevfs r_instance_apply_staticz"SysfsPlugin._instance_apply_static4s..01jc5 e$1 JJsOq #'#3#3A#6Xa  q!YY:Q>? 2rcDd}t|jjD]w\}}|jj |}t j |D]?}|j|s|j|} |j||| |dk(s>d}Ay|S)NTF) rrrr(r)r*r+r,r- _verify_value) rr ignore_missingdevicesretr1r2r3r4curr_vals r_instance_verify_staticz#SysfsPlugin._instance_verify_static>s #..01jc5 e$1 JJsOq   #X 1a>:eC c 2 *rc~t|jjD]\}}|j||yr$)rrrr.)rr rollbackr1r2s r_instance_unapply_staticz$SysfsPlugin._instance_unapply_staticIs411779:jc5S% ;rc.tjd|S)Nz^/sys/.*)rematch)r sysfs_files rr,zSysfsPlugin._check_sysfsMs +z **rc|jj|j}t|dkDr|jj |dSy)NrF)r read_filestriplenget_active_option)rrCdatas rr-zSysfsPlugin._read_sysfsPsD   Z ( . . 0$Y] )) % %dE 22 rc>|jj||dS)NT) ignore_same)r write_to_file)rrCr2s rr.zSysfsPlugin._write_sysfsWs  U EEr)__name__ __module__ __qualname____doc__r r"r&r5r<consts ROLLBACK_SOFTr?r,r-r. __classcell__)rs@rrr sC.  @  :@9M9M!+Frr)rr*rAos.pathr decorators tuned.logstuned tuned.constsrQ subprocesstuned.utils.commandsrlogsgetr/Pluginrr%rrr_sD ) jjnnKF$++KFr