From 935da06aa3ce37e782942e1adc3443680ea6c62d Mon Sep 17 00:00:00 2001 From: Dongge Liu Date: Fri, 23 Aug 2024 11:27:46 +1000 Subject: [PATCH] More informative logs to help debugging --- common/fuzzer_utils.py | 4 ++++ experiment/measurer/coverage_utils.py | 4 +++- experiment/runner.py | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/fuzzer_utils.py b/common/fuzzer_utils.py index 049ba8ce3..a28acf5db 100644 --- a/common/fuzzer_utils.py +++ b/common/fuzzer_utils.py @@ -83,7 +83,11 @@ def get_fuzz_target_binary(search_directory: str, if os.path.exists(default_fuzz_target_binary): return default_fuzz_target_binary + logs.info('Searching for possible fuzz target in search directory: ' + f'{search_directory}') for root, _, files in os.walk(search_directory): + logs.info(f'Searching for possible fuzz target under subdir {root}: ' + f'{files}') if root == 'uninstrumented': continue for filename in files: diff --git a/experiment/measurer/coverage_utils.py b/experiment/measurer/coverage_utils.py index 27ab69965..9f8e295c9 100644 --- a/experiment/measurer/coverage_utils.py +++ b/experiment/measurer/coverage_utils.py @@ -133,7 +133,9 @@ def merge_profdata_files(self): result = merge_profdata_files(files_to_merge, self.merged_profdata_file) if result.retcode != 0: - logger.error('Profdata files merging failed.') + logger.error( + f'Profdata files merging failed for (fuzzer, benchmark): ' + f'({self.fuzzer}, {self.benchmark}).') def generate_coverage_summary_json(self): """Generates the coverage summary json from merged profdata file.""" diff --git a/experiment/runner.py b/experiment/runner.py index b8c95fcca..6715c51e0 100644 --- a/experiment/runner.py +++ b/experiment/runner.py @@ -180,7 +180,8 @@ def run_fuzzer(max_total_time, log_filename): target_binary = fuzzer_utils.get_fuzz_target_binary(FUZZ_TARGET_DIR, fuzz_target_name) if not target_binary: - logs.error('Fuzz target binary not found.') + logs.error(f'Fuzz target binary {fuzz_target_name} not found under ' + f'{FUZZ_TARGET_DIR}') return if max_total_time is None: