]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
util/log: Add vector registers to log
authorIvan Klokov <ivan.klokov@syntacore.com>
Mon, 10 Apr 2023 12:44:50 +0000 (15:44 +0300)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 13 Jun 2023 07:42:01 +0000 (17:42 +1000)
Added QEMU option 'vpu' to log vector extension registers such as gpr\fpu.

Signed-off-by: Ivan Klokov <ivan.klokov@syntacore.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230410124451.15929-2-ivan.klokov@syntacore.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
accel/tcg/cpu-exec.c
include/hw/core/cpu.h
include/qemu/log.h
util/log.c

index 42086525d7a66b24c3ee0f4ba7bbb926491dd978..ebc1db03d73eccb19f4e3b4a0eca67cfb0d5a0d4 100644 (file)
@@ -313,6 +313,9 @@ static void log_cpu_exec(target_ulong pc, CPUState *cpu,
 #if defined(TARGET_I386)
                 flags |= CPU_DUMP_CCOP;
 #endif
+                if (qemu_loglevel_mask(CPU_LOG_TB_VPU)) {
+                    flags |= CPU_DUMP_VPU;
+                }
                 cpu_dump_state(cpu, logfile, flags);
                 qemu_log_unlock(logfile);
             }
index 383456d1b3a4a981cb60dba46db211c968ea94dc..d84fbccaab608681e21442aa4785b03020ce19ee 100644 (file)
@@ -544,11 +544,13 @@ GuestPanicInformation *cpu_get_crash_info(CPUState *cpu);
  * @CPU_DUMP_CODE:
  * @CPU_DUMP_FPU: dump FPU register state, not just integer
  * @CPU_DUMP_CCOP: dump info about TCG QEMU's condition code optimization state
+ * @CPU_DUMP_VPU: dump VPU registers
  */
 enum CPUDumpFlags {
     CPU_DUMP_CODE = 0x00010000,
     CPU_DUMP_FPU  = 0x00020000,
     CPU_DUMP_CCOP = 0x00040000,
+    CPU_DUMP_VPU  = 0x00080000,
 };
 
 /**
index c5643d8dd56a09b4714ccaaa21b703ad4a71a81a..df59bfabcd5f1fce7279a0b307c6ef1b221f3b35 100644 (file)
@@ -35,6 +35,7 @@ bool qemu_log_separate(void);
 /* LOG_STRACE is used for user-mode strace logging. */
 #define LOG_STRACE         (1 << 19)
 #define LOG_PER_THREAD     (1 << 20)
+#define CPU_LOG_TB_VPU     (1 << 21)
 
 /* Lock/unlock output. */
 
index 53b4f6c58eb9ede6a311c02af05335fdba005d07..def88a9402baee406ca11a6d937a8d982c3bd3d1 100644 (file)
@@ -495,6 +495,8 @@ const QEMULogItem qemu_log_items[] = {
       "log every user-mode syscall, its input, and its result" },
     { LOG_PER_THREAD, "tid",
       "open a separate log file per thread; filename must contain '%d'" },
+    { CPU_LOG_TB_VPU, "vpu",
+      "include VPU registers in the 'cpu' logging" },
     { 0, NULL, NULL },
 };