diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/trace-remove-malloc-tracing.patch | 97 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu_2.4.0.1.bb | 1 |
2 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/trace-remove-malloc-tracing.patch b/meta/recipes-devtools/qemu/qemu/trace-remove-malloc-tracing.patch new file mode 100644 index 0000000000..73d699f3f8 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/trace-remove-malloc-tracing.patch | |||
@@ -0,0 +1,97 @@ | |||
1 | From 98cf48f60aa4999f5b2808569a193a401a390e6a Mon Sep 17 00:00:00 2001 | ||
2 | From: Paolo Bonzini <pbonzini@redhat.com> | ||
3 | Date: Wed, 16 Sep 2015 17:38:44 +0200 | ||
4 | Subject: [PATCH] trace: remove malloc tracing | ||
5 | |||
6 | The malloc vtable is not supported anymore in glib, because it broke | ||
7 | when constructors called g_malloc. Remove tracing of g_malloc, | ||
8 | g_realloc and g_free calls. | ||
9 | |||
10 | Note that, for systemtap users, glib also provides tracepoints | ||
11 | glib.mem_alloc, glib.mem_free, glib.mem_realloc, glib.slice_alloc | ||
12 | and glib.slice_free. | ||
13 | |||
14 | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | ||
15 | Reviewed-by: Alberto Garcia <berto@igalia.com> | ||
16 | Message-id: 1442417924-25831-1-git-send-email-pbonzini@redhat.com | ||
17 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
18 | |||
19 | |||
20 | For Yocto: | ||
21 | Upstream-Status: Backport [commit 98cf48f60a, included in 2.4.1] | ||
22 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
23 | |||
24 | --- | ||
25 | trace-events | 3 --- | ||
26 | vl.c | 27 --------------------------- | ||
27 | 2 files changed, 0 insertions(+), 30 deletions(-) | ||
28 | |||
29 | diff --git a/trace-events b/trace-events | ||
30 | index 6790292..b813ae4 100644 | ||
31 | --- a/trace-events | ||
32 | +++ b/trace-events | ||
33 | @@ -603,9 +603,6 @@ scsi_request_sense(int target, int lun, int tag) "target %d lun %d tag %d" | ||
34 | vm_state_notify(int running, int reason) "running %d reason %d" | ||
35 | load_file(const char *name, const char *path) "name %s location %s" | ||
36 | runstate_set(int new_state) "new state %d" | ||
37 | -g_malloc(size_t size, void *ptr) "size %zu ptr %p" | ||
38 | -g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p" | ||
39 | -g_free(void *ptr) "ptr %p" | ||
40 | system_wakeup_request(int reason) "reason=%d" | ||
41 | qemu_system_shutdown_request(void) "" | ||
42 | qemu_system_powerdown_request(void) "" | ||
43 | diff --git a/vl.c b/vl.c | ||
44 | index f2bd8d2..ea9e0e6 100644 | ||
45 | --- a/vl.c | ||
46 | +++ b/vl.c | ||
47 | @@ -2703,26 +2703,6 @@ static const QEMUOption *lookup_opt(int argc, char **argv, | ||
48 | return popt; | ||
49 | } | ||
50 | |||
51 | -static gpointer malloc_and_trace(gsize n_bytes) | ||
52 | -{ | ||
53 | - void *ptr = malloc(n_bytes); | ||
54 | - trace_g_malloc(n_bytes, ptr); | ||
55 | - return ptr; | ||
56 | -} | ||
57 | - | ||
58 | -static gpointer realloc_and_trace(gpointer mem, gsize n_bytes) | ||
59 | -{ | ||
60 | - void *ptr = realloc(mem, n_bytes); | ||
61 | - trace_g_realloc(mem, n_bytes, ptr); | ||
62 | - return ptr; | ||
63 | -} | ||
64 | - | ||
65 | -static void free_and_trace(gpointer mem) | ||
66 | -{ | ||
67 | - trace_g_free(mem); | ||
68 | - free(mem); | ||
69 | -} | ||
70 | - | ||
71 | static int machine_set_property(void *opaque, | ||
72 | const char *name, const char *value, | ||
73 | Error **errp) | ||
74 | @@ -2950,11 +2930,6 @@ int main(int argc, char **argv, char **envp) | ||
75 | bool userconfig = true; | ||
76 | const char *log_mask = NULL; | ||
77 | const char *log_file = NULL; | ||
78 | - GMemVTable mem_trace = { | ||
79 | - .malloc = malloc_and_trace, | ||
80 | - .realloc = realloc_and_trace, | ||
81 | - .free = free_and_trace, | ||
82 | - }; | ||
83 | const char *trace_events = NULL; | ||
84 | const char *trace_file = NULL; | ||
85 | ram_addr_t maxram_size; | ||
86 | @@ -2970,8 +2945,6 @@ int main(int argc, char **argv, char **envp) | ||
87 | error_set_progname(argv[0]); | ||
88 | qemu_init_exec_dir(argv[0]); | ||
89 | |||
90 | - g_mem_set_vtable(&mem_trace); | ||
91 | - | ||
92 | module_call_init(MODULE_INIT_QOM); | ||
93 | |||
94 | qemu_add_opts(&qemu_drive_opts); | ||
95 | -- | ||
96 | 1.7.0.4 | ||
97 | |||
diff --git a/meta/recipes-devtools/qemu/qemu_2.4.0.1.bb b/meta/recipes-devtools/qemu/qemu_2.4.0.1.bb index 23e565db82..c96da02079 100644 --- a/meta/recipes-devtools/qemu/qemu_2.4.0.1.bb +++ b/meta/recipes-devtools/qemu/qemu_2.4.0.1.bb | |||
@@ -10,6 +10,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \ | |||
10 | file://smc91c111_fix2.patch \ | 10 | file://smc91c111_fix2.patch \ |
11 | file://smc91c111_fix3.patch \ | 11 | file://smc91c111_fix3.patch \ |
12 | file://no-valgrind.patch \ | 12 | file://no-valgrind.patch \ |
13 | file://trace-remove-malloc-tracing.patch \ | ||
13 | " | 14 | " |
14 | SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" | 15 | SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" |
15 | SRC_URI[md5sum] = "c99445164e77184a9ba2e7dbf7ed5c29" | 16 | SRC_URI[md5sum] = "c99445164e77184a9ba2e7dbf7ed5c29" |