Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
added awk scripts to process crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Jemmett committed Jun 24, 2019
1 parent 556de5a commit 62551d4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
indent_style = tab
indent_size = 4

[*.{c,h,rs}]
[*.{c,h,rs,awk}]
indent_style = space
indent_size = 4

Expand Down
1 change: 1 addition & 0 deletions work/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
!*.conf
!stored_work
!*.r
!*.awk
17 changes: 17 additions & 0 deletions work/crash_min_time.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
if (times[$1] == "" || $2 < times[$1]) {
times[$1] = $2
fuzzers[$1] = $3
files[$1] = $4
}
}

END {
for (h in files) {
t = times[h]
fz = fuzzers[h]
f = files[h]
print h, t, fz, f
}
}

27 changes: 27 additions & 0 deletions work/crash_times.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$1 == "Hash:" {
current_hash = $2
}

$1 == "Fuzzer:" {
current_fuzzer = $2
}

$1 == "File:" {
("date -r "$2" '+%s'")|getline date_s
date=strtonum(date_s)
if (files[current_hash] == "" || date < dates[current_hash]) {
dates[current_hash] = date
fuzzers[current_hash] = current_fuzzer
files[current_hash] = $2
}
}

END {
for (h in files) {
f = files[h]
d = dates[h]
fz = fuzzers[h]
print h, d - start_time, fz, f
}
}

19 changes: 19 additions & 0 deletions work/crash_times_agg.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
if ($1 in times) {
times[$1] = times[$1] SUBSEP $2
} else {
times[$1] = $2
}
}

END {
idx = 0
for (h in times) {
n = split(times[h], ts, SUBSEP)
for (i = 1; i < n + 1; i++) {
print idx, h, ts[i]
}
idx++
}
}

0 comments on commit 62551d4

Please sign in to comment.