[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 22/55] memory: trace FlatView creation and destruct
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 22/55] memory: trace FlatView creation and destruction |
Date: |
Wed, 6 Dec 2017 13:16:15 -0600 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit 02d9651d6a46479e9d70b72dca34e43605d06cda)
Signed-off-by: Michael Roth <address@hidden>
---
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 631daf0cce..234c71d975 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -48,7 +48,6 @@
typedef struct MemoryRegionOps MemoryRegionOps;
typedef struct MemoryRegionMmio MemoryRegionMmio;
-typedef struct FlatView FlatView;
struct MemoryRegionMmio {
CPUReadMemoryFunc *read[3];
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 39bc8351a3..d44dfc75ec 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 c1a64a9ca2..774a17f60a 100644
--- a/memory.c
+++ b/memory.c
@@ -270,6 +270,7 @@ static FlatView *flatview_new(MemoryRegion *mr_root)
view->ref = 1;
view->root = mr_root;
memory_region_ref(mr_root);
+ trace_flatview_new(view, mr_root);
return view;
}
@@ -295,6 +296,7 @@ static void flatview_destroy(FlatView *view)
{
int i;
+ 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) == 1) {
+ trace_flatview_destroy_rcu(view, view->root);
call_rcu(view, flatview_destroy, rcu);
}
}
diff --git a/trace-events b/trace-events
index 1f50f56d9d..1d2eb5d3e4 100644
--- a/trace-events
+++ b/trace-events
@@ -64,6 +64,9 @@ memory_region_tb_read(int cpu_index, uint64_t addr, uint64_t
value, unsigned siz
memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsigned
size) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
memory_region_ram_device_read(int cpu_index, void *mr, uint64_t addr, uint64_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,
uint64_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)"
### Guest events, keep at bottom
--
2.11.0
- [Qemu-stable] [PATCH 12/55] memory: Switch memory from using AddressSpace to FlatView, (continued)
- [Qemu-stable] [PATCH 12/55] memory: Switch memory from using AddressSpace to FlatView, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 16/55] memory: Alloc dispatch tree where topology is generared, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 18/55] memory: Share FlatView's and dispatch trees between address spaces, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 20/55] memory: Get rid of address_space_init_shareable, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 15/55] memory: Store physical root MR in FlatView, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 13/55] memory: Cleanup after switching to FlatView, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 17/55] memory: Move address_space_update_ioeventfds, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 19/55] memory: Do not allocate FlatView in address_space_init, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 21/55] memory: Create FlatView directly, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 01/55] hw/ppc: CAS reset on early device hotplug, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 22/55] memory: trace FlatView creation and destruction,
Michael Roth <=
- [Qemu-stable] [PATCH 23/55] memory: seek FlatView sharing candidates among children subregions, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 26/55] exec: simplify address_space_get_iotlb_entry, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 25/55] exec: add page_mask for flatview_do_translate, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 28/55] hw/sd: fix out-of-bounds check for multi block reads, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 30/55] qcow2: Always execute preallocate() in a coroutine, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 27/55] memory: fix off-by-one error in memory_region_notify_one(), Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 29/55] qcow2: Fix unaligned preallocated truncation, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 24/55] memory: Share special empty FlatView, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 33/55] io: monitor encoutput buffer size from websocket GSource, Michael Roth, 2017/12/06
- [Qemu-stable] [PATCH 02/55] hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple(), Michael Roth, 2017/12/06