History | View | Annotate | Download (11.9 kB)
trace: [simple] Port to generic event information and new control interface
The backend is forced to dump event numbers using 64 bits, as TraceEventID isan enum.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
trace: deal with deprecated glib thread functions
g_thread_create() was deprecated in favor of g_thread_new() andg_cond_new() was deprecated in favor of GCond initialization. If thehost has glib 2.31 or newer, avoid using the deprecated functions.
This patch solves compiler warnings that are generated when glib's...
trace: use glib atomic int types
Juan reported that RHEL 6.4 hosts give compiler warnings because we useunsigned int while glib prototypes use volatile gint in trace/simple.c.
trace/simple.c:223: error: pointer targets in passing argument 1 of 'g_atomic_int_compare_and_exchange' differ in signedness...
trace: Fix simple trace dropped event record for big endian
We use atomic operations to keep track of dropped events.
Inconveniently, GLib supports only int and void * atomics, but thecounter dropped_events is uint64_t. Can't stop commit 62bab732: aquick (gint *)&dropped_events bludgeons the compiler into submission....
trace: Direct access of atomics is verboten, use the API
The GLib Reference Manual says:
It is very important that all accesses to a particular integer or pointer be performed using only this API and that different sizes of operation are not mixed or used on overlapping memory...
trace: Clean up the "try to update atomic until it worked" loops
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
trace/simple: Replace asprintf by g_strdup_printf
asprintf is not available for all hosts. g_strdup_printf ismore portable and simplifies the code because if does notneed error handling.
The static variable does not need an explicit assignment to be NULL....
trace: rename TraceRecordHeader to TraceLogHeader
The TraceRecordHeader is really the header for the entire trace logfile. It's not per-record header so make this obvious by renaming it.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
trace: remove unnecessary write_to_buffer() typecasting
The buffer argument is void* so it is not necessary to cast.
trace: drop unused TraceBufferRecord->next_tbuf_idx field
trace: avoid pointer aliasing in trace_record_finish()
Declaring a TraceRecord on the stack works fine. No need for auint8_t array and pointer aliasing.
Simpletrace v2: Support multiple arguments, strings.
Existing simpletrace backend allows to trace at max 6 args and does notsupport strings. This newer tracelog format gets rid of fixed size recordsand therefore allows to trace variable number of args including strings....
monitor: remove unused do_info_trace
Going forward with simpletrace v2 variable size trace records, we cannothave a generic function to print trace event info and therefore thisinterface becomes invalid.
As per Stefan Hajnoczi:
"This command is only available from the human monitor. It's not very...
trace/simple.c: fix deprecated glib2 interface
trace: make trace_thread_create() use its function arg
This patch makes trace_thread_create() to use its function arg toinitialize thread. The other choice is to make this a function to usevoid arg, but i prefer this way.
Signed-off-by: Jun Koi <junkoi2004@gmail.com>...
g_thread_init users: don't call it if glib >= 2.31
since commit f9b29ca03 included in release 2.31 (docs below say 2.32 butthat is not correct) and onwards g_thread_init is deprecated and callingit is not required:
http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init...
trace: Add wildcard trace event support
A basic wildcard matching is supported in both the monitor command"trace-event" and the events list file. That means you can enable/disablethe events having a common prefix in a batch. For example, virtio-blk trace...
trace: use binary file open mode in simpletrace
For Windows portability the simple trace backend must use the 'b' fileopen mode. This prevents the stdio library from mangling 0x0a/0x0dnewline characters.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
trace: portable simple trace backend using glib
Convert the simple trace backend to glib so that it works under Windows.We cannot use pthread directly but glib provides portable abstractions.Also use glib atomics instead of newish gcc builtins which may not be...
trace: separate trace event control and query routines from the simple backend
Generalize the 'st_print_trace_events' and 'st_change_trace_event_state' intobackend-specific 'trace_print_events' and 'trace_event_set_state' (respectively)in the "trace/control.h" file....
trace: add "-trace events" argument to control initial state
The "-trace events" argument can be used to provide a file with a list of traceevent names that will be enabled prior to starting execution, thus providingearly tracing.
This saves the user from manually toggling event states through the monitor...
trace: move backend-specific code into the trace/ directory
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
trace: avoid conditional code compilation during option parsing
A default implementation for backend-specific routines is provided in"trace/default.c", which backends can override by setting "trace_default=no" in"configure".