[PULL 01/11] *-user: remove the guest_user_syscall tracepoints

Stefan Hajnoczi posted 11 patches 2 years, 8 months ago
There is a newer version of this series
[PULL 01/11] *-user: remove the guest_user_syscall tracepoints
Posted by Stefan Hajnoczi 2 years, 8 months ago
From: Alex Bennée <alex.bennee@linaro.org>

This is pure duplication now. Both bsd-user and linux-user have
builtin strace support and we can also track syscalls via the plugins
system.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20230526165401.574474-2-alex.bennee@linaro.org
Message-Id: <20230524133952.3971948-2-alex.bennee@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/user/syscall-trace.h  |  4 ----
 bsd-user/freebsd/os-syscall.c |  2 --
 trace-events                  | 19 -------------------
 3 files changed, 25 deletions(-)

diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h
index 90bda7631c..557f881a79 100644
--- a/include/user/syscall-trace.h
+++ b/include/user/syscall-trace.h
@@ -26,9 +26,6 @@ static inline void record_syscall_start(void *cpu, int num,
                                         abi_long arg5, abi_long arg6,
                                         abi_long arg7, abi_long arg8)
 {
-    trace_guest_user_syscall(cpu, num,
-                             arg1, arg2, arg3, arg4,
-                             arg5, arg6, arg7, arg8);
     qemu_plugin_vcpu_syscall(cpu, num,
                              arg1, arg2, arg3, arg4,
                              arg5, arg6, arg7, arg8);
@@ -36,7 +33,6 @@ static inline void record_syscall_start(void *cpu, int num,
 
 static inline void record_syscall_return(void *cpu, int num, abi_long ret)
 {
-    trace_guest_user_syscall_ret(cpu, num, ret);
     qemu_plugin_vcpu_syscall_ret(cpu, num, ret);
 }
 
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index c8f998ecec..b0ae43766f 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
     CPUState *cpu = env_cpu(cpu_env);
     abi_long ret;
 
-    trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
     if (do_strace) {
         print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
     }
@@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
     if (do_strace) {
         print_freebsd_syscall_ret(num, ret);
     }
-    trace_guest_user_syscall_ret(cpu, num, ret);
 
     return ret;
 }
diff --git a/trace-events b/trace-events
index b6b84b175e..691c3533e4 100644
--- a/trace-events
+++ b/trace-events
@@ -85,22 +85,3 @@ vcpu guest_cpu_exit(void)
 # Targets: all
 vcpu guest_cpu_reset(void)
 
-# include/user/syscall-trace.h
-
-# @num: System call number.
-# @arg*: System call argument value.
-#
-# Start executing a guest system call in syscall emulation mode.
-#
-# Mode: user
-# Targets: TCG(all)
-vcpu guest_user_syscall(uint64_t num, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7, uint64_t arg8) "num=0x%016"PRIx64" arg1=0x%016"PRIx64" arg2=0x%016"PRIx64" arg3=0x%016"PRIx64" arg4=0x%016"PRIx64" arg5=0x%016"PRIx64" arg6=0x%016"PRIx64" arg7=0x%016"PRIx64" arg8=0x%016"PRIx64
-
-# @num: System call number.
-# @ret: System call result value.
-#
-# Finish executing a guest system call in syscall emulation mode.
-#
-# Mode: user
-# Targets: TCG(all)
-vcpu guest_user_syscall_ret(uint64_t num, uint64_t ret) "num=0x%016"PRIx64" ret=0x%016"PRIx64
-- 
2.40.1


Re: [PULL 01/11] *-user: remove the guest_user_syscall tracepoints
Posted by Richard Henderson 2 years, 8 months ago
On 5/31/23 12:48, Stefan Hajnoczi wrote:
> --- a/bsd-user/freebsd/os-syscall.c
> +++ b/bsd-user/freebsd/os-syscall.c
> @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
>       CPUState *cpu = env_cpu(cpu_env);
>       abi_long ret;
>   
> -    trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
>       if (do_strace) {
>           print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
>       }
> @@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
>       if (do_strace) {
>           print_freebsd_syscall_ret(num, ret);
>       }
> -    trace_guest_user_syscall_ret(cpu, num, ret);
>   
>       return ret;
>   }

Failed to remove the now unused cpu variable:

https://gitlab.com/qemu-project/qemu/-/jobs/4387911615#L6426

../bsd-user/freebsd/os-syscall.c:531:15: error: unused variable 'cpu' 
[-Werror,-Wunused-variable]
     CPUState *cpu = env_cpu(cpu_env);
               ^
1 error generated.


r~
Re: [PULL 01/11] *-user: remove the guest_user_syscall tracepoints
Posted by Stefan Hajnoczi 2 years, 8 months ago
On Wed, May 31, 2023 at 02:29:49PM -0700, Richard Henderson wrote:
> On 5/31/23 12:48, Stefan Hajnoczi wrote:
> > --- a/bsd-user/freebsd/os-syscall.c
> > +++ b/bsd-user/freebsd/os-syscall.c
> > @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
> >       CPUState *cpu = env_cpu(cpu_env);
> >       abi_long ret;
> > -    trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
> >       if (do_strace) {
> >           print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
> >       }
> > @@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
> >       if (do_strace) {
> >           print_freebsd_syscall_ret(num, ret);
> >       }
> > -    trace_guest_user_syscall_ret(cpu, num, ret);
> >       return ret;
> >   }
> 
> Failed to remove the now unused cpu variable:
> 
> https://gitlab.com/qemu-project/qemu/-/jobs/4387911615#L6426
> 
> ../bsd-user/freebsd/os-syscall.c:531:15: error: unused variable 'cpu'
> [-Werror,-Wunused-variable]
>     CPUState *cpu = env_cpu(cpu_env);
>               ^
> 1 error generated.

I'll send a v2 with the unused variable warning fixed.

Stefan