At 2025-12-10 17:04:04, "Michael S. Tsirkin" <[email protected]> wrote:
>On Thu, Nov 27, 2025 at 11:24:00AM +0800, Longjun Tang wrote:
>> From: Tang Longjun <[email protected]>
>> 
>> hi,
>> virtnet_mon is used to monitor the data packets of the virtio_net driver 
>> and the related parameters of virtqueue, useful for tracking its status 
>> and troubleshooting faults.
>> 
>> pls review. tks
>> 
>> Best regard.
>
>what does this achieve that direct use of tracing would not?

I apologize that my explanation of virtnet_mon was not detailed enough. 
virtnet_mon uses kprobe and buffers to monitor virtio_net. 
To monitor virtio_net, it is necessary to track the member parameters of the 
virtqueue corresponding to each data packet and output them. 
When PPS very high, other tracing techniques, such as ebpf, may not be able to 
handle it, resulting in data loss because they do not have sufficiently large 
buffers to batch export log data.

As for the duplicate code, it is only to obtain the layout of the relevant 
structure, and I have not yet thought of a way to avoid duplication. I would 
love to hear your suggestions.

>
>> Tang Longjun (7):
>>   tools/virtio/virtnet_mon: create misc driver for virtnet_mon
>>   tools/virtio/virtnet_mon: add kfifo to virtnet_mon
>>   tools/virtio/virtnet_mon: add kprobe start_xmit
>>   tools/virtio/virtnet_mon: add kprobe gro_receive_skb
>>   tools/virtio/virtnet_mon: add kprobe ip_local_deliver
>>   tools/virtio/virtnet_mon: add kprobe skb_xmit_done and skb_recv_done
>>   tools/virtio/virtnet_mon: add README file for virtnet_moin
>> 
>>  tools/virtio/virtnet_mon/Makefile      |   10 +
>>  tools/virtio/virtnet_mon/README        |   35 +
>>  tools/virtio/virtnet_mon/virtnet_mon.c | 1048 ++++++++++++++++++++++++
>>  3 files changed, 1093 insertions(+)
>>  create mode 100644 tools/virtio/virtnet_mon/Makefile
>>  create mode 100644 tools/virtio/virtnet_mon/README
>>  create mode 100644 tools/virtio/virtnet_mon/virtnet_mon.c
>> 
>> -- 
>> 2.43.0

Reply via email to