Skip to content

Commit

Permalink
added a script to re-order the output script and changed ci to call it
Browse files Browse the repository at this point in the history
  • Loading branch information
M3CHR0M4NC3R committed Jan 8, 2025
1 parent 5a0adb3 commit 623856e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/check_compilable_percentage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,22 @@ jobs:
$(pwd)/CI_repository_list.csv \
$(pwd)/ASHE/CI_REPO_CLONE_SPACE \
$(pwd)/ASHE/src/main/resources/config.properties
- name: De-Interleave Multithreaded Log
run: |
python3 ashe_scripts/de-interleave-ashe-log.py ASHE/logs/app.log
- name: Translate results
run: |
python3 ashe_scripts/specimin_get_run_results.py ASHE/logs/app.log
cat ASHE/logs/app.log
python3 ashe_scripts/specimin_get_run_results.py ASHE/logs/deinterleaved-log.txt
cat ASHE/logs/deinterleaved-log.log
- name: Show only successful minimizations
run: |
grep 'full_success' ASHE/logs/specimin_run_results.txt
grep 'full_success' ASHE/logs/specimin_run_results.txt | sort
- name: Show only failed minimizations
run: |
grep 'failed_minimization' ASHE/logs/specimin_run_results.txt
grep 'failed_minimization' ASHE/logs/specimin_run_results.txt | sort
- name: Show only failed compilations
run: |
grep 'failed_compilation' ASHE/logs/specimin_run_results.txt
grep 'failed_compilation' ASHE/logs/specimin_run_results.txt | sort
- name: Parse accuracy percentage
id: parse_accuracy_percentage
run: |
Expand Down
41 changes: 41 additions & 0 deletions ashe_scripts/de-interleave-ashe-log.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/sbin/python
from collections import defaultdict
import re
import os
import sys

def deinterleave(file_path: str):
thread_logs = defaultdict(list)

with open(file_path, "r") as infile:
for line in infile:
#log format is like this:
#13:40:26.262 [ForkJoinPool-1-worker-9]
#\[ForkJoinPool-1-worker-\([0-9]\+\)]
pattern = re.compile(r"\[ForkJoinPool-1-worker-([0-9]+)]")
#pattern = re.compile(r"ForkJoinPool")
with open(file_path, "r") as infile:
for line in infile:
match = pattern.search(line)
if match:
thread = match.group(1)
thread_logs[thread].append(line.strip())
break

with open(output_file, "w") as outfile:
for thread_id, messages in thread_logs.items():
outfile.write(f"Logs for {thread_id}:\n")
for message in messages:
outfile.write(f"{thread_id}: {message}\n")
outfile.write("\n")


if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: python3 specimin_repo_specifics.py <path_to_log_file.log>")
sys.exit(1)
log_file_path = sys.argv[1]
directory: str = os.path.dirname(log_file_path)
output_file = os.path.join(directory, 'deinterleaved-log.txt')
deinterleave(log_file_path)
print(f"De-interleaved log written to: {output_file}")

0 comments on commit 623856e

Please sign in to comment.