mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 11:08:06 +00:00
setting attribute hot intelligently gives 0.5% speed
This commit is contained in:
@ -26,7 +26,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
|
|||||||
AFL_LLVM_WHITELIST and AFL_LLVM_INSTRUMENT_FILE are deprecated and
|
AFL_LLVM_WHITELIST and AFL_LLVM_INSTRUMENT_FILE are deprecated and
|
||||||
are matched to AFL_LLVM_ALLOWLIST). The format is compatible to llvm
|
are matched to AFL_LLVM_ALLOWLIST). The format is compatible to llvm
|
||||||
sancov, and also supports function matching!
|
sancov, and also supports function matching!
|
||||||
- added nozero counting to trace-pc/pcgard
|
- added neverzero counting to trace-pc/pcgard
|
||||||
- fixes for laf-intel float splitting (thanks to mark-griffin for
|
- fixes for laf-intel float splitting (thanks to mark-griffin for
|
||||||
reporting)
|
reporting)
|
||||||
- LTO: switch default to the dynamic memory map, set AFL_LLVM_MAP_ADDR
|
- LTO: switch default to the dynamic memory map, set AFL_LLVM_MAP_ADDR
|
||||||
|
@ -122,7 +122,7 @@ void afl_fsrv_init_dup(afl_forkserver_t *fsrv_to, afl_forkserver_t *from) {
|
|||||||
Returns the time passed to read.
|
Returns the time passed to read.
|
||||||
If the wait times out, returns timeout_ms + 1;
|
If the wait times out, returns timeout_ms + 1;
|
||||||
Returns 0 if an error occurred (fd closed, signal, ...); */
|
Returns 0 if an error occurred (fd closed, signal, ...); */
|
||||||
static u32 read_s32_timed(s32 fd, s32 *buf, u32 timeout_ms,
|
static u32 __attribute__ ((hot)) read_s32_timed(s32 fd, s32 *buf, u32 timeout_ms,
|
||||||
volatile u8 *stop_soon_p) {
|
volatile u8 *stop_soon_p) {
|
||||||
|
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
@ -322,7 +322,7 @@ static void report_error_and_exit(int error) {
|
|||||||
cloning a stopped child. So, we just execute once, and then send commands
|
cloning a stopped child. So, we just execute once, and then send commands
|
||||||
through a pipe. The other part of this logic is in afl-as.h / llvm_mode */
|
through a pipe. The other part of this logic is in afl-as.h / llvm_mode */
|
||||||
|
|
||||||
void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
|
void __attribute__ ((hot)) afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
|
||||||
volatile u8 *stop_soon_p, u8 debug_child_output) {
|
volatile u8 *stop_soon_p, u8 debug_child_output) {
|
||||||
|
|
||||||
int st_pipe[2], ctl_pipe[2];
|
int st_pipe[2], ctl_pipe[2];
|
||||||
|
@ -57,7 +57,7 @@ void write_bitmap(afl_state_t *afl) {
|
|||||||
This function is called after every exec() on a fairly large buffer, so
|
This function is called after every exec() on a fairly large buffer, so
|
||||||
it needs to be fast. We do this in 32-bit and 64-bit flavors. */
|
it needs to be fast. We do this in 32-bit and 64-bit flavors. */
|
||||||
|
|
||||||
u8 has_new_bits(afl_state_t *afl, u8 *virgin_map) {
|
u8 __attribute__ ((hot)) has_new_bits(afl_state_t *afl, u8 *virgin_map) {
|
||||||
|
|
||||||
#ifdef WORD_SIZE_64
|
#ifdef WORD_SIZE_64
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ void init_count_class16(void) {
|
|||||||
|
|
||||||
#ifdef WORD_SIZE_64
|
#ifdef WORD_SIZE_64
|
||||||
|
|
||||||
void classify_counts(afl_forkserver_t *fsrv) {
|
void __attribute__ ((hot)) classify_counts(afl_forkserver_t *fsrv) {
|
||||||
|
|
||||||
u64 *mem = (u64 *)fsrv->trace_bits;
|
u64 *mem = (u64 *)fsrv->trace_bits;
|
||||||
|
|
||||||
@ -376,7 +376,7 @@ void classify_counts(afl_forkserver_t *fsrv) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
void classify_counts(afl_forkserver_t *fsrv) {
|
void __attribute__ ((hot)) classify_counts(afl_forkserver_t *fsrv) {
|
||||||
|
|
||||||
u32 *mem = (u32 *)fsrv->trace_bits;
|
u32 *mem = (u32 *)fsrv->trace_bits;
|
||||||
|
|
||||||
@ -534,7 +534,7 @@ static void write_crash_readme(afl_state_t *afl) {
|
|||||||
save or queue the input test case for further analysis if so. Returns 1 if
|
save or queue the input test case for further analysis if so. Returns 1 if
|
||||||
entry is saved, 0 otherwise. */
|
entry is saved, 0 otherwise. */
|
||||||
|
|
||||||
u8 save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) {
|
u8 __attribute__ ((hot)) save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) {
|
||||||
|
|
||||||
if (unlikely(len == 0)) { return 0; }
|
if (unlikely(len == 0)) { return 0; }
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ u64 time_spent_working = 0;
|
|||||||
/* Execute target application, monitoring for timeouts. Return status
|
/* Execute target application, monitoring for timeouts. Return status
|
||||||
information. The called program will update afl->fsrv->trace_bits. */
|
information. The called program will update afl->fsrv->trace_bits. */
|
||||||
|
|
||||||
fsrv_run_result_t fuzz_run_target(afl_state_t *afl, afl_forkserver_t *fsrv,
|
fsrv_run_result_t __attribute__ ((hot)) fuzz_run_target(afl_state_t *afl, afl_forkserver_t *fsrv,
|
||||||
u32 timeout) {
|
u32 timeout) {
|
||||||
|
|
||||||
#ifdef PROFILING
|
#ifdef PROFILING
|
||||||
@ -72,7 +72,7 @@ fsrv_run_result_t fuzz_run_target(afl_state_t *afl, afl_forkserver_t *fsrv,
|
|||||||
old file is unlinked and a new one is created. Otherwise, afl->fsrv.out_fd is
|
old file is unlinked and a new one is created. Otherwise, afl->fsrv.out_fd is
|
||||||
rewound and truncated. */
|
rewound and truncated. */
|
||||||
|
|
||||||
void write_to_testcase(afl_state_t *afl, void *mem, u32 len) {
|
void __attribute__ ((hot)) write_to_testcase(afl_state_t *afl, void *mem, u32 len) {
|
||||||
|
|
||||||
#ifdef _AFL_DOCUMENT_MUTATIONS
|
#ifdef _AFL_DOCUMENT_MUTATIONS
|
||||||
s32 doc_fd;
|
s32 doc_fd;
|
||||||
@ -858,7 +858,7 @@ abort_trimming:
|
|||||||
error conditions, returning 1 if it's time to bail out. This is
|
error conditions, returning 1 if it's time to bail out. This is
|
||||||
a helper function for fuzz_one(). */
|
a helper function for fuzz_one(). */
|
||||||
|
|
||||||
u8 common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
|
u8 __attribute__ ((hot)) common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
|
||||||
|
|
||||||
u8 fault;
|
u8 fault;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user