From nobody Sat Sep 6 17:16:35 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1757080330; cv=none; d=zohomail.com; s=zohoarc; b=aBQCsh9EaqrVkRcxQVF8FRh+CNlwNNmHcO3UF3mlzn34jIgU6If78mf6Tc9VfoS+qZDw9vZrgP8h5ExF4iRZ3TbNZ05xplI+zVTK/O8QmLBKEpazO1nXhQlATN2+Db/qBEeXgvkAjSYZRsXusXnGcaWEcqejkRPQVrzzYh+lRDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757080330; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M+LwSX/uuPa2gM4twysLBZZ64QwQ6Num9jQnfd3A3y8=; b=HzMhZXQn1VHWPiLacAWaAdgW+IesY4IQEvL6HLXzfX3wKE5buduT/X4l4Fvyqb4uQar2VM4aAnsPmRBq9shCP0dNkCLTErDfzjIzC1kXuY5p5whs2uJtm8hMPq2vze61e6DOu2v5kC69urM1cAkaX455WRazoP8a4Ry/DNpbNeg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17570803297611019.7957126909172; Fri, 5 Sep 2025 06:52:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuWqH-0001gl-IG; Fri, 05 Sep 2025 09:51:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uuWqD-0001et-0Z for qemu-devel@nongnu.org; Fri, 05 Sep 2025 09:51:01 -0400 Received: from forwardcorp1a.mail.yandex.net ([178.154.239.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uuWq2-0006XD-MW for qemu-devel@nongnu.org; Fri, 05 Sep 2025 09:51:00 -0400 Received: from mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:3a87:0:640:845c:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 8846FC108E; Fri, 05 Sep 2025 16:50:43 +0300 (MSK) Received: from vsementsov-lin.. (unknown [2a02:6bf:8080:b8f::1:11]) by mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id foiXcl3Gh8c0-sl5GhG6P; Fri, 05 Sep 2025 16:50:43 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1757080243; bh=M+LwSX/uuPa2gM4twysLBZZ64QwQ6Num9jQnfd3A3y8=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=V6lAPmdt+NFWWRJxYDVZdclezaHe8WZ4qVVSYd+NXtJ2W37tDoePm2FrGo7/UyVoB Uc+psfaKCxhUfwx8AT/ieBKBgqifvB+V7n1s23PeAOm3XXbSNaNZY+tk02KkqhiN1T 9VPmna1m5ipUG2oMjx+S34J8W21Uo+vMEXu2wNTY= Authentication-Results: mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: jasowang@redhat.com Cc: qemu-devel@nongnu.org, vsementsov@yandex-team.ru, leiyang@redhat.com, steven.sistare@oracle.com, yc-core@yandex-team.ru, peterx@redhat.com, mst@redhat.com, farosas@suse.de, eblake@redhat.com, armbru@redhat.com, thuth@redhat.com, philmd@linaro.org, berrange@redhat.com Subject: [PATCH v3 1/9] net/tap: add some trace points Date: Fri, 5 Sep 2025 16:50:31 +0300 Message-ID: <20250905135039.2202924-2-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250905135039.2202924-1-vsementsov@yandex-team.ru> References: <20250905135039.2202924-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.72; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1757080334021124100 Content-Type: text/plain; charset="utf-8" Add trace points to simplify debugging migration. Signed-off-by: Vladimir Sementsov-Ogievskiy --- net/tap.c | 10 ++++++++++ net/trace-events | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/net/tap.c b/net/tap.c index 2530627a9a..151fb73820 100644 --- a/net/tap.c +++ b/net/tap.c @@ -43,6 +43,7 @@ #include "qemu/main-loop.h" #include "qemu/sockets.h" #include "hw/virtio/vhost.h" +#include "trace.h" =20 #include "net/tap.h" =20 @@ -148,6 +149,9 @@ static ssize_t tap_receive_iov(NetClientState *nc, cons= t struct iovec *iov, g_autofree struct iovec *iov_copy =3D NULL; struct virtio_net_hdr hdr =3D { }; =20 + trace_tap_receive_iov(s->using_vnet_hdr, s->host_vnet_hdr_len, iovcnt, + iov->iov_len); + if (s->host_vnet_hdr_len && !s->using_vnet_hdr) { iov_copy =3D g_new(struct iovec, iovcnt + 1); iov_copy[0].iov_base =3D &hdr; @@ -199,6 +203,8 @@ static void tap_send(void *opaque) break; } =20 + trace_tap_send_packet(s->using_vnet_hdr, s->host_vnet_hdr_len, siz= e); + if (s->host_vnet_hdr_len && size <=3D s->host_vnet_hdr_len) { /* Invalid packet */ break; @@ -980,6 +986,8 @@ int tap_enable(NetClientState *nc) TAPState *s =3D DO_UPCAST(TAPState, nc, nc); int ret; =20 + trace_tap_enable(); + if (s->enabled) { return 0; } else { @@ -997,6 +1005,8 @@ int tap_disable(NetClientState *nc) TAPState *s =3D DO_UPCAST(TAPState, nc, nc); int ret; =20 + trace_tap_disable(); + if (s->enabled =3D=3D 0) { return 0; } else { diff --git a/net/trace-events b/net/trace-events index cda960f42b..a8921763ab 100644 --- a/net/trace-events +++ b/net/trace-events @@ -29,3 +29,9 @@ vhost_vdpa_set_address_space_id(void *v, unsigned vq_grou= p, unsigned asid_num) " vhost_vdpa_net_load_cmd(void *s, uint8_t class, uint8_t cmd, int data_num,= int data_size) "vdpa state: %p class: %u cmd: %u sg_num: %d size: %d" vhost_vdpa_net_load_cmd_retval(void *s, uint8_t class, uint8_t cmd, int r)= "vdpa state: %p class: %u cmd: %u retval: %d" vhost_vdpa_net_load_mq(void *s, int ncurqps) "vdpa state: %p current_qpair= s: %d" + +# tap.c +tap_receive_iov(bool using_vnet_hdr, uint32_t host_vnet_hdr_len, int iovcn= t, size_t iov_len) "using_vnet_hdr:%d host_vnet_hdr_len:%u iovcnt:%d iov_le= n:%zu" +tap_send_packet(bool using_vnet_hdr, uint32_t host_vnet_hdr_len, int size)= "using_vnet_hdr:%d host_vnet_hdr_len:%u size:%d" +tap_enable(void) "" +tap_disable(void) "" --=20 2.48.1