All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code
@ 2014-01-31 16:09 Lluís Vilanova
  2014-01-31 16:09 ` [Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation Lluís Vilanova
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Lluís Vilanova @ 2014-01-31 16:09 UTC (permalink / raw)
  To: qemu-devel; +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 propery).

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 appropriate
backend-dependent tracing functions when the guest code is executed.

Files generating guest code (TCG) must include "trace-tcg.h". Files declaring
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 more
  streamlined interface by allowing events in "trace-events" to take a mix 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 machinery.


[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ís Vilanova <vilanova@ac.upc.edu>
---

Lluís 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 rules
      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 
 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 
 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 
 target-alpha/translate.c                 |    3 +
 target-arm/helper.h                      |    2 
 target-arm/translate.c                   |    3 +
 target-cris/helper.h                     |    2 
 target-cris/translate.c                  |    3 +
 target-i386/helper.h                     |    2 
 target-i386/translate.c                  |    3 +
 target-lm32/helper.h                     |    2 
 target-lm32/translate.c                  |    3 +
 target-m68k/helper.h                     |    2 
 target-m68k/translate.c                  |    3 +
 target-microblaze/helper.h               |    2 
 target-microblaze/translate.c            |    3 +
 target-mips/helper.h                     |    2 
 target-mips/translate.c                  |    3 +
 target-openrisc/helper.h                 |    2 
 target-openrisc/translate.c              |    3 +
 target-ppc/helper.h                      |    2 
 target-ppc/translate.c                   |    3 +
 target-s390x/helper.h                    |    2 
 target-s390x/translate.c                 |    2 
 target-sh4/helper.h                      |    2 
 target-sh4/translate.c                   |    3 +
 target-sparc/helper.h                    |    2 
 target-sparc/translate.c                 |    3 +
 target-unicore32/helper.h                |    2 
 target-unicore32/translate.c             |    3 +
 target-xtensa/helper.h                   |    2 
 target-xtensa/translate.c                |    3 +
 tcg/tcg-op.h                             |    8 ++
 tcg/tcg.c                                |    1 
 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

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

end of thread, other threads:[~2014-02-10 13:29 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 16:09 [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 02/12] trace: [tracetool, tcg] Allow TCG types in trace event declarations Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 03/12] trace: [tracetool] Add method 'Event.api' to get the name of public routines Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 04/12] trace: [tracetool, tcg] Provide TCG-related type transformation rules Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 05/12] trace: [tracetool] Allow argument types to be transformed Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 06/12] trace: [tcg] Declare TCG tracing helper routines Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 07/12] trace: [tcg] Define " Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 08/12] trace: [tcg] Include TCG-tracing helpers on all helper.h Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 09/12] trace: [tcg] Generate TCG tracing routines Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 10/12] trace: [trivial] Include event definitions in "trace.h" Lluís Vilanova
2014-01-31 16:10 ` [Qemu-devel] [PATCH 11/12] trace: [tcg] Include TCG-tracing header on all targets Lluís Vilanova
2014-01-31 16:10 ` [Qemu-devel] [PATCH 12/12] trace: [all] Add "guest_vmem" event Lluís Vilanova
2014-02-04 15:08   ` Richard Henderson
2014-02-04 20:01     ` Lluís Vilanova
2014-02-06 16:12       ` Richard Henderson
2014-02-10 13:29         ` Lluís Vilanova
2014-02-03 14:40 ` [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code Stefan Hajnoczi
2014-02-03 16:24   ` Lluís Vilanova
2014-02-04 14:57 ` Richard Henderson
2014-02-04 15:02   ` Peter Maydell
2014-02-04 15:17     ` Richard Henderson
2014-02-04 20:44       ` Lluís Vilanova
2014-02-04 20:34     ` Lluís Vilanova
2014-02-04 20:33   ` Lluís Vilanova
2014-02-06 15:57     ` Richard Henderson
2014-02-06 19:26       ` Lluís Vilanova
2014-02-07 14:49         ` Richard Henderson
2014-02-07 15:13           ` Peter Maydell
2014-02-07 15:24             ` Lluís Vilanova

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.