-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introspection #58
Merged
Merged
Introspection #58
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
12b9584
Rework to put `ClientPerfStats` in `State` and pass that along. Still…
ctfhacker c017d72
Add perf_stats feature to libafl/Cargo.toml
ctfhacker 23061ef
Update feedbacks to have with_perf
ctfhacker 9469776
Merge branch 'real_time_benchmarks' of github.com:AFLplusplus/LibAFL …
ctfhacker 542738c
Merge branch 'dev' into real_time_benchmarks
ctfhacker fedb5f8
Remove unneeeded print statement
ctfhacker 7423cef
cargo fmt all the things
ctfhacker 4ad9c10
use local llvmint vs cpu specific asm for reading cycle counter
ctfhacker b9a0c7c
Remove debug testing code
ctfhacker 2a96fe3
Stats timeout to 3 seconds
ctfhacker 55703cb
Inline smallish functions for ClientPerfStats
ctfhacker 042bfce
Remove .libs/llvmint and have the correct conditional compilation of …
ctfhacker 2b6b369
pub(crate) the NUM_FEEDBACK and NUM_STAGES consts
ctfhacker 8219da3
Merge branch 'dev' into real_time_benchmarks
domenukk 33df973
perf_stats->instrospection; merged dev; moved back to x86 stable
domenukk b9e75c0
Tcp Broker to Broker Communication (#66)
domenukk 3fb4626
merged dev
domenukk 0ac407a
adapted to new feedback interface;;
domenukk 6cc1e96
clippy fixes
domenukk 1fa893e
fallback to systemtime on non-x86
domenukk 5d1eb27
make clippy more strict
domenukk f56f340
small fixes
andreafioraldi 1e61748
bump 0.2.1
andreafioraldi 92116b9
readme
andreafioraldi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
PWD=`pwd` | ||
|
||
all: | ||
# Build the libpng libfuzzer library | ||
cargo build --release | ||
|
||
# Build the libpng harness | ||
$(PWD)/target/release/cxx \ | ||
$(PWD)/harness.cc \ | ||
$(PWD)/libpng-1.6.37/.libs/libpng16.a \ | ||
-I$(PWD)/libpng-1.6.37/ \ | ||
-o fuzzer \ | ||
-lm -lz | ||
|
||
run: all | ||
./fuzzer & | ||
./fuzzer >/dev/null 2>/dev/null & | ||
|
||
test: all | ||
timeout 60s ./fuzzer & | ||
timeout 59s taskset 0x00000001 ./fuzzer >/dev/null 2>/dev/null & | ||
timeout 59s taskset 0x00000002 ./fuzzer >/dev/null 2>/dev/null & | ||
timeout 59s taskset 0x00000004 ./fuzzer >/dev/null 2>/dev/null & | ||
timeout 59s taskset 0x00000008 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000010 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000020 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000040 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000080 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000100 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000200 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000400 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000800 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00001000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00002000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00004000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00008000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00010000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00020000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00040000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00080000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00100000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00200000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00400000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00800000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x01000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x02000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x04000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x08000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x10000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x20000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x40000000 ./fuzzer >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x80000000 ./fuzzer >/dev/null 2>/dev/null & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Architecture agnostic processor features | ||
|
||
extern { | ||
#[link_name = "llvm.readcyclecounter"] | ||
pub fn readcyclecounter() -> u64; | ||
} | ||
|
||
/// Read time counter using [`llvmint::readcyclecounter`] | ||
/// | ||
/// This function is a wrapper around [`llvmint`] to make it easier to test various | ||
/// implementations of reading a cycle counter. In this way, an experiment only has to | ||
/// change this implementation rather than every instead of [`cpu::read_time_counter`] | ||
pub fn read_time_counter() -> u64 { | ||
unsafe { readcyclecounter() } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,7 +239,7 @@ where | |
let client = stats.client_stats_mut_for(sender_id); | ||
client.update_corpus_size(*corpus_size as u64); | ||
client.update_executions(*executions as u64, *time); | ||
stats.display(event.name().to_string() + " #" + &sender_id.to_string()); | ||
// stats.display(event.name().to_string() + " #" + &sender_id.to_string()); | ||
Ok(BrokerEventResult::Forward) | ||
} | ||
Event::UpdateStats { | ||
|
@@ -250,7 +250,35 @@ where | |
// TODO: The stats buffer should be added on client add. | ||
let client = stats.client_stats_mut_for(sender_id); | ||
client.update_executions(*executions as u64, *time); | ||
stats.display(event.name().to_string() + " #" + &sender_id.to_string()); | ||
if sender_id == 1 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't be needed, I agree |
||
stats.display(event.name().to_string() + " #" + &sender_id.to_string()); | ||
} | ||
Ok(BrokerEventResult::Handled) | ||
} | ||
#[cfg(feature = "perf_stats")] | ||
Event::UpdatePerfStats { | ||
time, | ||
executions, | ||
perf_stats, | ||
phantom: _, | ||
} => { | ||
// TODO: The stats buffer should be added on client add. | ||
|
||
// Get the client for the sender ID | ||
let client = stats.client_stats_mut_for(sender_id); | ||
|
||
// Update the normal stats for this client | ||
client.update_executions(*executions as u64, *time); | ||
|
||
// Update the performance stats for this client | ||
client.update_perf_stats(*perf_stats); | ||
|
||
// Display the stats via `.display` only on core #1 | ||
if sender_id == 1 { | ||
stats.display(event.name().to_string() + " #" + &sender_id.to_string()); | ||
} | ||
|
||
// Correctly handled the event | ||
Ok(BrokerEventResult::Handled) | ||
} | ||
Event::Objective { objective_size } => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenukk porcodio, now we have to release again because this line was commented