mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Pull request
-----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl4zTL4ACgkQnKSrs4Gr c8j38wf9EMliB2OwzQGqmKLa+yE5lTzZLe4ou7yOR5jAwt6VfpT10PxtE2WSF0no KSiT8fhlY+AKx0Y0v57Qis0B9iLolPLOW7iTu07dBn5eQ7+mQiKeZi5OA+FtSq6i cnOug0/PRRKNtCz+U0AwEOMjDmBUkWsGuQRUe4mO+Trkb/GKdBoF7NsSqNoHJpJZ sv2se9WImJMV1OLmtwQ94l5hzsEhz5wWZ3n4DPa7J1qYBWjzaPydjNkIyO8kgshb i2FcNsL9As3jhIzuCUX8zRKzTaTJVLF8e07iInWNswKBUbt7LxbqtOZWMoTavgpu gsbBG3Rk6l08IM0cL5/r1PDYgroIuQ== =/0ID -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging Pull request # gpg: Signature made Thu 30 Jan 2020 21:38:06 GMT # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: qemu_set_log_filename: filename argument may be NULL hw/display/qxl.c: Use trace_event_get_state_backends() memory.c: Use trace_event_get_state_backends() docs/devel/tracing.txt: Recommend only trace_event_get_state_backends() Makefile: Keep trace-events-subdirs ordered Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
28db64fce5
7 changed files with 30 additions and 33 deletions
|
@ -342,8 +342,10 @@ edit the "trace-events-all" file).
|
|||
|
||||
In addition, there might be cases where relatively complex computations must be
|
||||
performed to generate values that are only used as arguments for a trace
|
||||
function. In these cases you can use the macro 'TRACE_${EVENT_NAME}_ENABLED' to
|
||||
guard such computations and avoid its compilation when the event is disabled:
|
||||
function. In these cases you can use 'trace_event_get_state_backends()' to
|
||||
guard such computations, so they are skipped if the event has been either
|
||||
compile-time disabled or run-time disabled. If the event is compile-time
|
||||
disabled, this check will have no performance impact.
|
||||
|
||||
#include "trace.h" /* needed for trace event prototype */
|
||||
|
||||
|
@ -356,7 +358,7 @@ guard such computations and avoid its compilation when the event is disabled:
|
|||
align = getpagesize();
|
||||
}
|
||||
ptr = qemu_memalign(align, size);
|
||||
if (TRACE_QEMU_VMALLOC_ENABLED) { /* preprocessor macro */
|
||||
if (trace_event_get_state_backends(TRACE_QEMU_VMALLOC)) {
|
||||
void *complex;
|
||||
/* some complex computations to produce the 'complex' value */
|
||||
trace_qemu_vmalloc(size, ptr, complex);
|
||||
|
@ -364,10 +366,6 @@ guard such computations and avoid its compilation when the event is disabled:
|
|||
return ptr;
|
||||
}
|
||||
|
||||
You can check both if the event has been disabled and is dynamically enabled at
|
||||
the same time using the 'trace_event_get_state_backends' routine (see header
|
||||
"trace/control.h" for more information).
|
||||
|
||||
=== "tcg" ===
|
||||
|
||||
Guest code generated by TCG can be traced by defining an event with the "tcg"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue