-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
add the metrics(pending,pend_fav, own_finds,imported) #1351
Conversation
Sorry to close this PR #1332 by accident |
libafl/src/events/llmp.rs
Outdated
@@ -624,7 +627,13 @@ impl<E, S, SP, Z> EventManager<E, Z> for LlmpEventManager<S, SP> | |||
where | |||
E: HasObservers<State = S> + Executor<Self, Z>, | |||
for<'a> E::Observers: Deserialize<'a>, | |||
S: UsesInput + HasExecutions + HasClientPerfMonitor + HasMetadata, | |||
S: UsesInput |
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.
you don't need these type constraints
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.
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.
hm but why? can you give me full error log?
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.
because here you don't even use those methods then why is it necessary?
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.
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.
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.
but you don't need this in eventmanager no?
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.
I mean you could just store imported, pending in state, and don't make any traits.
then you don't need these type constraints anymore
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.
hmm, I merge all 4 metrics into one trait HasAFLStats
, then I just need to type one constraint. how about?
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.
ok
can you remove the unnecessary traits? |
a5c3d56
to
5e9c5d7
Compare
is the UI supposed to run on a different process other than the main fuzzer? |
imho out of the fuzzer process is best, @domenukk was first fighting hard for in broker process then thought about it and … not sure what he would want now :) |
Please review my code. |
@ToSeven can you please resolve the conflicts? |
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.
I said "how about putting code in calibration stage" before.
but now i think it feels odd to do the stats stuff in calibration stage.
can you separate the code in calibration stage into another stage like StatsReportsStage
? (You need to make another stage for this)
Merge https://github.com/AFLplusplus/LibAFL/tree/stats_stage to your code. |
ok |
also please run |
As long as it adheres to the |
libafl/src/state/mod.rs
Outdated
@@ -404,6 +439,55 @@ impl<I, C, R, SC> HasExecutions for StdState<I, C, R, SC> { | |||
} | |||
} | |||
|
|||
impl<I, C, R, SC> HasAFLStats for StdState<I, C, R, SC> { |
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.
Should be HasAflStats
for consistency.
That being said, maybe there is an even nicer name? We'll need that guy everywhere.
libafl/src/stages/stats.rs
Outdated
if cur.checked_sub(self.last_report_time).unwrap_or_default() > self.stats_report_interval { | ||
manager.fire( | ||
state, | ||
Event::UpdateUserStats { |
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.
I think we should fire one message with all stats in them, else this could lead to more overhead on the receiving end since UI might have to be updated for each new UserStats
message, etc
libafl/src/state/mod.rs
Outdated
@@ -787,6 +871,10 @@ where | |||
let mut state = Self { | |||
rand, | |||
executions: 0, | |||
pending: 0, |
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.
can you add this member in stages/stats.rs?
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.
instead of putting in state
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.
how about adding the "pending" " pend_favor" "own_finds" to stages/stats.rs and remaining the "imported" in state?
I found it not easy to calculate the value of the "imported" in stats.rs. @tokatoka
ideally your change should be only inside stages/stats.rs |
libafl/src/stages/stats.rs
Outdated
|
||
/// The [`AFLStatsStage`] is a simple stage that computes and reports some stats. | ||
#[derive(Debug, Clone)] | ||
pub struct AFLStatsStage<E, EM, Z> |
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.
We usually use Afl
(lowercase fl
)
libafl/src/stages/mod.rs
Outdated
@@ -256,6 +259,7 @@ where | |||
+ HasMetadata | |||
+ HasRand | |||
+ HasCorpus | |||
+ HasImported |
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.
push adapter doesn't need this right?
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.
Yeah
We moved the |
We should try this PR together with #1432, maybe create (or extend) a fuzzer in ./fuzzers that uses the StatsStage |
I will create a fuzzer with the AFL-Style UI in ./fuzzers |
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.
we can merge this after you resolve the conflict and fix CI.
Head branch was pushed to by a user without write access
Thanks! |
No description provided.