Skip to content

Commit

Permalink
Some debug/trace logs
Browse files Browse the repository at this point in the history
  • Loading branch information
akoshelev committed Dec 5, 2023
1 parent 9fd865c commit 6211d6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions ipa-core/src/helpers/buffers/ordering_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ impl OrderingSender {

if let Poll::Ready(v) = b.take(cx) {
self.waiting.wake(self.next.load(Acquire));
tracing::trace!("Sending next {} bytes", v.len());
Poll::Ready(Some(v))
} else if b.closed {
Poll::Ready(None)
Expand Down
1 change: 1 addition & 0 deletions ipa-core/src/helpers/buffers/unordered_receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ where
return Poll::Pending;
}
Poll::Ready(Some(b)) => {
tracing::trace!("Received next {} bytes", b.as_ref().len());
if let Some(m) = self.spare.extend(b.as_ref()) {
self.wake_next();
return Poll::Ready(Ok(m));
Expand Down
3 changes: 3 additions & 0 deletions ipa-core/src/helpers/gateway/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ impl Stream for GatewaySendStream {
type Item = Vec<u8>;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let channel_id = &self.inner.channel_id;
let span = tracing::trace_span!("send", to = ?channel_id.role, gate = ?channel_id.gate);
let _enter = span.enter();
Pin::get_mut(self).inner.ordering_tx.take_next(cx)
}
}
2 changes: 1 addition & 1 deletion ipa-core/src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Serializable for EventType {
match buf[0] {
0 => EventType::Trigger,
1 => EventType::Source,
v @ 2_u8..=u8::MAX => panic!("Unrecognized event type: {v}"),
v@ 2_u8..=u8::MAX => panic!("Unrecognized event type: {v}"),
}
}
}
Expand Down

0 comments on commit 6211d6a

Please sign in to comment.