Bug 1212831

Summary: Add glob support to tuned sysfs plugin
Product: Red Hat Enterprise Linux 7 Reporter: Jeremy Eder <jeder>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.2CC: jeder, jscotka, jskarvad, tcerna
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: tuned-2.5.1-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: Previously sysfs plugin didn't support glob. Consequence: It wasn't possible to use path name expansion in sysfs section of profile configuration file. Fix: The code of sysfs plugin was improved to support glob. Result: Now it is possible to use path name expansion in sysfs section of profile configuration file, e.g.: [sysfs] /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq=3000000 The ? and [] globs are also supported, for details see: https://bugzilla.redhat.com/show_bug.cgi?id=1212831#c4
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:21:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeremy Eder 2015-04-17 12:41:21 UTC
Description of problem:

To support something like this:
[sysfs]
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1

The trouble is thatthere is a machinecheck directory for each CPU, and the number of CPUs can differ.

# for i in `find /sys/devices/system/machinecheck/machinecheck*/ignore_ce` ; do echo -n "$i " ; cat $i ; done
/sys/devices/system/machinecheck/machinecheck0/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck10/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck11/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck12/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck13/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck14/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck15/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck16/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck17/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck18/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck19/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck1/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck20/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck21/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck22/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck23/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck24/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck25/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck26/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck27/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck28/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck29/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck2/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck30/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck31/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck3/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck4/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck5/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck6/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck7/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck8/ignore_ce 0
/sys/devices/system/machinecheck/machinecheck9/ignore_ce 0

Comment 4 Jaroslav Škarvada 2015-05-21 14:01:39 UTC
Now it supports so called Unix path name expansion. E.g. the following now works:

[sysfs]
/sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq=3000000

or for 10 CPUs or less:

[sysfs]
/sys/devices/system/cpu/cpu?/cpufreq/scaling_max_freq=3000000

or for only 4 CPU:

[sysfs]
/sys/devices/system/cpu/cpu[0-3]/cpufreq/scaling_max_freq=3000000

Do you need full regex or is the current glob enough?

Comment 5 Jaroslav Škarvada 2015-06-15 09:58:40 UTC
Glob is probably enough, thus changing subject of this BZ. If glob is not enough, let me know.

Comment 10 errata-xmlrpc 2015-11-19 12:21:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2375.html