Skip to content
Snippets Groups Projects
  1. Mar 06, 2021
    • Paolo Bonzini's avatar
      trace: fix "-trace file=..." · 9f45a641
      Paolo Bonzini authored
      
      Because trace_opt_parse always deletes the options it has parsed,
      trace_init_file's call to qemu_find_opts_singleton always
      creates an empty -trace option group.  Therefore, the subsequent
      qemu_opt_get(opts, "file") always returns NULL.
      
      To fix this, save the last "-trace file=..." option in a global
      variable and use it later in trace_init_file.
      
      This is similar to what was done before commit 92eecfff ("trace:
      remove argument from trace_init_file", 2020-11-11), except contained
      within trace/control.c and without memory leaks.
      
      Fixes: 92eecfff ("trace: remove argument from trace_init_file", 2020-11-11)
      Cc: stefanha@redhat.com
      Reported-by: default avatar <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20210209145759.141231-2-pbonzini@redhat.com>
      9f45a641
  2. Feb 01, 2021
  3. Jan 04, 2021
  4. Jan 02, 2021
  5. Dec 19, 2020
    • Eric Blake's avatar
      qapi: Use QAPI_LIST_PREPEND() where possible · 54aa3de7
      Eric Blake authored
      
      Anywhere we create a list of just one item or by prepending items
      (typically because order doesn't matter), we can use
      QAPI_LIST_PREPEND().  But places where we must keep the list in order
      by appending remain open-coded until later patches.
      
      Note that as a side effect, this also performs a cleanup of two minor
      issues in qga/commands-posix.c: the old code was performing
       new = g_malloc0(sizeof(*ret));
      which 1) is confusing because you have to verify whether 'new' and
      'ret' are variables with the same type, and 2) would conflict with C++
      compilation (not an actual problem for this file, but makes
      copy-and-paste harder).
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201113011340.463563-5-eblake@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [Straightforward conflicts due to commit a8aa94b5 "qga: update
      schema for guest-get-disks 'dependents' field" and commit a10b453a
      "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c"
      resolved.  Commit message tweaked.]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      54aa3de7
  6. Nov 19, 2020
  7. Nov 11, 2020
  8. Oct 26, 2020
    • Josh DuBois's avatar
      trace/simple: Enable tracing on startup only if the user specifies a trace option · 648b4823
      Josh DuBois authored
      
      Tracing can be enabled at the command line or via the
      monitor. Command-line trace options are recorded during
      trace_opt_parse(), but tracing is not enabled until the various
      front-ends later call trace_init_file(). If the user passes a trace
      option on the command-line, remember that and enable tracing during
      trace_init_file().  Otherwise, trace_init_file() should record the
      trace file specified by the frontend and avoid enabling traces
      until the user requests them via the monitor.
      
      This fixes 1b7157be and also
      db25d56c, by allowing the user
      to enable traces on the command line and also avoiding
      unwanted trace-<pid> files when the user has not asked for them.
      
      Fixes: 1b7157be
      Signed-off-by: default avatarJosh DuBois <josh@joshdubois.com>
      Message-id: 20200816174610.20253-1-josh@joshdubois.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      648b4823
  9. Oct 09, 2020
  10. Sep 30, 2020
  11. Sep 01, 2020
  12. Aug 27, 2020
  13. Aug 21, 2020
  14. Jul 29, 2020
  15. Jun 24, 2020
  16. Feb 25, 2020
  17. Jan 30, 2020
  18. Jan 16, 2020
  19. Dec 19, 2019
  20. Oct 28, 2019
  21. Sep 03, 2019
  22. Aug 27, 2019
    • Philippe Mathieu-Daudé's avatar
      trace: Clarify DTrace/SystemTap help message · 9f591a5d
      Philippe Mathieu-Daudé authored
      
      Most tracing backends are implemented within QEMU, except the
      DTrace/SystemTap backends.
      
      One side effect is when running 'qemu -trace help', an incomplete
      list of trace events is displayed when using the DTrace/SystemTap
      backends.
      
      This is partly due to trace events registered as modules with
      trace_init(), and since the events are not used within QEMU,
      the linker optimize and remove the unused modules (which is
      OK in this particular case).
      Currently only the events compiled in trace-root.o and in the
      last trace.o member of libqemuutil.a are linked, resulting in
      an incomplete list of events.
      
      To avoid confusion, improve the help message, recommending to
      use the proper systemtap script to display the events list.
      
      Before:
      
        $ lm32-softmmu/qemu-system-lm32 -trace help 2>&1 | wc -l
        70
      
      After:
      
        $ lm32-softmmu/qemu-system-lm32 -trace help
        Run 'qemu-trace-stap list qemu-system-lm32' to print a list
        of names of trace points with the DTrace/SystemTap backends.
      
        $ qemu-trace-stap list qemu-system-lm32 | wc -l
        1136
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-id: 20190823142203.5210-1-philmd@redhat.com
      Message-Id: <20190823142203.5210-1-philmd@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      9f591a5d
  23. Aug 21, 2019
  24. Aug 16, 2019
    • Markus Armbruster's avatar
      trace: Do not include qom/cpu.h into generated trace.h · 13d4ff07
      Markus Armbruster authored
      
      docs/devel/tracing.txt explains "since many source files include
      trace.h, [the generated trace.h use] a minimum of types and other
      header files included to keep the namespace clean and compile times
      and dependencies down."
      
      Commit 48151859 "trace: Add per-vCPU tracing states for events with
      the 'vcpu' property" made them all include qom/cpu.h via
      control-internal.h.  qom/cpu.h in turn includes about thirty headers.
      Ouch.
      
      Per-vCPU tracing is currently not supported in sub-directories'
      trace-events.  In other words, qom/cpu.h can only be used in
      trace-root.h, not in any trace.h.
      
      Split trace/control-vcpu.h off trace/control.h and
      trace/control-internal.h.  Have the generated trace.h include
      trace/control.h (which no longer includes qom/cpu.h), and trace-root.h
      include trace/control-vcpu.h (which includes it).
      
      The resulting improvement is a bit disappointing: in my "build
      everything" tree, some 1100 out of 6600 objects (not counting tests
      and objects that don't depend on qemu/osdep.h) depend on a trace.h,
      and about 600 of them no longer depend on qom/cpu.h.  But more than
      1300 others depend on trace-root.h.  More work is clearly needed.
      Left for another day.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190812052359.30071-8-armbru@redhat.com>
      13d4ff07
  25. Jun 12, 2019
    • Markus Armbruster's avatar
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster authored
      
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
  26. Apr 18, 2019
  27. Mar 22, 2019
  28. Mar 11, 2019
  29. Dec 12, 2018
  30. Jul 19, 2018
  31. Jun 29, 2018
  32. Jun 28, 2018
  33. Jun 27, 2018
Loading