diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2021-09-02 17:21:40 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2021-09-02 17:21:40 +0000 |
commit | f0ae9b4b30750ae1fc455e0dc27eb609c4da3f5d (patch) | |
tree | 1989e0fdee5b44f75812855308a4b4a64c4a94cc /sys/dev | |
parent | 7e6db7a96d62719d55ea260c3c5da088a8c145f6 (diff) |
rename struct dt_evt fields to make it clear this isn't only used for tracing syscalls
and adjust btrace(8) accordingly.
extracted from a larger diff by Tom Rollet.
ok mpi@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/dt/dt_prov_static.c | 12 | ||||
-rw-r--r-- | sys/dev/dt/dt_prov_syscall.c | 18 | ||||
-rw-r--r-- | sys/dev/dt/dtvar.h | 14 |
3 files changed, 22 insertions, 22 deletions
diff --git a/sys/dev/dt/dt_prov_static.c b/sys/dev/dt/dt_prov_static.c index 05828f036ff..789c2246e14 100644 --- a/sys/dev/dt/dt_prov_static.c +++ b/sys/dev/dt/dt_prov_static.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dt_prov_static.c,v 1.8 2021/06/07 13:55:54 dv Exp $ */ +/* $OpenBSD: dt_prov_static.c,v 1.9 2021/09/02 17:21:39 jasper Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org> @@ -163,11 +163,11 @@ dt_prov_static_hook(struct dt_provider *dtpv, ...) if (dtev == NULL) continue; - dtev->dtev_sysargs[0] = args[0]; - dtev->dtev_sysargs[1] = args[1]; - dtev->dtev_sysargs[2] = args[2]; - dtev->dtev_sysargs[3] = args[3]; - dtev->dtev_sysargs[4] = args[4]; + dtev->dtev_args[0] = args[0]; + dtev->dtev_args[1] = args[1]; + dtev->dtev_args[2] = args[2]; + dtev->dtev_args[3] = args[3]; + dtev->dtev_args[4] = args[4]; dt_pcb_ring_consume(dp, dtev); } diff --git a/sys/dev/dt/dt_prov_syscall.c b/sys/dev/dt/dt_prov_syscall.c index b2e82551929..0db59ef1c9a 100644 --- a/sys/dev/dt/dt_prov_syscall.c +++ b/sys/dev/dt/dt_prov_syscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dt_prov_syscall.c,v 1.4 2020/07/04 10:19:09 mpi Exp $ */ +/* $OpenBSD: dt_prov_syscall.c,v 1.5 2021/09/02 17:21:39 jasper Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org> @@ -136,7 +136,7 @@ dt_prov_syscall_entry(struct dt_provider *dtpv, ...) args = va_arg(ap, register_t*); va_end(ap); - KASSERT((argsize / sizeof(register_t)) <= DTMAXSYSARGS); + KASSERT((argsize / sizeof(register_t)) <= DTMAXFUNCARGS); if (sysnum < 0 || sysnum >= dtps_nsysent) return; @@ -154,7 +154,7 @@ dt_prov_syscall_entry(struct dt_provider *dtpv, ...) continue; if (ISSET(dp->dp_evtflags, DTEVT_FUNCARGS)) - memcpy(dtev->dtev_sysargs, args, argsize); + memcpy(dtev->dtev_args, args, argsize); dt_pcb_ring_consume(dp, dtev); } @@ -196,13 +196,13 @@ dt_prov_syscall_return(struct dt_provider *dtpv, ...) continue; if (error) { - dtev->dtev_sysretval[0] = -1; - dtev->dtev_sysretval[1] = 0; - dtev->dtev_syserror = error; + dtev->dtev_retval[0] = -1; + dtev->dtev_retval[1] = 0; + dtev->dtev_error = error; } else { - dtev->dtev_sysretval[0] = retval[0]; - dtev->dtev_sysretval[1] = retval[1]; - dtev->dtev_syserror = 0; + dtev->dtev_retval[0] = retval[0]; + dtev->dtev_retval[1] = retval[1]; + dtev->dtev_error = 0; } dt_pcb_ring_consume(dp, dtev); diff --git a/sys/dev/dt/dtvar.h b/sys/dev/dt/dtvar.h index 3e7985692eb..bea47c2d80e 100644 --- a/sys/dev/dt/dtvar.h +++ b/sys/dev/dt/dtvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dtvar.h,v 1.5 2020/07/04 10:19:09 mpi Exp $ */ +/* $OpenBSD: dtvar.h,v 1.6 2021/09/02 17:21:39 jasper Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org> @@ -34,9 +34,9 @@ #define DTMAXCOMLEN 16 /* - * Maximum number of arguments passed to a syscall. + * Maximum number of arguments passed to a function. */ -#define DTMAXSYSARGS 10 +#define DTMAXFUNCARGS 10 /* * Event state: where to store information when a probe fires. @@ -54,15 +54,15 @@ struct dt_evt { struct stacktrace dtev_kstack; /* kernel stack frame */ char dtev_comm[DTMAXCOMLEN+1]; /* current pr. name */ union { - register_t E_entry[DTMAXSYSARGS]; + register_t E_entry[DTMAXFUNCARGS]; struct { register_t __retval[2]; int __error; } E_return; } _sys; -#define dtev_sysargs _sys.E_entry /* syscall args. */ -#define dtev_sysretval _sys.E_return.__retval /* syscall retval */ -#define dtev_syserror _sys.E_return.__error /* syscall error */ +#define dtev_args _sys.E_entry /* function args. */ +#define dtev_retval _sys.E_return.__retval /* function retval */ +#define dtev_error _sys.E_return.__error /* function error */ }; |