From nobody Wed Feb 11 06:50:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506037765161334.0600270118067; Thu, 21 Sep 2017 16:49:25 -0700 (PDT) Received: from localhost ([::1]:56012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvBDe-0007Tv-Ae for importer@patchew.org; Thu, 21 Sep 2017 19:49:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvAiW-0004tj-8k for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvAiV-0004S1-2Z for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:12 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvAiU-0004Qs-RZ for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:10 -0400 Received: by mail-wm0-x241.google.com with SMTP id i131so6442735wma.1 for ; Thu, 21 Sep 2017 16:17:10 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id u186sm2596278wmd.19.2017.09.21.16.17.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 16:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=o4Z1TThZwPTtOp7RyEld3ZAvdP5njGs4RFsJ+uKWYJc=; b=Y2K0AceCj4gIv1UmKoicj/g5Q5gC9dsNM4kob21mP5AKtghcYgpfzyPutVcwbkARAZ tvgR93OsP2kBqzySsLzuoPZSP6y7DsKooFwQFRgP55jcow0M+UB4RK9C0AOfC3WIAWRh s1gZ0Pk2j+cYLP7DHVsDD8foSAGEEVdeaYASqnbxTuJdy+nYVOq2096MxBNVN5yk10NP fhIl6B//lhqlybnxrOgcCUfZf1tVxP+PfIj/qU8CjoRg4X/Z9Rt+F3us5e2Sg0gglS8R d2mbSK9WmyeYnQAtFaqsbMhnB4MVnY/RnH4Um5e+Fl/1oHApzUdKibd8k7tZ7vGNDuo9 z2/Q== 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:subject:date:message-id :in-reply-to:references; bh=o4Z1TThZwPTtOp7RyEld3ZAvdP5njGs4RFsJ+uKWYJc=; b=Cyxjmv41i4GraIFEGRPAqnj+auRc2qRfA/edrHZ2cgEj8Y88Mggzwn3Leapkb/VywD v124Zxt95GzlQ0m2/pHFq25t3oU6KIj0IiJ3pNF2ncIPHRhSirPfNNM7Gv9oV6aKE+Es JCKoF41VdCTT4N9NaHWkBlezsueHZ1XqsG0t305ro24dDhHM4DQbX8ZqopcT2Psg7a3m JiAYPxc41goMD3cWCPp+wWTD4fuLI90DEw1DGkUEMUXc1eszAvFCmdpIgVLdALwRan7n SJKEr2gv6r1Hi/A+9CdO4qHP7of4fnLutc/1O37UA826nLF58bjMYkI24Ud+ZWoF3kmM cl2A== X-Gm-Message-State: AHPjjUjM/VT75nTwf+E6wO4nhGSyYxOcLdkTv+lNtP+JiGQJJXco1hlF itCzVB98cL+5EdmKovO6KJoJfXip X-Google-Smtp-Source: AOwi7QBrh4yZWrHRWS2vG/Gq2Uzsoo0WC6pdEh7oPI1KefUDckKDK1EF8Y70/RN2ty+nPzCPkP5n1Q== X-Received: by 10.28.0.15 with SMTP id 15mr2193666wma.7.1506035829637; Thu, 21 Sep 2017 16:17:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 22 Sep 2017 01:16:30 +0200 Message-Id: <1506035800-30509-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1506035800-30509-1-git-send-email-pbonzini@redhat.com> References: <1506035800-30509-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:c09::241 Subject: [Qemu-devel] [PULL 22/32] memory: trace FlatView creation and destruction 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 1 - include/qemu/typedefs.h | 1 + memory.c | 3 +++ trace-events | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 402824c..5ed4042 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -48,7 +48,6 @@ =20 typedef struct MemoryRegionOps MemoryRegionOps; typedef struct MemoryRegionMmio MemoryRegionMmio; -typedef struct FlatView FlatView; =20 struct MemoryRegionMmio { CPUReadMemoryFunc *read[3]; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 1635502..980d2b3 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -30,6 +30,7 @@ typedef struct DisplaySurface DisplaySurface; typedef struct DriveInfo DriveInfo; typedef struct Error Error; typedef struct EventNotifier EventNotifier; +typedef struct FlatView FlatView; typedef struct FWCfgEntry FWCfgEntry; typedef struct FWCfgIoState FWCfgIoState; typedef struct FWCfgMemState FWCfgMemState; diff --git a/memory.c b/memory.c index 706c385..68cdf8b 100644 --- a/memory.c +++ b/memory.c @@ -270,6 +270,7 @@ static FlatView *flatview_new(MemoryRegion *mr_root) view->ref =3D 1; view->root =3D mr_root; memory_region_ref(mr_root); + trace_flatview_new(view, mr_root); =20 return view; } @@ -295,6 +296,7 @@ static void flatview_destroy(FlatView *view) { int i; =20 + trace_flatview_destroy(view, view->root); if (view->dispatch) { address_space_dispatch_free(view->dispatch); } @@ -314,6 +316,7 @@ static bool flatview_ref(FlatView *view) static void flatview_unref(FlatView *view) { if (atomic_fetch_dec(&view->ref) =3D=3D 1) { + trace_flatview_destroy_rcu(view, view->root); call_rcu(view, flatview_destroy, rcu); } } diff --git a/trace-events b/trace-events index 1f50f56..1d2eb5d 100644 --- a/trace-events +++ b/trace-events @@ -64,6 +64,9 @@ memory_region_tb_read(int cpu_index, uint64_t addr, uint6= 4_t value, unsigned siz memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsig= ned size) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx64" size %u" memory_region_ram_device_read(int cpu_index, void *mr, uint64_t addr, uint= 64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64"= size %u" memory_region_ram_device_write(int cpu_index, void *mr, uint64_t addr, uin= t64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64= " size %u" +flatview_new(FlatView *view, MemoryRegion *root) "%p (root %p)" +flatview_destroy(FlatView *view, MemoryRegion *root) "%p (root %p)" +flatview_destroy_rcu(FlatView *view, MemoryRegion *root) "%p (root %p)" =20 ### Guest events, keep at bottom =20 --=20 1.8.3.1