Skip to content

Commit

Permalink
qxl: fix modular builds with dtrace
Browse files Browse the repository at this point in the history
Checking the enable/disable state of tracepoints via
trace_event_get_state_backends() does not work for modules.

qxl checks the state for a small optimization (avoid g_strndup
call in case log_buf will not be used anyway), so we can just
drop that check for modular builds.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
kraxel committed Jul 21, 2020
1 parent 8e67fda commit d97df4b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hw/display/qxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,16 @@ static void ioport_write(void *opaque, hwaddr addr,
qxl_set_mode(d, val, 0);
break;
case QXL_IO_LOG:
#ifdef CONFIG_MODULES
/*
* FIXME
* trace_event_get_state_backends() does not work for modules,
* it leads to "undefined symbol: qemu_qxl_io_log_semaphore"
*/
if (true) {
#else
if (trace_event_get_state_backends(TRACE_QXL_IO_LOG) || d->guestdebug) {
#endif
/* We cannot trust the guest to NUL terminate d->ram->log_buf */
char *log_buf = g_strndup((const char *)d->ram->log_buf,
sizeof(d->ram->log_buf));
Expand Down

0 comments on commit d97df4b

Please sign in to comment.