patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH] tools/router: trace unicast packets
@ 2026-06-19 13:09 Alyssa Ross
  2026-06-21 10:57 ` Yureka
  0 siblings, 1 reply; 4+ messages in thread
From: Alyssa Ross @ 2026-06-19 13:09 UTC (permalink / raw)
  To: devel; +Cc: Yureka Lilian

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
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools/router: trace unicast packets
  2026-06-19 13:09 [PATCH] tools/router: trace unicast packets Alyssa Ross
@ 2026-06-21 10:57 ` Yureka
  2026-06-24  7:53   ` Alyssa Ross
  2026-06-25 11:28   ` Alyssa Ross
  0 siblings, 2 replies; 4+ messages in thread
From: Yureka @ 2026-06-21 10:57 UTC (permalink / raw)
  To: hi; +Cc: devel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools/router: trace unicast packets
  2026-06-21 10:57 ` Yureka
@ 2026-06-24  7:53   ` Alyssa Ross
  2026-06-25 11:28   ` Alyssa Ross
  1 sibling, 0 replies; 4+ messages in thread
From: Alyssa Ross @ 2026-06-24  7:53 UTC (permalink / raw)
  To: Yureka; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]

Yureka <yuka@yuka.dev> writes:

> 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.

Ah, yes, I saw some other program doing that recently.
Will investigate, thanks!.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools/router: trace unicast packets
  2026-06-21 10:57 ` Yureka
  2026-06-24  7:53   ` Alyssa Ross
@ 2026-06-25 11:28   ` Alyssa Ross
  1 sibling, 0 replies; 4+ messages in thread
From: Alyssa Ross @ 2026-06-25 11:28 UTC (permalink / raw)
  To: Yureka; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]

Yureka <yuka@yuka.dev> writes:

> 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.

We're already using release_max_level_debug, so traces are already
omitted from release binaries, aren't they?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-25 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-19 13:09 [PATCH] tools/router: trace unicast packets Alyssa Ross
2026-06-21 10:57 ` Yureka
2026-06-24  7:53   ` Alyssa Ross
2026-06-25 11:28   ` Alyssa Ross

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).