[PATCH v3 57/66] accel/tcg/user-exec: Convert DEBUG_SIGNAL to tracepoint

Richard Henderson posted 66 patches 2 years, 10 months ago
Maintainers: Alistair Francis <Alistair.Francis@wdc.com>, Eduardo Habkost <ehabkost@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Marek Vasut <marex@denx.de>, Alistair Francis <alistair.francis@wdc.com>, Greg Kurz <groug@kaod.org>, Michael Rolnik <mrolnik@gmail.com>, Stefan Weil <sw@weilnetz.de>, Yoshinori Sato <ysato@users.sourceforge.jp>, Mahmoud Mandour <ma.mandourr@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Stafford Horne <shorne@gmail.com>, Alexandre Iooss <erdnaxe@crans.org>, David Hildenbrand <david@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Palmer Dabbelt <palmer@dabbelt.com>, Aurelien Jarno <aurelien@aurel32.net>, "Alex Bennée" <alex.bennee@linaro.org>, Chris Wulff <crwulff@gmail.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <laurent@vivier.eu>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Bin Meng <bin.meng@windriver.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Max Filippov <jcmvbkbc@gmail.com>, Thomas Huth <thuth@redhat.com>, Taylor Simpson <tsimpson@quicinc.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Cornelia Huck <cohuck@redhat.com>
[PATCH v3 57/66] accel/tcg/user-exec: Convert DEBUG_SIGNAL to tracepoint
Posted by Richard Henderson 2 years, 10 months ago
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/user-exec.c  | 9 +++------
 accel/tcg/trace-events | 3 +++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index 6a3fec3002..1c9486c76d 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -27,6 +27,7 @@
 #include "exec/helper-proto.h"
 #include "qemu/atomic128.h"
 #include "trace/trace-root.h"
+#include "trace.h"
 #include "tcg/tcg-ldst.h"
 #include "internal.h"
 
@@ -45,8 +46,6 @@
 
 __thread uintptr_t helper_retaddr;
 
-//#define DEBUG_SIGNAL
-
 /* exit the current TB from a signal handler. The host registers are
    restored in a state compatible with the CPU emulator
  */
@@ -133,10 +132,8 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info,
         abort();
     }
 
-#if defined(DEBUG_SIGNAL)
-    printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n",
-           pc, address, is_write, *(unsigned long *)old_set);
-#endif
+    trace_sigsegv(pc, address, is_write, *(unsigned long *)old_set);
+
     /* XXX: locking issue */
     /* Note that it is important that we don't call page_unprotect() unless
      * this is really a "write to nonwriteable page" fault, because
diff --git a/accel/tcg/trace-events b/accel/tcg/trace-events
index 59eab96f26..d54416f2ee 100644
--- a/accel/tcg/trace-events
+++ b/accel/tcg/trace-events
@@ -8,3 +8,6 @@ exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=0x%x"
 
 # translate-all.c
 translate_block(void *tb, uintptr_t pc, const void *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
+
+# user-exec.c
+sigsegv(uintptr_t pc, uintptr_t addr, int is_write, unsigned long old_set) "pc:0x%"PRIxPTR", addr:0x%"PRIxPTR", w:%d, oldset:0x%lx"
-- 
2.25.1


Re: [PATCH v3 57/66] accel/tcg/user-exec: Convert DEBUG_SIGNAL to tracepoint
Posted by Philippe Mathieu-Daudé 2 years, 10 months ago
On 8/18/21 9:19 PM, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  accel/tcg/user-exec.c  | 9 +++------
>  accel/tcg/trace-events | 3 +++
>  2 files changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>