aboutsummaryrefslogtreecommitdiff
path: root/scripts/boot.py
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-07-28 10:42:19 +0200
committerKarel Kočí <cynerd@email.cz>2015-07-28 10:42:19 +0200
commit1f9fe943356a07c2878d6db63101c35a3acefa32 (patch)
tree21523c8f49fb7f568993366b51df0d46bbed4ac3 /scripts/boot.py
parentc7d4caef3787e47baca0c15b949c2a27d990f890 (diff)
downloadlinux-conf-perf-1f9fe943356a07c2878d6db63101c35a3acefa32.tar.gz
linux-conf-perf-1f9fe943356a07c2878d6db63101c35a3acefa32.tar.bz2
linux-conf-perf-1f9fe943356a07c2878d6db63101c35a3acefa32.zip
Scripts changed to use database.
Also initial implementation of multithread execution. A lot of functionality changed. Phases removed. Output parsing is now part of measure (boot) process. Utils cleared. Add dot_measure file for inverted dot_config. Configuration generating is now prepared for multiple generating types. Fist implemented is generating configurations with single selected configuration. Test is modified to be compatible with new changes.
Diffstat (limited to 'scripts/boot.py')
-rw-r--r--scripts/boot.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/boot.py b/scripts/boot.py
index 3e715aa..dd40b35 100644
--- a/scripts/boot.py
+++ b/scripts/boot.py
@@ -9,22 +9,29 @@ import initialize
from conf import conf
from conf import sf
from exceptions import MissingFile
+import database
-def boot():
+def boot(config, to_database = True):
try:
os.mkdir(sf(conf.output_folder))
except FileExistsError:
pass
- wd = os.getcwd()
-
- sprc = subprocess.Popen(conf.boot_command,
- stdout = subprocess.PIPE)
- with open(os.path.join(sf(conf.output_folder), utils.get_last_configuration()), "a") as f:
+ sprc = subprocess.Popen(conf.boot_command, stdout = subprocess.PIPE)
+ with open(os.path.join(sf(conf.output_folder), config.cfile), "a") as f:
for linen in sprc.stdout:
line = linen.decode('utf-8')
if conf.boot_output:
print(line, end="")
f.write(line)
- os.chdir(wd)
+ # Let user script parse double value
+ out = utils.callsubprocess('parse_command', conf.parse_command,
+ conf.parse_output, True)
+ value = float(out[0])
+
+ if to_database:
+ dtb = database.database()
+ dtb.add_measure(config.cfile, config.id, value)
+
+ return config.cfile