Patchwork [v4,10/10] trace: [tcg] Include TCG-tracing header on all targets

login
register
mail settings
Submitter Lluís Vilanova
Date May 29, 2014, 12:23 p.m.
Message ID <20140529122330.9724.72706.stgit@fimbulvetr.bsc.es>
Download mbox | patch
Permalink /patch/353750/
State New
Headers show

Comments

Lluís Vilanova - May 29, 2014, 12:23 p.m.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 target-alpha/translate.c      |    3 +++
 target-arm/translate-a64.c    |    2 ++
 target-arm/translate.c        |    3 +++
 target-cris/translate.c       |    3 +++
 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-openrisc/translate.c   |    3 +++
 target-ppc/translate.c        |    3 +++
 target-s390x/translate.c      |    2 ++
 target-sh4/translate.c        |    3 +++
 target-sparc/translate.c      |    3 +++
 target-unicore32/translate.c  |    3 +++
 target-xtensa/translate.c     |    3 +++
 16 files changed, 46 insertions(+)
Richard Henderson - May 29, 2014, 4:14 p.m.
On 05/29/2014 05:23 AM, Lluís Vilanova wrote:
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
>  target-alpha/translate.c      |    3 +++
>  target-arm/translate-a64.c    |    2 ++
>  target-arm/translate.c        |    3 +++
>  target-cris/translate.c       |    3 +++
>  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-openrisc/translate.c   |    3 +++
>  target-ppc/translate.c        |    3 +++
>  target-s390x/translate.c      |    2 ++
>  target-sh4/translate.c        |    3 +++
>  target-sparc/translate.c      |    3 +++
>  target-unicore32/translate.c  |    3 +++
>  target-xtensa/translate.c     |    3 +++
>  16 files changed, 46 insertions(+)
> 
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index e31d56c..9e2a773 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -25,6 +25,9 @@
>  #include "exec/helper-proto.h"
>  #include "exec/helper-gen.h"
>  
> +#include "trace-tcg.h"

Continued from 7 ... Or indeed 3 different includes into exec/helper-gen.h?

Or perhaps I'm a bit confused as to what difference there is between
trace-tcg.h and the %(name)s(%(args)s) helpers you're generating?


r~
Lluís Vilanova - May 29, 2014, 5:04 p.m.
Richard Henderson writes:

> On 05/29/2014 05:23 AM, Lluís Vilanova wrote:
>> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>> ---
>> target-alpha/translate.c      |    3 +++
>> target-arm/translate-a64.c    |    2 ++
>> target-arm/translate.c        |    3 +++
>> target-cris/translate.c       |    3 +++
>> 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-openrisc/translate.c   |    3 +++
>> target-ppc/translate.c        |    3 +++
>> target-s390x/translate.c      |    2 ++
>> target-sh4/translate.c        |    3 +++
>> target-sparc/translate.c      |    3 +++
>> target-unicore32/translate.c  |    3 +++
>> target-xtensa/translate.c     |    3 +++
>> 16 files changed, 46 insertions(+)
>> 
>> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
>> index e31d56c..9e2a773 100644
>> --- a/target-alpha/translate.c
>> +++ b/target-alpha/translate.c
>> @@ -25,6 +25,9 @@
>> #include "exec/helper-proto.h"
>> #include "exec/helper-gen.h"
>> 
>> +#include "trace-tcg.h"

> Continued from 7 ... Or indeed 3 different includes into exec/helper-gen.h?

> Or perhaps I'm a bit confused as to what difference there is between
> trace-tcg.h and the %(name)s(%(args)s) helpers you're generating?

This "trace-tcg.h" provides a convenience function for every event. It basically
calls "trace_event_trans" (which produces a trace entry for event "event_trans",
defined in "trace.h"), and also calls "gen_helper_trace_event_exec" (which
produces the TCG code to call "trace_event_exec" at guest execution time,
defined in "trace/generated-helpers.h").

This file (or the same with a different name) could be included from some of the
"helper-*" headers, but since it provides the tracing user interface, I thought
it would be better to include it explicitly (like "trace.h").


Lluis

Patch

diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index e31d56c..9e2a773 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -25,6 +25,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #undef ALPHA_DEBUG_DISAS
 #define CONFIG_SOFTFLOAT_INLINE
 
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 9f964df..505c812 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -34,6 +34,8 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
 static TCGv_i64 cpu_X[32];
 static TCGv_i64 cpu_pc;
 static TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF;
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 7f6fcd6..1a5a838 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -34,6 +34,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define ENABLE_ARCH_4T    arm_feature(env, ARM_FEATURE_V4T)
 #define ENABLE_ARCH_5     arm_feature(env, ARM_FEATURE_V5)
 /* currently all emulated v5 cores are also v5TE, so don't bother */
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 90fe0a2..a4027f0 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -32,6 +32,9 @@ 
 
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define DISAS_CRIS 0
 #if DISAS_CRIS
 #  define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 3aa52eb..60a2954 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -31,6 +31,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define PREFIX_REPZ   0x01
 #define PREFIX_REPNZ  0x02
 #define PREFIX_LOCK   0x04
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 51eca06..d88c44b 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -26,6 +26,9 @@ 
 
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define DISAS_LM32 1
 #if DISAS_LM32
 #  define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index fa248d9..d6c39e3 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -26,6 +26,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 //#define DEBUG_DISPATCH 1
 
 /* Fake floating point.  */
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 488df2d..373b09a 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -25,6 +25,9 @@ 
 #include "microblaze-decode.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define SIM_COMPAT 0
 #define DISAS_GNU 1
 #define DISAS_MB 1
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 13cf29b..3930e7f 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -28,6 +28,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define MIPS_DEBUG_DISAS 0
 //#define MIPS_DEBUG_SIGN_EXTENSIONS
 
diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
index 40084f9..2143328 100644
--- a/target-openrisc/translate.c
+++ b/target-openrisc/translate.c
@@ -30,6 +30,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define OPENRISC_DISAS
 
 #ifdef OPENRISC_DISAS
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 6283b2c..e292387 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -26,6 +26,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define CPU_SINGLE_STEP 0x1
 #define CPU_BRANCH_STEP 0x2
 #define GDBSTUB_SINGLE_STEP 0x4
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index cf65f01..60ea3b1 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -41,6 +41,8 @@  static TCGv_ptr cpu_env;
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
 
 /* Information that (most) every instruction needs to manipulate.  */
 typedef struct DisasContext DisasContext;
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 169c87f..00f2eca 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -27,6 +27,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 typedef struct DisasContext {
     struct TranslationBlock *tb;
     target_ulong pc;
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 652a181..966cc89 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -31,6 +31,9 @@ 
 
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 #define DEBUG_DISAS
 
 #define DYNAMIC_PC  1 /* dynamic pc value */
diff --git a/target-unicore32/translate.c b/target-unicore32/translate.c
index 3cccafe..1b04a6c 100644
--- a/target-unicore32/translate.c
+++ b/target-unicore32/translate.c
@@ -22,6 +22,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 /* internal defines */
 typedef struct DisasContext {
     target_ulong pc;
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 57e56bd..14d3bc2 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -40,6 +40,9 @@ 
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 
+#include "trace-tcg.h"
+
+
 typedef struct DisasContext {
     const XtensaConfig *config;
     TranslationBlock *tb;