diff options
author | van Hauser <vh@thc.org> | 2023-02-21 01:11:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 01:11:00 +0100 |
commit | c33f8751e3f1051c4fe6859d16a0494282c8e34b (patch) | |
tree | cffa425593885192ec6d24416ab5b436ca0f5938 /src/afl-gotcpu.c | |
parent | 1faf6f67313e726c645ac3b9ecd2d8b5e65f605a (diff) | |
parent | 6f4b5ae0832774389b12c5a8cd3fb95821b438e5 (diff) | |
download | afl++-c33f8751e3f1051c4fe6859d16a0494282c8e34b.tar.gz |
Merge pull request #1651 from AFLplusplus/dev
Dev
Diffstat (limited to 'src/afl-gotcpu.c')
-rw-r--r-- | src/afl-gotcpu.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/afl-gotcpu.c b/src/afl-gotcpu.c index c5b8a27a..8988fd54 100644 --- a/src/afl-gotcpu.c +++ b/src/afl-gotcpu.c @@ -92,7 +92,7 @@ static u32 measure_preemption(u32 target_ms) { volatile u32 v1, v2 = 0; u64 st_t, en_t, st_c, en_c, real_delta, slice_delta; - s32 loop_repeats = 0; + //s32 loop_repeats = 0; st_t = get_cur_time_us(); st_c = get_cpu_usage_us(); @@ -113,7 +113,7 @@ repeat_loop: if (en_t - st_t < target_ms * 1000) { - loop_repeats++; + //loop_repeats++; goto repeat_loop; } @@ -214,7 +214,13 @@ int main(int argc, char **argv) { #if defined(__linux__) if (sched_setaffinity(0, sizeof(c), &c)) { - PFATAL("sched_setaffinity failed for cpu %d", i); + const char *error_code = "Unkown error code"; + if (errno == EFAULT) error_code = "EFAULT"; + if (errno == EINVAL) error_code = "EINVAL"; + if (errno == EPERM) error_code = "EPERM"; + if (errno == ESRCH) error_code = "ESRCH"; + + PFATAL("sched_setaffinity failed for cpu %d, error: %s", i, error_code); } |