1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

framework/output: Speedup discover_wa_outputs()

Avoid recursing into subdirectory of folders containing __meta, since
they are not of interest and recursing can take a very large amount of
time if there are lot of files, like if there is a sysfs dump.
This commit is contained in:
douglas-raillard-arm 2020-08-05 12:03:52 +01:00 committed by Marc Bonnici
parent 9edb6b20f0
commit ab9e29bdae

View File

@ -776,9 +776,13 @@ def init_job_output(run_output, job):
def discover_wa_outputs(path): def discover_wa_outputs(path):
for root, dirs, _ in os.walk(path): # Use topdown=True to allow pruning dirs
for root, dirs, _ in os.walk(path, topdown=True):
if '__meta' in dirs: if '__meta' in dirs:
yield RunOutput(root) yield RunOutput(root)
# Avoid recursing into the artifact as it can be very lengthy if a
# large number of file is present (sysfs dump)
dirs.clear()
def _save_raw_config(meta_dir, state): def _save_raw_config(meta_dir, state):