2ab4b135 | 11-Sep-2017 |
Alistair Francis <alistair.francis@xilinx.com> |
Convert single line fprintf(.../n) to warn_report()
Convert all the single line uses of fprintf(stderr, "warning:"..."\n"... to use warn_report() instead. This helps standardise on a single method o
Convert single line fprintf(.../n) to warn_report()
Convert all the single line uses of fprintf(stderr, "warning:"..."\n"... to use warn_report() instead. This helps standardise on a single method of printing warnings to the user.
All of the warnings were changed using this command: find ./* -type f -exec sed -i \ 's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \ {} +
Some of the lines were manually edited to reduce the line length to below 80 charecters.
The #include lines were manually updated to allow the code to compile.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Yongbok Kim <yongbok.kim@imgtec.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips] Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
61a67f71 | 04-Jul-2017 |
Lluís Vilanova <vilanova@ac.upc.edu> |
exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state
Every vCPU now uses a separate set of TBs for each set of dynamic tracing event state values. Each set of TBs can be used
exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state
Every vCPU now uses a separate set of TBs for each set of dynamic tracing event state values. Each set of TBs can be used by any number of vCPUs to maximize TB reuse when vCPUs have the same tracing state.
This feature is later used by tracetool to optimize tracing of guest code events.
The maximum number of TB sets is defined as 2^E, where E is the number of events that have the 'vcpu' property (their state is stored in CPUState->trace_dstate).
For this to work, a change on the dynamic tracing state of a vCPU will force it to flush its virtual TB cache (which is only indexed by address), and fall back to the physical TB cache (which now contains the vCPU's dynamic tracing state as part of the hashing function).
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Emilio G. Cota <cota@braap.org> Message-id: 149915775266.6295.10060144081246467690.stgit@frigg.lan Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
d4381116 | 04-Jul-2017 |
Lluís Vilanova <vilanova@ac.upc.edu> |
trace: [tcg] Delay changes to dynamic state when translating
This keeps consistency across all decisions taken during translation when the dynamic state of a vCPU is changed in the middle of transla
trace: [tcg] Delay changes to dynamic state when translating
This keeps consistency across all decisions taken during translation when the dynamic state of a vCPU is changed in the middle of translating some guest code.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Emilio G. Cota <cota@braap.org> Message-id: 149915750615.6295.3713699402253529487.stgit@frigg.lan Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
a47e8715 | 26-Dec-2016 |
Lluís Vilanova <vilanova@ac.upc.edu> |
trace: Add event "guest_cpu_exit"
Signals the hot-unplugging of a virtual (guest) CPU.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 148278748597.1404.10546320797997984932.stgit@f
trace: Add event "guest_cpu_exit"
Signals the hot-unplugging of a virtual (guest) CPU.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 148278748597.1404.10546320797997984932.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
82e95ec8 | 26-Dec-2016 |
Lluís Vilanova <vilanova@ac.upc.edu> |
trace: Fix dynamic event state on vCPU hot-unplug
We need to disable per-vCPU events on a vCPU that is hot-unplugged to keep the dynamic event state global counters consistent.
Signed-off-by: Lluís
trace: Fix dynamic event state on vCPU hot-unplug
We need to disable per-vCPU events on a vCPU that is hot-unplugged to keep the dynamic event state global counters consistent.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 148278748055.1404.1570530281528619895.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
0bc6484d | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: pass trace-events to tracetool as a positional param
Instead of reading the contents of 'trace-events' from stdin, accept the filename as a positional parameter. This also allows for reading
trace: pass trace-events to tracetool as a positional param
Instead of reading the contents of 'trace-events' from stdin, accept the filename as a positional parameter. This also allows for reading from multiple files, though this facility is not used at this time.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-20-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
34770187 | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: get rid of generated-events.h/generated-events.c
Currently the generated-events.[ch] files contain the event dstates, constants and TraceEvent structs, while the generated-tracers.[ch] files
trace: get rid of generated-events.h/generated-events.c
Currently the generated-events.[ch] files contain the event dstates, constants and TraceEvent structs, while the generated-tracers.[ch] files contain the actual trace probe logic. With the removal of usage of the event enums from the API there is no longer any compelling reason for the separation between these files. The generated-events.h content is only ever needed from the generated-tracers.[ch] files.
The enums/constants/structs from generated-events.[ch] are thus moved into the generated-tracers.[ch], so that there is one less file to be generated.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-17-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
ca3fa0e8 | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: dynamically allocate event IDs at runtime
Instead of having the code generator assign event IDs and event VCPU IDs, assign them when the events are registered at runtime. This will allow code
trace: dynamically allocate event IDs at runtime
Instead of having the code generator assign event IDs and event VCPU IDs, assign them when the events are registered at runtime. This will allow code to be generated from individual trace-events without having to figure out globally unique numbering at build time.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-16-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
b7d48952 | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: dynamically allocate trace_dstate in CPUState
The CPUState struct has a bitmap tracking which VCPU events are currently active. This is indexed based on the event ID values, and sized accordi
trace: dynamically allocate trace_dstate in CPUState
The CPUState struct has a bitmap tracking which VCPU events are currently active. This is indexed based on the event ID values, and sized according the maximum TraceEventVCPUID enum value.
When we start dynamically assigning IDs at runtime, we can't statically declare a bitmap without making an assumption about the max event count. This problem can be solved by dynamically allocating the per-CPU dstate bitmap.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-15-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
fe4db84d | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: provide mechanism for registering trace events
Remove the notion of there being a single global array of trace events, by introducing a method for registering groups of events.
The module_ca
trace: provide mechanism for registering trace events
Remove the notion of there being a single global array of trace events, by introducing a method for registering groups of events.
The module_call_init() needs to be invoked at the start of any program that wants to make use of the trace support. Currently this covers system emulators qemu-nbd, qemu-img and qemu-io.
[Squashed the following fix from Daniel P. Berrange <berrange@redhat.com>:
linux-user/bsd-user: initialize trace events subsystem
The bsd-user/linux-user programs make use of the CPU emulation code and this now requires that the trace events subsystem is enabled, otherwise it'll crash trying to allocate an empty trace events bitmap for the CPU object.
--Stefan]
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-14-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
8ed53728 | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: don't abort qemu if ftrace can't be initialized
If the ftrace backend is compiled into QEMU, any attempt to start QEMU while non-root will fail due to the inability to open /sys/kernel/debug/
trace: don't abort qemu if ftrace can't be initialized
If the ftrace backend is compiled into QEMU, any attempt to start QEMU while non-root will fail due to the inability to open /sys/kernel/debug/tracing/tracing_on.
Add a fallback into the code so that it connects up the trace_marker_fd variable to /dev/null when getting EACCES on the 'trace_on' file. This allows QEMU to run, with ftrace turned into a no-op.
[Fixed s/setting/getting/ and s/EACCESS/EACCES/ errors pointed out by Eric Blake <eblake@redhat.com>. --Stefan]
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-13-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
7f1b588f | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: emit name <-> ID mapping in simpletrace header
Currently simpletrace assumes that events are given IDs starting from 0, based on the order in which they appear in the trace-events file, with
trace: emit name <-> ID mapping in simpletrace header
Currently simpletrace assumes that events are given IDs starting from 0, based on the order in which they appear in the trace-events file, with no gaps. When the trace-events file is split up, this assumption becomes problematic.
To deal with this, extend the simpletrace format so that it outputs a table of event name <-> ID mappings. That will allow QEMU to assign arbitrary IDs to events without breaking simpletrace parsing.
The v3 simple trace format was
FILE HEADER EVENT TRACE RECORD 0 EVENT TRACE RECORD 1 ... EVENT TRACE RECORD N
The v4 simple trace format is now
FILE HEADER EVENT MAPPING RECORD 0 EVENT MAPPING RECORD 1 ... EVENT MAPPING RECORD M EVENT TRACE RECORD RECORD 0 EVENT TRACE RECORD RECORD 1 ... EVENT TRACE RECORD N
Although this shows all the mapping records being emitted upfront, this is not required by the format. While the main simpletrace backend will emit all mappings at startup, the systemtap simpletrace.stp script will emit the mappings at first use. eg
FILE HEADER ... EVENT MAPPING RECORD 0 EVENT TRACE RECORD RECORD 0 EVENT TRACE RECORD RECORD 1 EVENT MAPPING RECORD 1 EVENT TRACE RECORD RECORD 2 ... EVENT TRACE RECORD N
This is more space efficient given that most trace records only include a subset of events.
In modifying the systemtap simpletrace code, a 'begin' probe was added to emit the trace event header, so you no longer need to add '--no-header' when running simpletrace.py for systemtap generated trace files.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-12-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
ef4c9fc8 | 04-Oct-2016 |
Daniel P. Berrange <berrange@redhat.com> |
trace: remove the TraceEventID and TraceEventVCPUID enums
The TraceEventID and TraceEventVCPUID enums constants are no longer actually used for anything critical.
The TRACE_EVENT_COUNT limit is use
trace: remove the TraceEventID and TraceEventVCPUID enums
The TraceEventID and TraceEventVCPUID enums constants are no longer actually used for anything critical.
The TRACE_EVENT_COUNT limit is used to determine the size of the TraceEvents array, and can be removed if we just NULL terminate the array instead.
The TRACE_VCPU_EVENT_COUNT limit is used as a magic value for marking non-vCPU events, and also for declaring the size of the trace dstate mask in the CPUState struct. The former usage can be replaced by a dedicated constant TRACE_EVENT_VCPU_NONE, defined as (uint32_t)-1. For the latter usage, we can simply define a constant for the number of VCPUs, avoiding the need for the full enum.
The only other usages of the enum values can be replaced by accesing the id/vcpu_id fields via the named TraceEvent structs.
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-11-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|