diff options
author | Max Moroz <mmoroz@chromium.org> | 2020-01-21 13:09:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 13:09:07 -0800 |
commit | 2c6c6d9785de4d60b81117be3859c64e59b0b6e7 (patch) | |
tree | 5d02eac3125fde04cc99dc7f96901f9412ccba38 | |
parent | 87df2b147ad10b3c5bad35e241b948ad6cc54333 (diff) | |
download | oss-fuzz-2c6c6d9785de4d60b81117be3859c64e59b0b6e7.tar.gz |
[infra] Prioritize short files when collecting dataflow traces (#1632). (#3254)
* [infra] Prioritize short files when collecting dataflow traces (#1632).
* remove debug print
* rename files and sizes dict
-rwxr-xr-x | infra/base-images/base-runner/dataflow_tracer.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/infra/base-images/base-runner/dataflow_tracer.py b/infra/base-images/base-runner/dataflow_tracer.py index b157d66c8..7166bf43e 100755 --- a/infra/base-images/base-runner/dataflow_tracer.py +++ b/infra/base-images/base-runner/dataflow_tracer.py @@ -85,6 +85,7 @@ def collect_traces(binary, corpus_dir, dft_dir): 'failed': 0, } + files_and_sizes = {} for f in _list_dir(corpus_dir): stats['total'] += 1 size = os.path.getsize(f) @@ -92,7 +93,9 @@ def collect_traces(binary, corpus_dir, dft_dir): stats['long'] += 1 print('Skipping large file ({size}b): {path}'.format(size=size, path=f)) continue + files_and_sizes[f] = size + for f in sorted(files_and_sizes, key=files_and_sizes.get): output_path = os.path.join(dft_dir, _sha1(f)) try: result = _run([binary, f, output_path], timeout=_timeout(size)) |