Skip to content

Commit

Permalink
More informative logs to help debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
DonggeLiu committed Aug 23, 2024
1 parent 782b361 commit 935da06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions common/fuzzer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion experiment/measurer/coverage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
3 changes: 2 additions & 1 deletion experiment/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 935da06

Please sign in to comment.