Francesco Romani has uploaded a new change for review.
Change subject: config: introduce a devel section
......................................................................
config: introduce a devel section
This patch introduces a 'devel' configuration section,
in order to unclutter a bit the already crowded 'vars'
section.
An additional important benefit of this move is to clearly
mark that some tunables should never turned on in production
environments, unless exceptional circumstances, like a
performance problem being debugged.
For the same reason, is acceptable to move these options
across minor versions (e.g. 3.5 to 3.6).
This patch also makes room for future options which are
currently being discussed, like memory profiling or
a debug manhole service.
Change-Id: I7f9fc14c6fffd7ba111af985586eada83ec3c345
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/config.py.in
M lib/vdsm/profile.py
M tests/profileTests.py
3 files changed, 24 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/32664/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 69185e0..63b82d5 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -29,19 +29,6 @@
('core_dump_enable', 'true',
'Enable core dump.'),
- ('profile_enable', 'false',
- 'Enable whole process profiling (requires yappi profiler).'),
-
- ('profile_format', 'pstat',
- 'Profile file format (pstat, callgrind, ystat)'),
-
- ('profile_builtins', 'false',
- 'Profile builtin functions used by standard Python modules. '
- 'false by default.'),
-
- ('profile_clock', 'cpu',
- 'Sets the underlying clock type (cpu, wall)'),
-
('host_mem_reserve', '256',
'Reserves memory for the host to prevent VMs from using all the '
'physical pages. The values are in Mbytes.'),
@@ -349,6 +336,25 @@
('guests_gateway_ip', '', None),
]),
+
+ # Section: [devel]
+ ('devel', [
+
+ ('profile_enable', 'false',
+ 'Enable whole process profiling (requires yappi profiler).'),
+
+ ('profile_format', 'pstat',
+ 'Profile file format (pstat, callgrind, ystat)'),
+
+ ('profile_builtins', 'false',
+ 'Profile builtin functions used by standard Python modules. '
+ 'false by default.'),
+
+ ('profile_clock', 'cpu',
+ 'Sets the underlying clock type (cpu, wall)'),
+
+ ]),
+
]
diff --git a/lib/vdsm/profile.py b/lib/vdsm/profile.py
index 93dfacc..9710225 100644
--- a/lib/vdsm/profile.py
+++ b/lib/vdsm/profile.py
@@ -36,9 +36,9 @@
# Defaults
_FILENAME = os.path.join(constants.P_VDSM_RUN, 'vdsmd.prof')
-_FORMAT = config.get('vars', 'profile_format')
-_BUILTINS = config.getboolean('vars', 'profile_builtins')
-_CLOCK = config.get('vars', 'profile_clock')
+_FORMAT = config.get('devel', 'profile_format')
+_BUILTINS = config.getboolean('devel', 'profile_builtins')
+_CLOCK = config.get('devel', 'profile_clock')
_THREADS = True
_lock = threading.Lock()
@@ -61,7 +61,7 @@
def is_enabled():
- return config.getboolean('vars', 'profile_enable')
+ return config.getboolean('devel', 'profile_enable')
def is_running():
diff --git a/tests/profileTests.py b/tests/profileTests.py
index 4e9ff7c..95bcfb1 100644
--- a/tests/profileTests.py
+++ b/tests/profileTests.py
@@ -44,7 +44,7 @@
def make_config(enable='false'):
cfg = ConfigParser.ConfigParser()
config.set_defaults(cfg)
- cfg.set('vars', 'profile_enable', enable)
+ cfg.set('devel', 'profile_enable', enable)
return cfg
--
To view, visit
http://gerrit.ovirt.org/32664
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f9fc14c6fffd7ba111af985586eada83ec3c345
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>