Received: from eggs.gnu.org ([2001:4830:134:3::10]:41382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9GeW-0007nQ-JX for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:09:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9GeR-0000mO-Ms for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:09:12 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:58443 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9GeR-0000m1-71 for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:09:07 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 31 Jan 2014 17:09:03 +0100 Message-Id: <20140131160902.32741.2680.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi Adds the base ability to specify which events in the "trace-events" file = may be used to trace guest activity in the TCG code (using the "tcg" event prope= ry). Such events generate an extra set of tracing functions that can be called= during TCG code generation and will automatically redirect a call to the appropr= iate backend-dependent tracing functions when the guest code is executed. Files generating guest code (TCG) must include "trace-tcg.h". Files decla= ring per-target helpers ("${target}/helper.h") must include "trace/generated-helpers.h". The flow of the generated routines is: [At translation time] * trace_${name}_tcg(bool, TCGv) Declared: "trace/generated-tcg-tracers.h" Defined : "trace/generated-tcg-tracers.h" * gen_helper_trace_${name}_tcg(bool, TCGv) Declared: "trace/generated-helpers.h" Defined : "trace/generated-helpers.h" Automatically transforms all the arguments and allocates them into the appropriate TCG temporary values (which are also freed). Provides a mor= e streamlined interface by allowing events in "trace-events" to take a mi= x of tracing-supported types and TCG types. * gen_helper_trace_${name}_tcg_proxy(TCGi32, TCGv) Declared: "trace/generated-helpers.h" Defined : "trace/generated-helpers.h" (using helper machinery) The actual TCG helper function, created using QEMU's TCG helper machine= ry. [At execution time] * helper_trace_${name}_tcg_proxy(uint32_t, uint64_t) Declared: "trace/generated-helpers.h" Defined : "trace/generated-helpers.c" Performs the appropriate argument type casts to match the signature of = the callee. * trace_${name}(bool, uint64_t) The already-existing tracing function. Signed-off-by: Llu=C3=ADs Vilanova --- Llu=C3=ADs Vilanova (12): trace: [tcg] Add documentation trace: [tracetool,tcg] Allow TCG types in trace event declarations trace: [tracetool] Add method 'Event.api' to get the name of public= routines trace: [tracetool,tcg] Provide TCG-related type transformation rule= s trace: [tracetool] Allow argument types to be transformed trace: [tcg] Declare TCG tracing helper routines trace: [tcg] Define TCG tracing helper routines trace: [tcg] Include TCG-tracing helpers on all helper.h trace: [tcg] Generate TCG tracing routines trace: [trivial] Include event definitions in "trace.h" trace: [tcg] Include TCG-tracing header on all targets trace: [all] Add "guest_vmem" event .gitignore | 3 + Makefile | 5 + Makefile.objs | 8 +- Makefile.target | 1=20 docs/tracing.txt | 36 +++++++ include/exec/cpu-all.h | 58 ++++++----- include/exec/def-helper.h | 9 ++ include/exec/exec-all.h | 3 + include/exec/softmmu_header.h | 17 +++ include/trace-tcg.h | 7 + include/trace.h | 1=20 scripts/tracetool/__init__.py | 49 +++++++++ scripts/tracetool/backend/dtrace.py | 6 + scripts/tracetool/backend/simple.py | 10 +- scripts/tracetool/backend/stderr.py | 5 + scripts/tracetool/backend/tcg.py | 125 ++++++++++++++++++++++++ scripts/tracetool/backend/ust.py | 8 +- scripts/tracetool/format/h.py | 6 + scripts/tracetool/format/tcg_h.py | 47 +++++++++ scripts/tracetool/format/tcg_helper_c.py | 27 +++++ scripts/tracetool/format/tcg_helper_h.py | 38 +++++++ scripts/tracetool/transform.py | 157 ++++++++++++++++++++++++= ++++++ target-alpha/helper.h | 2=20 target-alpha/translate.c | 3 + target-arm/helper.h | 2=20 target-arm/translate.c | 3 + target-cris/helper.h | 2=20 target-cris/translate.c | 3 + target-i386/helper.h | 2=20 target-i386/translate.c | 3 + target-lm32/helper.h | 2=20 target-lm32/translate.c | 3 + target-m68k/helper.h | 2=20 target-m68k/translate.c | 3 + target-microblaze/helper.h | 2=20 target-microblaze/translate.c | 3 + target-mips/helper.h | 2=20 target-mips/translate.c | 3 + target-openrisc/helper.h | 2=20 target-openrisc/translate.c | 3 + target-ppc/helper.h | 2=20 target-ppc/translate.c | 3 + target-s390x/helper.h | 2=20 target-s390x/translate.c | 2=20 target-sh4/helper.h | 2=20 target-sh4/translate.c | 3 + target-sparc/helper.h | 2=20 target-sparc/translate.c | 3 + target-unicore32/helper.h | 2=20 target-unicore32/translate.c | 3 + target-xtensa/helper.h | 2=20 target-xtensa/translate.c | 3 + tcg/tcg-op.h | 8 ++ tcg/tcg.c | 1=20 trace-events | 15 +++ trace/Makefile.objs | 45 ++++++++- trace/tcg-op-internal.h | 55 +++++++++++ 57 files changed, 771 insertions(+), 53 deletions(-) create mode 100644 include/trace-tcg.h create mode 100644 scripts/tracetool/backend/tcg.py create mode 100644 scripts/tracetool/format/tcg_h.py create mode 100644 scripts/tracetool/format/tcg_helper_c.py create mode 100644 scripts/tracetool/format/tcg_helper_h.py create mode 100644 scripts/tracetool/transform.py create mode 100644 trace/tcg-op-internal.h