From patchwork Mon May 16 10:39:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 572972 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1590:0:0:0:0 with SMTP id w16csp989357map; Mon, 16 May 2022 04:54:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn7EjPYz31SGGNKVSMQbrNbZXwoGjQUeA6h6niABv/CPkP4iLySUSS3/FgXZVmrMjrT939 X-Received: by 2002:a37:9bce:0:b0:69f:a640:7297 with SMTP id d197-20020a379bce000000b0069fa6407297mr11769874qke.497.1652702087338; Mon, 16 May 2022 04:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652702087; cv=none; d=google.com; s=arc-20160816; b=S1GDziv7ehTSLB6+dizczffPo0ZHTAkF51Sa5iauLsWpf/XpNCRFUTdsNNZ68T0+c8 r8J/OsELDexKhhJ+ENaP2gX7FtwlGXmotsU/n5XJwAnvSSrX2xuwIBxJoZeAoZQi8V49 UpA6/o6FONEg6weVdFnQ0Q5m5Cd+WxhH63+t4tvvVD2ixiEb0mp3YQq7U6DO4zQRLhYS v26ZEuNT69r1KjVu6QtYmOG8zUyzOfdOofb7mvXYsuRQpLS3MBdclMH5qxtJsn9WPf+O dffH78mbRH1XRPfu6rvRE4pPUNKoYwJxZp8e0rprVAYUjHVLXXKr34Z5DCsivLWlUhx9 ASwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=er6c1eR6RwDHZXwxcu4HK3IQCJPdNMZNebVVRQV+U8s=; b=OtMWmKxvX+y2q/RrTA3ZffiiOrjMefAamebaP9Txn15iY5MAcWKHBuiPdVvvQ16EcF SAyjAGT+XRIgB5S74f4xSMU332PDUgDC5jQEXAKpYO15wrSwAMzhDG6SPqBfFHvj/QOS CNI8tMyR+iu9tf7wLOsEpwNu9KlwYuhlztg/iWgyml0kM1tHvVdC8mcPvUI4iJ/E4UBI 0MWGogYCsBkHgzP5Py9AoE+K6z50Gf49AWLYT5JSyKjTgK3i6RryQX2g/OYV3HvqFfS1 /ltFZ98AGCxR7j1Z9IRU2XA9pzUKoDYHY1o6oxjQmjOhD+ObC8r/WX/PiEFtYrbqKOCT sELw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YQNMKOzp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a13-20020a0562140c2d00b0045a8584623bsi6617896qvd.247.2022.05.16.04.54.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 May 2022 04:54: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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YQNMKOzp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:48016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqZJG-0003VN-Sf for patch@linaro.org; Mon, 16 May 2022 07:54:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqY8C-00015h-9b for qemu-devel@nongnu.org; Mon, 16 May 2022 06:39:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqY8A-0005bo-6D for qemu-devel@nongnu.org; Mon, 16 May 2022 06:39:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652697553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=er6c1eR6RwDHZXwxcu4HK3IQCJPdNMZNebVVRQV+U8s=; b=YQNMKOzpc1bUFL43vFFyPj4hZ9Uu7cK4/iTO0fH8HSlfglndPyFLY35ZyDWkR6QavMvv9t 6MtFMHSrifSlCSK6jiHynfiDJ86EAEdlA0jbr0GBVSuH1YzgsugwTUNCKTb7Bw5HMLhSaN j/MkDk1wgG5ubUM0xbmGigfvKumekss= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-9Kbe6WHTNTC4VXZ24I5Qlw-1; Mon, 16 May 2022 06:39:12 -0400 X-MC-Unique: 9Kbe6WHTNTC4VXZ24I5Qlw-1 Received: by mail-wm1-f72.google.com with SMTP id k5-20020a05600c0b4500b003941ca130f9so6568459wmr.0 for ; Mon, 16 May 2022 03:39:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=er6c1eR6RwDHZXwxcu4HK3IQCJPdNMZNebVVRQV+U8s=; b=zMqJxAd71Xnl/BlLeg6ZIgJV39OipG2thkNk7YJlA4wC8ge3zs/11skvupQBPeZCMw InH0j6mPscscVn50tKkNULpuZ0TKo6syY1b4m+KmvPIhjLl5cUA37Pb9as/89k6p6ndC rKKm4ujjeBcD17+dq/W3v4RZEQixAr0mSMcWlAeQFchOIXAXUy+FlHiKFiqD8FFXXWk9 f9k4zt2d24TXRiik5OnAkNn/jjS7sAgVfVTHgS+PHvGdvyyS151Bep/9c4bYkVDZ6zbN NkAJDvdibQgtraN34ODVCv66alEyjIYzW/irzWl+NwURLGZn4TlET4PrEN8VdEtJlEMB /eog== X-Gm-Message-State: AOAM531DVEVW/Ofb4EnzoS12JRhyQC18EPsT2f4+fUkPCLMIfmssEFnj GJWo2GDnd3OVkNfV/skvi0A6GAvyULaCtkjY7km7EZ9GSHaeOaciVLYJ9nTUbISXIvyOSXEZoCJ 8oHZKUBNQhRlvGhAHcnv4dlmMMvHG91JKUehsMOUgGP6YFqlMJbYsu6hK7Gw3 X-Received: by 2002:a05:6000:793:b0:20c:c809:9af1 with SMTP id bu19-20020a056000079300b0020cc8099af1mr13293435wrb.370.1652697551047; Mon, 16 May 2022 03:39:11 -0700 (PDT) X-Received: by 2002:a05:6000:793:b0:20c:c809:9af1 with SMTP id bu19-20020a056000079300b0020cc8099af1mr13293416wrb.370.1652697550724; Mon, 16 May 2022 03:39:10 -0700 (PDT) Received: from redhat.com ([2.55.141.66]) by smtp.gmail.com with ESMTPSA id z12-20020a7bc7cc000000b003942a244f39sm14968435wmk.18.2022.05.16.03.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 03:39:10 -0700 (PDT) Date: Mon, 16 May 2022 06:39:08 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Philippe =?utf-8?q?M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 60/91] hw/virtio: add vhost_user_[read|write] trace points Message-ID: <20220516095448.507876-61-mst@redhat.com> References: <20220516095448.507876-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220516095448.507876-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée 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 Message-Id: <20220321153037.3622127-4-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- 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 afd51f79b3..6c8f722262 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 7a6576d833..65e3b704ec 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