From: Marco Liebel <[email protected]> Add a trace event that reports the executed HLX opcode and name.
Signed-off-by: Marco Liebel <[email protected]> Reviewed-by: Brian Cain <[email protected]> Signed-off-by: Brian Cain <[email protected]> --- meson.build | 1 + target/hexagon/helper.h | 3 +++ target/hexagon/trace.h | 2 ++ target/hexagon/op_helper.c | 7 +++++++ target/hexagon/trace-events | 6 ++++++ 5 files changed, 19 insertions(+) create mode 100644 target/hexagon/trace.h create mode 100644 target/hexagon/trace-events diff --git a/meson.build b/meson.build index 7ec3fb90233..71f135f0530 100644 --- a/meson.build +++ b/meson.build @@ -3695,6 +3695,7 @@ if have_system or have_user 'target/arm', 'target/arm/hvf', 'target/arm/tcg', + 'target/hexagon', 'target/hppa', 'target/i386', 'target/i386/kvm', diff --git a/target/hexagon/helper.h b/target/hexagon/helper.h index 8a2a6563d22..245cd50b89c 100644 --- a/target/hexagon/helper.h +++ b/target/hexagon/helper.h @@ -31,6 +31,9 @@ DEF_HELPER_FLAGS_4(vacsh_pred, TCG_CALL_NO_RWG_SE, s32, env, s64, s64, s64) DEF_HELPER_FLAGS_2(cabacdecbin_val, TCG_CALL_NO_RWG_SE, s64, s64, s64) DEF_HELPER_FLAGS_2(cabacdecbin_pred, TCG_CALL_NO_RWG_SE, s32, s64, s64) +/* HLX helpers */ +DEF_HELPER_FLAGS_2(hlx_trace_op, TCG_CALL_NO_RWG, void, env, i32) + /* Floating point */ DEF_HELPER_3(conv_sf2df, f64, env, f32, i32) DEF_HELPER_3(conv_df2sf, f32, env, f64, i32) diff --git a/target/hexagon/trace.h b/target/hexagon/trace.h new file mode 100644 index 00000000000..e886ce0b63a --- /dev/null +++ b/target/hexagon/trace.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#include "trace/trace-target_hexagon.h" diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index cb6a4ee7132..62e38c68754 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -37,8 +37,10 @@ #include "mmvec/mmvec.h" #include "mmvec/macros.h" #include "op_helper.h" +#include "opcodes.h" #include "cpu_helper.h" #include "tcg/tcg-gvec-desc.h" +#include "trace.h" #include "translate.h" #ifdef CONFIG_USER_ONLY #include "qemu/timer.h" @@ -68,6 +70,11 @@ uint64_t HELPER(utimer)(void) } #endif +void HELPER(hlx_trace_op)(CPUHexagonState *env, uint32_t opcode) +{ + trace_hexagon_hlx_op(opcode, opcode_names[opcode]); +} + #define SF_BIAS 127 #define SF_MANTBITS 23 diff --git a/target/hexagon/trace-events b/target/hexagon/trace-events new file mode 100644 index 00000000000..4235dc6ac2e --- /dev/null +++ b/target/hexagon/trace-events @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# See docs/devel/tracing.rst for syntax documentation. + +# HLX instruction tracing +hexagon_hlx_op(int opcode, const char *name) "opcode: 0x%x (%s)" -- 2.34.1
