Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions instrumentor/llvm_mode/src/afl-llvm-rt.o.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct Event
u64 fevtType; // 2: function
s64 ftimestamp;
u64 fevtID;
u64 temporal;
};
struct
{
Expand Down Expand Up @@ -93,6 +94,7 @@ void track_functions(u16 evtID)
evtVec_ptr[loc].fevtType = FUNC_EVENT_TYPE;
evtVec_ptr[loc].fevtID = evtID;
evtVec_ptr[loc].ftimestamp = time;
evtVec_ptr[loc].temporal = 42;
}

void init_shm_dsfuzz()
Expand Down
3 changes: 2 additions & 1 deletion mediator/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub enum Event {
},
FunctionExecute {
function_id: FunctionId,
temporal: u64,
},
AFLHitCount {
branch_events: Vec<BranchHitCount>,
Expand Down Expand Up @@ -164,7 +165,7 @@ impl fmt::Display for Event {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Event::BlockExecute { block_id } => write!(f, "BB({})", block_id),
Event::FunctionExecute { function_id } => write!(f, "Func({})", function_id),
Event::FunctionExecute { function_id, temporal } => write!(f, "Func({}) temporal({})", function_id, temporal),
Event::AFLHitCount { branch_events: _ } => {
write!(f, "AFLBranchEvent(<not printed>)")
}
Expand Down
17 changes: 10 additions & 7 deletions mediator/src/feedback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ impl FeedbackManager {
let mut pkt_rdr = Cursor::new(pkt_cached_data);
// pkt_rdr.seek(SeekFrom::Start(starting_offset)).unwrap();

log::debug!(
"[FEEDBACK] Received batch {} consisting of {} execution events and {} packet events from {}",
log::info!(
"[FEEDBACKK] Received batch {} consisting of {} execution events and {} packet events from {}",
batch_id,
db_evt_counter,
pkt_evt_counter,
Expand All @@ -358,8 +358,8 @@ impl FeedbackManager {
// BlockExecute
BLOCK_EVENT_TYPE => {
let eid = db_rdr.read_u64::<BOrd>().unwrap();
log::debug!(
"[Node {} Batch {} Entry {} / {}] BlockExecute {} @ {}",
log::info!(
"[BLOCK_EVENT_TYPE][Node {} Batch {} Entry {} / {}] BlockExecute {} @ {}",
node_id,
batch_id,
db_entry_index,
Expand All @@ -375,17 +375,20 @@ impl FeedbackManager {
// FunctionExecute
FUNC_EVENT_TYPE => {
let function_id = db_rdr.read_u64::<BOrd>().unwrap();
log::debug!(
"[Node {} Batch {} Entry {} / {}] FunctionExecute {} @ {}",
let temporal = db_rdr.read_u64::<BOrd>().unwrap();
log::info!(
"[FUNC_EVENT_TYPE][Node {} Batch {} Entry {} / {}] FunctionExecute {} @ {} @ Temporal {}",
node_id,
batch_id,
db_entry_index,
db_evt_counter,
function_id,
ts
ts,
temporal
);
Event::FunctionExecute {
function_id: function_id as u16,
temporal: temporal as u64,
}
}

Expand Down
8 changes: 5 additions & 3 deletions mediator/src/feedback/producers/eventhistory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use super::{LayeredChangeAwareSet, SummaryProducer, SummaryProducerIdentifier, V
#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord, Hash)]
pub enum EventKind {
BlockExecute { block_id: BlockId },
FunctionExecute { function_id: FunctionId },
FunctionExecute { function_id: FunctionId, temporal: u64 },
PacketSend { data: u32, from: NodeId, to: NodeId },
PacketReceive { data: u32, from: NodeId, to: NodeId },
ResetSummary,
Expand All @@ -43,7 +43,7 @@ impl fmt::Display for EventKind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::BlockExecute { block_id } => write!(f, "BB({})", block_id),
Self::FunctionExecute { function_id } => write!(f, "F({})", function_id),
Self::FunctionExecute { function_id, temporal } => write!(f, "F({}) temporal({})", function_id, temporal),
Self::PacketSend { data, from, to } => {
write!(f, "Send({} from {} to {})", data, from, to)
}
Expand Down Expand Up @@ -72,8 +72,9 @@ impl EventKind {
Event::BlockExecute { block_id, .. } => Some(EventKind::BlockExecute {
block_id: *block_id,
}),
Event::FunctionExecute { function_id, .. } => Some(EventKind::FunctionExecute {
Event::FunctionExecute { function_id, temporal, .. } => Some(EventKind::FunctionExecute {
function_id: *function_id,
temporal: *temporal,
}),
Event::PacketSend { data, to, .. } => Some(EventKind::PacketSend {
data: *data,
Expand Down Expand Up @@ -574,6 +575,7 @@ impl SummaryProducer for EventHistory {
}

fn update(&mut self, new_event: &LamportEvent, state_similarity_threshold: f64) {
log::info!("[EVENT] {}", new_event);
if let Some(ev_kind) = EventKind::from_event(new_event) {
// Update the vector clock.
self.vc.update(new_event, state_similarity_threshold);
Expand Down