diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2014-08-08 22:08:51 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2014-08-08 22:08:51 +0000 |
commit | 7c72adbd8fabd08add7b179e20d327a02617c3e2 (patch) | |
tree | 3c84d8c29394082226d516758b03990e648d2bb9 | |
parent | 380f15bde7517b2fda94d745393b53f13e9dfef9 (diff) | |
download | FreeBSD-src-7c72adbd8fabd08add7b179e20d327a02617c3e2.zip FreeBSD-src-7c72adbd8fabd08add7b179e20d327a02617c3e2.tar.gz |
MFC r269408, r269409:
shm_open()/shm_unlink() ktrace support.
-rw-r--r-- | sys/kern/uipc_shm.c | 14 | ||||
-rw-r--r-- | usr.bin/kdump/kdump.c | 8 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 024640b..16434b7 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" +#include "opt_ktrace.h" #include <sys/param.h> #include <sys/capability.h> @@ -53,6 +54,9 @@ __FBSDID("$FreeBSD$"); #include <sys/filedesc.h> #include <sys/fnv_hash.h> #include <sys/kernel.h> +#include <sys/uio.h> +#include <sys/signal.h> +#include <sys/ktrace.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mman.h> @@ -727,7 +731,10 @@ sys_shm_open(struct thread *td, struct shm_open_args *uap) } else { path = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); error = copyinstr(uap->path, path, MAXPATHLEN, NULL); - +#ifdef KTRACE + if (error == 0 && KTRPOINT(curthread, KTR_NAMEI)) + ktrnamei(path); +#endif /* Require paths to start with a '/' character. */ if (error == 0 && path[0] != '/') error = EINVAL; @@ -825,7 +832,10 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_args *uap) free(path, M_TEMP); return (error); } - +#ifdef KTRACE + if (KTRPOINT(curthread, KTR_NAMEI)) + ktrnamei(path); +#endif fnv = fnv_32_str(path, FNV1_32_INIT); sx_xlock(&shm_dict_lock); error = shm_remove(path, fnv, td->td_ucred); diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 8f4cefc..8076ae5 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1011,6 +1011,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags) ip++; narg--; break; + case SYS_shm_open: + print_number(ip, narg, c); + putchar(','); + flagsname(ip[0]); + printf(",0%o", ip[1]); + ip += 3; + narg -= 3; + break; case SYS_minherit: print_number(ip, narg, c); print_number(ip, narg, c); |