summaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2016-06-09 19:31:47 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2016-06-20 17:21:56 +0100
commitdcdaadb6ea873159487aa2fdbee2c4aa7779e02d (patch)
tree767536fb99ccab715bbd47af0587c1e356a9621a /include/exec
parent7c2550432abe62f53e6df878ceba6ceaf71f0e7e (diff)
downloadqemu-dcdaadb6ea873159487aa2fdbee2c4aa7779e02d.tar.gz
qemu-dcdaadb6ea873159487aa2fdbee2c4aa7779e02d.tar.bz2
qemu-dcdaadb6ea873159487aa2fdbee2c4aa7779e02d.zip
trace: [all] Add "guest_mem_before" event
The event is described in "trace-events". Note that the "MO_AMASK" flag is not traced, since it does not seem to affect the visible semantics of instructions. [s/inline inline/inline/ to fix clang build. --Stefan] Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 146549350711.18437.726780393247474362.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/cpu_ldst_template.h25
-rw-r--r--include/exec/cpu_ldst_useronly_template.h22
2 files changed, 47 insertions, 0 deletions
diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h
index 3091c00030..eaf69a1ad4 100644
--- a/include/exec/cpu_ldst_template.h
+++ b/include/exec/cpu_ldst_template.h
@@ -23,6 +23,13 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#if !defined(SOFTMMU_CODE_ACCESS)
+#include "trace.h"
+#endif
+
+#include "trace/mem.h"
+
#if DATA_SIZE == 8
#define SUFFIX q
#define USUFFIX q
@@ -80,6 +87,12 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
int mmu_idx;
TCGMemOpIdx oi;
+#if !defined(SOFTMMU_CODE_ACCESS)
+ trace_guest_mem_before_exec(
+ ENV_GET_CPU(env), ptr,
+ trace_mem_build_info(SHIFT, false, MO_TE, false));
+#endif
+
addr = ptr;
page_index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
mmu_idx = CPU_MMU_INDEX;
@@ -112,6 +125,12 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
int mmu_idx;
TCGMemOpIdx oi;
+#if !defined(SOFTMMU_CODE_ACCESS)
+ trace_guest_mem_before_exec(
+ ENV_GET_CPU(env), ptr,
+ trace_mem_build_info(SHIFT, true, MO_TE, false));
+#endif
+
addr = ptr;
page_index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
mmu_idx = CPU_MMU_INDEX;
@@ -148,6 +167,12 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
int mmu_idx;
TCGMemOpIdx oi;
+#if !defined(SOFTMMU_CODE_ACCESS)
+ trace_guest_mem_before_exec(
+ ENV_GET_CPU(env), ptr,
+ trace_mem_build_info(SHIFT, false, MO_TE, true));
+#endif
+
addr = ptr;
page_index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
mmu_idx = CPU_MMU_INDEX;
diff --git a/include/exec/cpu_ldst_useronly_template.h b/include/exec/cpu_ldst_useronly_template.h
index 040b147437..b1378bfae8 100644
--- a/include/exec/cpu_ldst_useronly_template.h
+++ b/include/exec/cpu_ldst_useronly_template.h
@@ -22,6 +22,13 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#if !defined(CODE_ACCESS)
+#include "trace.h"
+#endif
+
+#include "trace/mem.h"
+
#if DATA_SIZE == 8
#define SUFFIX q
#define USUFFIX q
@@ -53,6 +60,11 @@
static inline RES_TYPE
glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr)
{
+#if !defined(CODE_ACCESS)
+ trace_guest_mem_before_exec(
+ ENV_GET_CPU(env), ptr,
+ trace_mem_build_info(DATA_SIZE, false, MO_TE, false));
+#endif
return glue(glue(ld, USUFFIX), _p)(g2h(ptr));
}
@@ -68,6 +80,11 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
static inline int
glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr)
{
+#if !defined(CODE_ACCESS)
+ trace_guest_mem_before_exec(
+ ENV_GET_CPU(env), ptr,
+ trace_mem_build_info(DATA_SIZE, true, MO_TE, false));
+#endif
return glue(glue(lds, SUFFIX), _p)(g2h(ptr));
}
@@ -85,6 +102,11 @@ static inline void
glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr,
RES_TYPE v)
{
+#if !defined(CODE_ACCESS)
+ trace_guest_mem_before_exec(
+ ENV_GET_CPU(env), ptr,
+ trace_mem_build_info(DATA_SIZE, false, MO_TE, true));
+#endif
glue(glue(st, SUFFIX), _p)(g2h(ptr), v);
}