3 irqbalance sysconfig file is missing. Is irqbalance installed?z,Failed to read irqbalance sysconfig file: %s) openrIRQBALANCE_SYSCONFIG_FILEreadIOErrorerrnoENOENTlogwarnerror)r ferrr_read_irqbalance_sysconfig1s  z+IrqbalancePlugin._read_irqbalance_sysconfigcCsZy&ttjd}|j|WdQRXdStk rT}ztjd|dSd}~XnXdS)NwTz-Failed to write irqbalance sysconfig file: %sF)rrrwriterrr )r contentr!r"rrr_write_irqbalance_sysconfig<sz,IrqbalancePlugin._write_irqbalance_sysconfigcCs |d|S)NzIRQBALANCE_BANNED_CPUS=%s r)r sysconfigbanned_cpumaskrrr_write_banned_cpusEsz#IrqbalancePlugin._write_banned_cpuscCs8g}x(|jdD]}tjd|s|j|qWdj|S)N z\s*IRQBALANCE_BANNED_CPUS=)splitrematchappendjoin)r r(lineslinerrr_clear_banned_cpusHs  z#IrqbalancePlugin._clear_banned_cpuscCs2|jjdddgdgd\}}|dkr.tjddS)NZ systemctlz try-restartZ irqbalance)Z no_errorsrz.Failed to restart irqbalance. Is it installed?)_cmdZexecuterr)r Zretcodeoutrrr_restart_irqbalanceOs z$IrqbalancePlugin._restart_irqbalancecCs@|j}|dkrdS|j|}|j||}|j|r<|jdS)N)r#r3r*r'r7)r r)r&rrr_set_banned_cpusXs   z!IrqbalancePlugin._set_banned_cpuscCs4|j}|dkrdS|j|}|j|r0|jdS)N)r#r3r'r7)r r&rrr_restore_banned_cpusas   z%IrqbalancePlugin._restore_banned_cpusrF)Z per_devicec Csd}|dk rjt|jj|}t|j}|j|rB|jjt|}n(djdd|jD}tj d||f|sr|r~|dkr~dS|rdS|r|j |n|j dS)N,cSsg|] }t|qSr)str).0xrrr rsz1IrqbalancePlugin._banned_cpus..zGInvalid banned_cpus specified, '%s' does not match available cores '%s') setr5Zcpulist_unpackr issubsetZ cpulist2hexlistr0rr r8r9) r ZenablingvalueZverifyZignore_missingr)ZbannedZpresentZstr_cpusrrr _banned_cpusis     zIrqbalancePlugin._banned_cpus)__name__ __module__ __qualname____doc__rrr classmethodrr#r'r*r3r7r8r9rrC __classcell__rr)rrr s      r)rZ decoratorsrZtunedrZ tuned.logsrr r-ZlogsgetrZPluginrrrrrs