From patchwork Mon Feb 5 19:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 10201667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79283601A1 for ; Mon, 5 Feb 2018 19:47:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68653287FD for ; Mon, 5 Feb 2018 19:47:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D2E82880A; Mon, 5 Feb 2018 19:47:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F027C287FD for ; Mon, 5 Feb 2018 19:47:00 +0000 (UTC) Received: from localhost ([::1]:54868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eimjE-0004cD-4N for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Feb 2018 14:47:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eimSK-0004VB-6h for qemu-devel@nongnu.org; Mon, 05 Feb 2018 14:29:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eimSJ-00051C-7Y for qemu-devel@nongnu.org; Mon, 05 Feb 2018 14:29:32 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:42668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eimSJ-00050j-1q for qemu-devel@nongnu.org; Mon, 05 Feb 2018 14:29:31 -0500 Received: by mail-wr0-x243.google.com with SMTP id 41so29436343wrc.9 for ; Mon, 05 Feb 2018 11:29:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Thddhq8pp/TkQWl58iyosVukeRmXROUTNlFe6RXinM4=; b=u/cPUxWTB237yd41nsAvlRQixiGvzPsSSXeNdoQ4F79SM9C6ZoOQV0s4up60qG6PHk +lWGM5Wh4bCcv6wKSw6XYarsCk3VodgLEhnW4UMFBlJMDhrpDjX1JsjzffKdacnljybw gozpAxbQyCD5wLbiQpbehAQDvdAhguAOBKWCF+Rivx5NWX9J/WVotdgc40LzECvHJeHS xKonJ0wWsmaXN0oJn8IhbtCUP+Z5awqGrdXR8nKx78Lb9hDZc9IUuc4Sal2q4mgjH/yZ uMNgiTPnZacbbkQ12skhMcWnqniThjmuJb0eUor8o3S1MOLmgsjguxGVZGd/FRlM5t5A ER8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Thddhq8pp/TkQWl58iyosVukeRmXROUTNlFe6RXinM4=; b=YDRsO+2hVikyyoJfqgayx3E5ungmH1RQw5d5rcHRW9YjHXf1YamB9XM/Rfbu7C2LTw C/ZhYGF79h9m0vLLgDTMbJh+N2P/tg/TCpol7BGDlSKGVcfooQh+lqUNlSzxSVr51dGh UM6mJQuehxpIW7MH0Qa1Zfhoj+nP61mxrlzWANnRreqk3pAPMdWSWE7TT/9RxuKtBE6F /m/caZF57ApotFPO63rSeXTygT2ctx2JAcNDsFUqtL8MjnMZzVcK2uU9IiKGhd3V2Ku5 1qjWjX5MW4s/qRlKVu6n+9dIYNAhvw2su2ahUAApTyCo9Q6/7Q27hRSAJhJgX8aDFHzV wCzg== X-Gm-Message-State: AKwxytdmDFgYxVGFHdR/O0ljs9E17ffALDz6ytgN24p8U1J7TwLsSfaX gZCFIVja7F8SGN7nB6Vcniamkdyh X-Google-Smtp-Source: AH8x2253DvP6cYgW9X+HosvfmEtI4nuGT796a3lqOLyNmx4TflLeIn3+EtXDjIIsBIc9doDxDUOaGA== X-Received: by 10.223.160.27 with SMTP id k27mr20840210wrk.5.1517858969630; Mon, 05 Feb 2018 11:29:29 -0800 (PST) Received: from 640k.lan ([82.84.122.246]) by smtp.gmail.com with ESMTPSA id g8sm20029891wra.18.2018.02.05.11.29.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Feb 2018 11:29:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 20:28:35 +0100 Message-Id: <1517858941-5538-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1517858941-5538-1-git-send-email-pbonzini@redhat.com> References: <1517858941-5538-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 21/47] vhost: add traces for memory listeners X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Xu Trace these operations on two memory listeners. It helps to verify the new memory listener fix, and good to keep them there. Signed-off-by: Peter Xu Message-Id: <20180122060244.29368-2-peterx@redhat.com> Acked-by: Michael S. Tsirkin Reviewed-by: Paolo Bonzini Signed-off-by: Paolo Bonzini --- hw/virtio/trace-events | 6 ++++++ hw/virtio/vhost.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 775461a..2b8f81e 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -25,3 +25,9 @@ virtio_balloon_handle_output(const char *name, uint64_t gpa) "section name: %s g virtio_balloon_get_config(uint32_t num_pages, uint32_t actual) "num_pages: %d actual: %d" virtio_balloon_set_config(uint32_t actual, uint32_t oldactual) "actual: %d oldactual: %d" virtio_balloon_to_target(uint64_t target, uint32_t num_pages) "balloon target: 0x%"PRIx64" num_pages: %d" + +# hw/virtio/vhost.c +vhost_region_add(void *p, const char *mr) "dev %p mr %s" +vhost_region_del(void *p, const char *mr) "dev %p mr %s" +vhost_iommu_region_add(void *p, const char *mr) "dev %p mr %s" +vhost_iommu_region_del(void *p, const char *mr) "dev %p mr %s" diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 386aef8..c4f654c 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -27,6 +27,7 @@ #include "hw/virtio/virtio-access.h" #include "migration/blocker.h" #include "sysemu/dma.h" +#include "trace.h" /* enabled until disconnected backend stabilizes */ #define _VHOST_DEBUG 1 @@ -687,6 +688,7 @@ static void vhost_region_add(MemoryListener *listener, return; } + trace_vhost_region_add(dev, section->mr->name ?: NULL); ++dev->n_mem_sections; dev->mem_sections = g_renew(MemoryRegionSection, dev->mem_sections, dev->n_mem_sections); @@ -706,6 +708,7 @@ static void vhost_region_del(MemoryListener *listener, return; } + trace_vhost_region_del(dev, section->mr->name ?: NULL); vhost_set_memory(listener, section, false); memory_region_unref(section->mr); for (i = 0; i < dev->n_mem_sections; ++i) { @@ -743,6 +746,8 @@ static void vhost_iommu_region_add(MemoryListener *listener, return; } + trace_vhost_iommu_region_add(dev, section->mr->name ?: NULL); + iommu = g_malloc0(sizeof(*iommu)); end = int128_add(int128_make64(section->offset_within_region), section->size); @@ -771,6 +776,8 @@ static void vhost_iommu_region_del(MemoryListener *listener, return; } + trace_vhost_iommu_region_del(dev, section->mr->name ?: NULL); + QLIST_FOREACH(iommu, &dev->iommu_list, iommu_next) { if (iommu->mr == section->mr && iommu->n.start == section->offset_within_region) {