From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm35p-0004bL-Sr for qemu-devel@nongnu.org; Tue, 13 Oct 2015 13:10:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm35l-0000ai-Lz for qemu-devel@nongnu.org; Tue, 13 Oct 2015 13:10:29 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:55437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm35l-0000aH-B1 for qemu-devel@nongnu.org; Tue, 13 Oct 2015 13:10:25 -0400 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 13 Oct 2015 19:10:21 +0200 Message-Id: <20151013171020.21325.27626.stgit@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 particu= lar 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 generati= ng a call to the execution-time event tracer when a vCPU is not actively traci= ng such event. Virtual CPUs tracing the same set of events use the same physical transla= tion cache, improving their reuse. The system has 2^N physical translation cac= hes, where "N" is the number of TCG events with the "vcpu" property. Every vCP= U has a bitmap with the states of these events, which can be controlled separatel= y, 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=C3=ADs Vilanova --- Llu=C3=ADs 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: [=C5=A7cg] Use multiple physical TB caches exec: [tcg] Track which vCPU is performing translation and executio= n [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=20 cpu-exec.c | 17 +++ cputlb.c | 2=20 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=20 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=20 stubs/qemu-common-stub.c | 21 ++++ target-alpha/translate.c | 3 - target-arm/translate.c | 3 - target-arm/translate.h | 2=20 target-cris/translate.c | 3 - target-cris/translate_v10.c | 1=20 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=20 tcg/tcg.h | 10 ++ trace/Makefile.objs | 2=20 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=20 vl.c | 2=20 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