patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Yureka <yuka@yuka.dev>
To: hi@alyssa.is
Cc: devel@spectrum-os.org
Subject: Re: [PATCH] tools/router: trace unicast packets
Date: Sun, 21 Jun 2026 12:57:05 +0200	[thread overview]
Message-ID: <ba8815a7-d862-4412-85cc-8ffc161b4e57@yuka.dev> (raw)
In-Reply-To: <20260619130940.273236-1-hi@alyssa.is>

On 6/19/26 15:09, Alyssa Ross wrote:
> I found this useful for debugging.
> ("Is it actually sending anything?")
>
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> ---
>   tools/router/src/router.rs | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/router/src/router.rs b/tools/router/src/router.rs
> index a91e4155..f36866d8 100644
> --- a/tools/router/src/router.rs
> +++ b/tools/router/src/router.rs
> @@ -11,7 +11,7 @@ use crate::packet::*;
>   use crate::protocol::*;
>   
>   use futures_util::{FutureExt, Sink, SinkExt, Stream, StreamExt};
> -use log::{debug, info, warn};
> +use log::{debug, info, trace, warn};
>   use tokio_stream::StreamMap;
>   use vhost_device_net::IncomingPacket;
>   use vm_memory::GuestMemory;
> @@ -128,6 +128,7 @@ impl<M: GuestMemory> Router<M> {
>                       .await?;
>                   }
>                   ref unicast => {
> +                    trace!("got unicast packet {:?} -> {:?}", in_iface, out_iface);
>                       let Some(sink) = self.sinks.get_mut(unicast) else {
>                           warn!("dropped packet because interface is not ready");
>                           continue;
>
> base-commit: 57bf21eaf65ca5a42d18999ba65f96dcd338113c

In general useful, yes. I think logging on this level could affect 
performance (even if disabled at run-time). There is some crate feature 
of the log crate to conditionally compile the trace log level for debug 
builds.


— Yureka


  reply	other threads:[~2026-06-21 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 13:09 [PATCH] tools/router: trace unicast packets Alyssa Ross
2026-06-21 10:57 ` Yureka [this message]
2026-06-24  7:53   ` Alyssa Ross
2026-06-25 11:28   ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba8815a7-d862-4412-85cc-8ffc161b4e57@yuka.dev \
    --to=yuka@yuka.dev \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).