Tracing patches
The following changes since commit 2ccede18bd24fce5db83fef3674563a1f256717b:
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging (2017-01-16 12:41:35 +0000)
are available in the git repository at:
git://github.com/stefanha/qemu.git tags/tracing-pull-request
for you to fetch changes up to a47e87151e785977d34e7b726495e7781860ca9f:
trace: Add event "guest_cpu_exit" (2017-01-16 13:40:56 +0000)
----------------------------------------------------------------
----------------------------------------------------------------
Lluís Vilanova (3):
trace: Lock vCPU list when initializing dynamic tracing state
trace: Fix dynamic event state on vCPU hot-unplug
trace: Add event "guest_cpu_exit"
Marc-André Lureau (1):
trace-events: spelling fix
trace/control.h | 8 ++++++++ qom/cpu.c | 2 ++ trace/control-target.c | 11 ++++++++++- trace/control.c | 19 +++++++++++++++++++ trace-events | 8 +++++++- 5 files changed, 46 insertions(+), 2 deletions(-)
Signature · 1 line
2.9.3
[Qemu-devel] [PULL 1/4] trace-events: spelling fix
From: Marc-André Lureau <[email protected]>
Message-id: [email protected]
--- trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
trace-events +1 -1
@@ -53,7 +53,7 @@ qemu_system_shutdown_request(void) "" qemu_system_powerdown_request(void) "" # spice-qemu-char.c -spice_vmc_write(ssize_t out, int len) "spice wrottn %zd of requested %d" +spice_vmc_write(ssize_t out, int len) "spice wrote %zd of requested %d" spice_vmc_read(int bytes, int len) "spice read %d of requested %d" spice_vmc_register_interface(void *scd) "spice vmc registered interface %p" spice_vmc_unregister_interface(void *scd) "spice vmc unregistered interface %p"
Signature · 1 line
2.9.3
[Qemu-devel] [PULL 2/4] trace: Lock vCPU list when initializing dynamic tracing state
In reply to Stefan HajnocziFrom: Lluís Vilanova <[email protected]>
Fixes potential corruption when a vCPU is hot-(un)plugged while initializing the current one.
Message-id: [email protected]
--- trace/control-target.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
trace/control-target.c +10 -1
@@ -79,7 +79,7 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, } } -static bool adding_first_cpu (void ) +static bool adding_first_cpu1 (void ) {CPUState *cpu;size_t count =0 ;
@@ -92,6 +92,15 @@ static bool adding_first_cpu(void)return true; } +static bool adding_first_cpu (void ) +{ +bool res; +cpu_list_lock (); + res =adding_first_cpu1 (); +cpu_list_unlock (); +return res; +} +void trace_init_vcpu (CPUState *vcpu) {TraceEventIter iter;
Signature · 1 line
2.9.3
[Qemu-devel] [PULL 3/4] trace: Fix dynamic event state on vCPU hot-unplug
In reply to Stefan HajnocziFrom: Lluís Vilanova <[email protected]>
We need to disable per-vCPU events on a vCPU that is hot-unplugged to keep the dynamic event state global counters consistent.
Message-id: [email protected]
--- trace/control.h | 8 ++++++++ qom/cpu.c | 2 ++ trace/control.c | 16 ++++++++++++++++ 3 files changed, 26 insertions(+)
trace/control.h +8 -0
@@ -202,6 +202,14 @@ void trace_init_file(const char *file);void trace_init_vcpu (CPUState *vcpu);/** +* trace_fini_vcpu: +* @vcpu: Removed vCPU. +* +* Disable dynamic event state for a hot-unplugged vCPU. +*/ +void trace_fini_vcpu (CPUState *vcpu); + +/** * trace_list_events: * * List all available events.
qom/cpu.c +2 -0
@@ -348,6 +348,8 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)static void cpu_common_unrealizefn (DeviceState *dev,Error **errp) {CPUState *cpu =CPU (dev); +/* NOTE: latest generic point before the cpu is fully unrealized */ +trace_fini_vcpu (cpu);cpu_exec_unrealizefn (cpu); }
trace/control.c +16 -0
@@ -259,6 +259,22 @@ void trace_init_file(const char *file)#endif } +void trace_fini_vcpu (CPUState *vcpu) +{ +TraceEventIter iter; +TraceEvent *ev; + +trace_event_iter_init (&iter,NULL ); +while ((ev =trace_event_iter_next (&iter)) !=NULL ) { +if (trace_event_is_vcpu (ev) && +trace_event_get_state_static (ev) && +trace_event_get_vcpu_state_dynamic (vcpu, ev)) { +/* must disable to affect the global counter */ +trace_event_set_vcpu_state_dynamic (vcpu, ev, false); + } + } +} +bool trace_init_backends (void ) {#ifdef CONFIG_TRACE_SIMPLE
Signature · 1 line
2.9.3
[Qemu-devel] [PULL 4/4] trace: Add event "guest_cpu_exit"
In reply to Stefan HajnocziFrom: Lluís Vilanova <[email protected]>
Signals the hot-unplugging of a virtual (guest) CPU.
Message-id: [email protected]
--- trace/control.c | 3 +++ trace-events | 6 ++++++ 2 files changed, 9 insertions(+)
trace/control.c +3 -0
@@ -26,6 +26,7 @@#include "qemu/error-report.h" #include "qemu/config-file.h" #include "monitor/monitor.h" +#include "trace.h" int trace_events_enabled_count;
@@ -264,6 +265,8 @@ void trace_fini_vcpu(CPUState *vcpu)TraceEventIter iter;TraceEvent *ev; +trace_guest_cpu_exit (vcpu); +trace_event_iter_init (&iter,NULL );while ((ev =trace_event_iter_next (&iter)) !=NULL ) { if (trace_event_is_vcpu(ev) &&
trace-events +6 -0
@@ -141,6 +141,12 @@ memory_region_ram_device_write(int cpu_index, void *mr, uint64_t addr, uint64_t # Targets: all vcpu guest_cpu_enter(void) +# Hot-unplug a virtual (guest) CPU +# +# Mode: user, softmmu +# Targets: all +vcpu guest_cpu_exit(void) + # Reset the state of a virtual (guest) CPU # # Mode: user, softmmu
Signature · 1 line
2.9.3
Peter Maydell
AppliedQuoted 8 lines · Stefan Hajnoczi
The following changes since commit
2ccede18bd24fce5db83fef3674563a1f256717b:Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging (2017-01-16 12:41:35 +0000)
are available in the git repository at:
git://github.com/stefanha/qemu.gittags/tracing-pull-request
Quoted 8 lines
for you to fetch changes up to
a47e87151e785977d34e7b726495e7781860ca9f:trace: Add event "
guest_cpu_exit" (2017-01-16 13:40:56 +0000)----------------------------------------------------------------
----------------------------------------------------------------
Applied, thanks.
-- PMM