qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states
@ 2015-10-13 17:10 Lluís Vilanova
  2015-10-13 17:10 ` [Qemu-devel] [PATCHv11/8] trace: Add support for vCPU pointers in trace events Lluís Vilanova
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Lluís Vilanova @ 2015-10-13 17:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

Adds the "vcpu" event property to identify events tied to a specific vCPU. In
addition, it allows controlling the tracing state of such events on a per-vCPU
basis.

Events with the "vcpu" property are identified as being tied to a particular
virtual CPU, like executing an instruction. The state of such events can be
controlled idependently; this is specially useful to, for example, trace memory
access events of a process executing on a specific virtual CPU.

This event plays in combination with the "tcg" property to avoid generating a
call to the execution-time event tracer when a vCPU is not actively tracing such
event.

Virtual CPUs tracing the same set of events use the same physical translation
cache, improving their reuse. The system has 2^N physical translation caches,
where "N" is the number of TCG events with the "vcpu" property. Every vCPU has a
bitmap with the states of these events, which can be controlled separately, and
uses it to index into its physical translation cache. At translation time, QEMU
generates the code to trace an event at execution time only if the event is
enabled.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---

Lluís Vilanova (8):
      trace: Add support for vCPU pointers in trace events
      trace: Add 'vcpu' event property
      trace: [tcg] Identify events with the 'vcpu' property
      exec: [tcg] Refactor flush of per-CPU virtual TB cache
      exec: [ŧcg] Use multiple physical TB caches
      exec: [tcg] Track which vCPU is performing translation and execution
      [trivial] Track when QEMU has finished initialization
      trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property


 Makefile.objs                            |    3 -
 bsd-user/main.c                          |    1 
 cpu-exec.c                               |   17 +++
 cputlb.c                                 |    2 
 docs/tracing.txt                         |   30 ++++++
 include/exec/exec-all.h                  |   16 +++
 include/qemu-common.h                    |    3 +
 include/qom/cpu.h                        |   10 ++
 linux-user/main.c                        |    1 
 qapi/trace.json                          |   36 +++++++
 qemu-common.c                            |   14 +++
 qmp-commands.hx                          |   27 +++++
 qom/cpu.c                                |   21 ++++
 scripts/tracetool/__init__.py            |   24 ++++-
 scripts/tracetool/format/events_c.py     |   11 ++
 scripts/tracetool/format/events_h.py     |   12 ++
 scripts/tracetool/format/h.py            |    4 +
 scripts/tracetool/format/tcg_h.py        |   19 +++-
 scripts/tracetool/format/tcg_helper_c.py |   11 ++
 scripts/tracetool/format/ust_events_c.py |    4 +
 scripts/tracetool/transform.py           |    9 ++
 stubs/Makefile.objs                      |    1 
 stubs/qemu-common-stub.c                 |   21 ++++
 target-alpha/translate.c                 |    3 -
 target-arm/translate.c                   |    3 -
 target-arm/translate.h                   |    2 
 target-cris/translate.c                  |    3 -
 target-cris/translate_v10.c              |    1 
 target-i386/translate.c                  |    3 -
 target-lm32/translate.c                  |    3 -
 target-m68k/translate.c                  |    3 -
 target-microblaze/translate.c            |    3 -
 target-mips/translate.c                  |    3 -
 target-moxie/translate.c                 |    3 -
 target-openrisc/translate.c              |    3 -
 target-ppc/translate.c                   |    3 -
 target-s390x/translate.c                 |    3 -
 target-sh4/translate.c                   |    3 -
 target-sparc/translate.c                 |    6 +
 target-tilegx/translate.c                |    3 -
 target-tricore/translate.c               |    3 -
 target-unicore32/translate.c             |    3 -
 target-xtensa/translate.c                |    3 -
 tcg/tcg-op.h                             |    2 
 tcg/tcg.h                                |   10 ++
 trace/Makefile.objs                      |    2 
 trace/control-internal.h                 |   25 ++++-
 trace/control-stub.c                     |   29 ++++++
 trace/control-target.c                   |   53 ++++++++++
 trace/control.h                          |   63 ++++++++++++
 trace/event-internal.h                   |    4 +
 trace/qmp.c                              |  129 +++++++++++++++++++++++--
 translate-all.c                          |  156 ++++++++++++++++++++++++++----
 translate-all.h                          |   49 +++++++++
 ui/Makefile.objs                         |    2 
 vl.c                                     |    2 
 56 files changed, 801 insertions(+), 82 deletions(-)
 create mode 100644 qemu-common.c
 create mode 100644 stubs/qemu-common-stub.c
 create mode 100644 trace/control-stub.c
 create mode 100644 trace/control-target.c


To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@gmail.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-10-16 15:45 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 17:10 [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv11/8] trace: Add support for vCPU pointers in trace events Lluís Vilanova
2015-10-16  9:13   ` Stefan Hajnoczi
2015-10-16 15:12     ` Eduardo Habkost
2015-10-16 15:44       ` Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv12/8] trace: Add 'vcpu' event property Lluís Vilanova
2015-10-16  9:16   ` Stefan Hajnoczi
2015-10-16 15:45     ` Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv13/8] trace: [tcg] Identify events with the 'vcpu' property Lluís Vilanova
2015-10-13 17:33   ` Eric Blake
2015-10-13 18:27     ` Lluís Vilanova
2015-10-13 18:57       ` Markus Armbruster
2015-10-13 17:10 ` [Qemu-devel] [PATCHv14/8] exec: [tcg] Refactor flush of per-CPU virtual TB cache Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv15/8] exec: [ŧcg] Use multiple physical TB caches Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv16/8] exec: [tcg] Track which vCPU is performing translation and execution Lluís Vilanova
2015-10-13 17:11 ` [Qemu-devel] [PATCHv17/8] [trivial] Track when QEMU has finished initialization Lluís Vilanova
2015-10-13 18:56   ` Markus Armbruster
2015-10-13 17:11 ` [Qemu-devel] [PATCHv18/8] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property Lluís Vilanova
2015-10-13 17:50   ` Eric Blake
2015-10-13 19:43     ` Lluís Vilanova
2015-10-16  9:19   ` Stefan Hajnoczi
2015-10-16 15:42     ` Lluís Vilanova
2015-10-13 17:26 ` [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states Lluís Vilanova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).