From patchwork Mon Mar 21 15:30:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 553345 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp1611014mag; Mon, 21 Mar 2022 08:39:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBR3e5+Cz8/bpA+xc8mFmpwy1CHmgxZ23PEgBPBoZSAeP1A4oOpgMA6UhPewsxHtnllY2P X-Received: by 2002:a25:fe10:0:b0:625:262f:e792 with SMTP id k16-20020a25fe10000000b00625262fe792mr22308357ybe.365.1647877187926; Mon, 21 Mar 2022 08:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647877187; cv=none; d=google.com; s=arc-20160816; b=wDwfZKudYCfzRFil+fYZ0wV8Q7Q+RxIvjbUfH3UrpKbaNowIj9X22eBiEFZp4gE6PG cn5S7Gji+ouDHKCldh/uINwqm1UoMEzBwu7NSgoruQEjfo3LUhsFwPLId52dTU4Y44OJ f+PzUhXPTNXOV4I+o3vtG0Q6+6RyVkoQkAzbINJP3iCDkQm2cLaI41AZ08bJqQKjjZIU cKnAEt39NX90Ov70Lnjt+r6GF6eEbKksxpLgK3/3umHuzLd+iXM4QZRxMUCL7XVZOfWw cXVJaYeQxwcGigljHNkSKy8wt0PdPQcPAI2/jza/O76xkiHGBypfr4wrrgVMW0WMJvOJ L1eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Fv7Hk1/HDLttl5dKx17BpMvs2hVpQkkoar5VTIKNwUg=; b=CpyjJQhO9s/u08qSHu0IeK7kdwocAoQUWhDYK8CbiTH4Ow6h0sJV4WWtgf0nxAGRIq 6E+p3tNjg0no+itXxLrx0Tr6JW04nhjrF5SkLrU9F85yHJndlqCrWHZoHJ/vYk8XZiaE oWrsk+o9DEZ5H/Fwdr26DxYNhnyQ7ULmSdrMP0xA7yA0zHW7P/6kECa9tjcKlZ5b/ZX7 rBjKSHdMKhwpNp9tEEYNFO8ECjX48tWtW8m7+ow5Cef9jFIVrP7T8kU2n95CPiyLSOH4 D+T+m96rRIZ8Ss83/H7hljx36I/G10hcR4dDPnrsM74YyKQbv942Jf7vjOq+PlPZvJo9 tSVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K5wwY7tn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 76-20020a250d4f000000b0063399404464si12571236ybn.206.2022.03.21.08.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Mar 2022 08:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K5wwY7tn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWK8J-000341-Cd for patch@linaro.org; Mon, 21 Mar 2022 11:39:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWJze-0005ET-QI for qemu-devel@nongnu.org; Mon, 21 Mar 2022 11:30:51 -0400 Received: from [2a00:1450:4864:20::62d] (port=40655 helo=mail-ej1-x62d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWJzd-0004v2-AF for qemu-devel@nongnu.org; Mon, 21 Mar 2022 11:30:50 -0400 Received: by mail-ej1-x62d.google.com with SMTP id p15so30602122ejc.7 for ; Mon, 21 Mar 2022 08:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fv7Hk1/HDLttl5dKx17BpMvs2hVpQkkoar5VTIKNwUg=; b=K5wwY7tn7bVAQ9KfGxGo0c8UeN4eku2snUfsU590OZe78ASs8JYIjfRDfcd0iQcwi8 3dfKQA9tjVB2dz824e7drl9oQuNNTSgfellWkNgAG2KnKfHzuzr+Sr3nG7jwDjFBOKKz nviBDLxoCgwEfSP+OK3mz//vdx4P/XdrxN2n77sqT5WuxtZO9O3KCj0+WSZoTVVpOtYC 5+y0Z/jhgw80wkAjCuCPi2Sld22mkZAvammPYnD3bAc/ad987DXtkIOGqNzzJa6odnNY ac9u/NChAxbO07VNelZwPcVsl0enzynp3xnMOPM/9Os1dUpxHOjr1xvN5YDhzSPkefdT f6lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fv7Hk1/HDLttl5dKx17BpMvs2hVpQkkoar5VTIKNwUg=; b=qX/xSE6A/IwwBYsR0E2hYtoOL5USjDtnLKCRVFJm5d9xY4UlvBOiRvlHbLiQH9Oise pwxK9lMUyf7kNwx0oVC/1/dpy2lzLrw60D9X3D1FatYLlT6v6fQrq9y989uicg1YWa+a WY/NZKX/EXc5aqwt3mFe8omDfP64q7J/Zn8Pg0u5wMmEWQNdS09xufitf3lbte3EqUV0 dCPhIBQgNdBNV7ZMsBoRDk8710xXRFhhNyjNCAamlDe/vowf4DAHk5J+hLadZdojqDJo 8tWCf0SJAIaYeodudPNDbiAaPM7cEHlJImv7JoKl7kbkjHwmRE9BmPUrqcZyY49uEPS/ /y/w== X-Gm-Message-State: AOAM533YOLTtAzvcrjJ/aHsv5a+afn3+iYObJpRhGfv0xlADqzRtrnn2 YIUPNM0jbm0CGwp73RB/Z/Q7Og== X-Received: by 2002:a17:907:b590:b0:6cf:48a4:9a4c with SMTP id qx16-20020a170907b59000b006cf48a49a4cmr20968594ejc.6.1647876644767; Mon, 21 Mar 2022 08:30:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id ky5-20020a170907778500b006d1b2dd8d4csm7110747ejc.99.2022.03.21.08.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 08:30:41 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EE4B01FFBB; Mon, 21 Mar 2022 15:30:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points Date: Mon, 21 Mar 2022 15:30:27 +0000 Message-Id: <20220321153037.3622127-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321153037.3622127-1-alex.bennee@linaro.org> References: <20220321153037.3622127-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: slp@redhat.com, mathieu.poirier@linaro.org, mst@redhat.com, viresh.kumar@linaro.org, stefanha@redhat.com, marcandre.lureau@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These are useful when trying to debug the initial vhost-user negotiation, especially when it hard to get logging from the low level library on the other side. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- v2 - fixed arguments --- hw/virtio/vhost-user.c | 4 ++++ hw/virtio/trace-events | 2 ++ 2 files changed, 6 insertions(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 6abbc9da32..b27b8c56e2 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -489,6 +489,8 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg, return ret < 0 ? -saved_errno : -EIO; } + trace_vhost_user_write(msg->hdr.request, msg->hdr.flags); + return 0; } @@ -542,6 +544,8 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base, } } + trace_vhost_user_read(msg.hdr.request, msg.hdr.flags); + return 0; } diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 46851a7cd1..fd213e2a27 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -21,6 +21,8 @@ vhost_user_set_mem_table_withfd(int index, const char *name, uint64_t memory_siz vhost_user_postcopy_waker(const char *rb, uint64_t rb_offset) "%s + 0x%"PRIx64 vhost_user_postcopy_waker_found(uint64_t client_addr) "0x%"PRIx64 vhost_user_postcopy_waker_nomatch(const char *rb, uint64_t rb_offset) "%s + 0x%"PRIx64 +vhost_user_read(uint32_t req, uint32_t flags) "req:%d flags:0x%"PRIx32"" +vhost_user_write(uint32_t req, uint32_t flags) "req:%d flags:0x%"PRIx32"" # vhost-vdpa.c vhost_vdpa_dma_map(void *vdpa, int fd, uint32_t msg_type, uint64_t iova, uint64_t size, uint64_t uaddr, uint8_t perm, uint8_t type) "vdpa:%p fd: %d msg_type: %"PRIu32" iova: 0x%"PRIx64" size: 0x%"PRIx64" uaddr: 0x%"PRIx64" perm: 0x%"PRIx8" type: %"PRIu8