Remove Mach specific trace points.diff -r1.155 -r1.156 src/sys/kern/kern_ktrace.c
(joerg)
--- src/sys/kern/kern_ktrace.c 2010/11/19 06:44:42 1.155
+++ src/sys/kern/kern_ktrace.c 2011/04/27 00:00:46 1.156
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kern_ktrace.c,v 1.155 2010/11/19 06:44:42 dholland Exp $ */ | 1 | /* $NetBSD: kern_ktrace.c,v 1.156 2011/04/27 00:00:46 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Andrew Doran. | 8 | * by Andrew Doran. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -51,27 +51,27 @@ | @@ -51,27 +51,27 @@ | |||
51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
58 | * SUCH DAMAGE. | 58 | * SUCH DAMAGE. | |
59 | * | 59 | * | |
60 | * @(#)kern_ktrace.c 8.5 (Berkeley) 5/14/95 | 60 | * @(#)kern_ktrace.c 8.5 (Berkeley) 5/14/95 | |
61 | */ | 61 | */ | |
62 | 62 | |||
63 | #include <sys/cdefs.h> | 63 | #include <sys/cdefs.h> | |
64 | __KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.155 2010/11/19 06:44:42 dholland Exp $"); | 64 | __KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.156 2011/04/27 00:00:46 joerg Exp $"); | |
65 | 65 | |||
66 | #include <sys/param.h> | 66 | #include <sys/param.h> | |
67 | #include <sys/systm.h> | 67 | #include <sys/systm.h> | |
68 | #include <sys/proc.h> | 68 | #include <sys/proc.h> | |
69 | #include <sys/file.h> | 69 | #include <sys/file.h> | |
70 | #include <sys/namei.h> | 70 | #include <sys/namei.h> | |
71 | #include <sys/vnode.h> | 71 | #include <sys/vnode.h> | |
72 | #include <sys/kernel.h> | 72 | #include <sys/kernel.h> | |
73 | #include <sys/kthread.h> | 73 | #include <sys/kthread.h> | |
74 | #include <sys/ktrace.h> | 74 | #include <sys/ktrace.h> | |
75 | #include <sys/kmem.h> | 75 | #include <sys/kmem.h> | |
76 | #include <sys/syslog.h> | 76 | #include <sys/syslog.h> | |
77 | #include <sys/filedesc.h> | 77 | #include <sys/filedesc.h> | |
@@ -955,59 +955,26 @@ ktr_kuser(const char *id, void *addr, si | @@ -955,59 +955,26 @@ ktr_kuser(const char *id, void *addr, si | |||
955 | 955 | |||
956 | error = ktealloc(&kte, (void *)&ktp, l, KTR_USER, sizeof(*ktp) + len); | 956 | error = ktealloc(&kte, (void *)&ktp, l, KTR_USER, sizeof(*ktp) + len); | |
957 | if (error != 0) | 957 | if (error != 0) | |
958 | return; | 958 | return; | |
959 | 959 | |||
960 | strlcpy(ktp->ktr_id, id, KTR_USER_MAXIDLEN); | 960 | strlcpy(ktp->ktr_id, id, KTR_USER_MAXIDLEN); | |
961 | 961 | |||
962 | memcpy(ktp + 1, addr, len); | 962 | memcpy(ktp + 1, addr, len); | |
963 | 963 | |||
964 | ktraddentry(l, kte, KTA_WAITOK); | 964 | ktraddentry(l, kte, KTA_WAITOK); | |
965 | } | 965 | } | |
966 | 966 | |||
967 | void | 967 | void | |
968 | ktr_mmsg(const void *msgh, size_t size) | |||
969 | { | |||
970 | lwp_t *l = curlwp; | |||
971 | ||||
972 | if (!KTRPOINT(l->l_proc, KTR_MMSG)) | |||
973 | return; | |||
974 | ||||
975 | ktr_kmem(l, KTR_MMSG, msgh, size); | |||
976 | } | |||
977 | ||||
978 | void | |||
979 | ktr_mool(const void *kaddr, size_t size, const void *uaddr) | |||
980 | { | |||
981 | struct ktrace_entry *kte; | |||
982 | struct ktr_mool *kp; | |||
983 | struct ktr_mool *bf; | |||
984 | lwp_t *l = curlwp; | |||
985 | ||||
986 | if (!KTRPOINT(l->l_proc, KTR_MOOL)) | |||
987 | return; | |||
988 | ||||
989 | if (ktealloc(&kte, (void *)&kp, l, KTR_MOOL, size + sizeof(*kp))) | |||
990 | return; | |||
991 | ||||
992 | kp->uaddr = uaddr; | |||
993 | kp->size = size; | |||
994 | bf = kp + 1; /* Skip uaddr and size */ | |||
995 | (void)memcpy(bf, kaddr, size); | |||
996 | ||||
997 | ktraddentry(l, kte, KTA_WAITOK); | |||
998 | } | |||
999 | ||||
1000 | void | |||
1001 | ktr_saupcall(struct lwp *l, int type, int nevent, int nint, void *sas, | 968 | ktr_saupcall(struct lwp *l, int type, int nevent, int nint, void *sas, | |
1002 | void *ap, void *ksas) | 969 | void *ap, void *ksas) | |
1003 | { | 970 | { | |
1004 | struct ktrace_entry *kte; | 971 | struct ktrace_entry *kte; | |
1005 | struct ktr_saupcall *ktp; | 972 | struct ktr_saupcall *ktp; | |
1006 | size_t len, sz; | 973 | size_t len, sz; | |
1007 | struct sa_t **sapp; | 974 | struct sa_t **sapp; | |
1008 | int i; | 975 | int i; | |
1009 | 976 | |||
1010 | if (!KTRPOINT(l->l_proc, KTR_SAUPCALL)) | 977 | if (!KTRPOINT(l->l_proc, KTR_SAUPCALL)) | |
1011 | return; | 978 | return; | |
1012 | 979 | |||
1013 | len = sizeof(struct ktr_saupcall); | 980 | len = sizeof(struct ktr_saupcall); |
--- src/sys/kern/kern_stub.c 2011/01/31 23:07:16 1.30
+++ src/sys/kern/kern_stub.c 2011/04/27 00:00:46 1.31
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kern_stub.c,v 1.30 2011/01/31 23:07:16 dyoung Exp $ */ | 1 | /* $NetBSD: kern_stub.c,v 1.31 2011/04/27 00:00:46 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -52,27 +52,27 @@ | @@ -52,27 +52,27 @@ | |||
52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
55 | * SUCH DAMAGE. | 55 | * SUCH DAMAGE. | |
56 | * | 56 | * | |
57 | * @(#)subr_xxx.c 8.3 (Berkeley) 3/29/95 | 57 | * @(#)subr_xxx.c 8.3 (Berkeley) 3/29/95 | |
58 | */ | 58 | */ | |
59 | 59 | |||
60 | /* | 60 | /* | |
61 | * Stubs for system calls and facilities not included in the system. | 61 | * Stubs for system calls and facilities not included in the system. | |
62 | */ | 62 | */ | |
63 | 63 | |||
64 | #include <sys/cdefs.h> | 64 | #include <sys/cdefs.h> | |
65 | __KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.30 2011/01/31 23:07:16 dyoung Exp $"); | 65 | __KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.31 2011/04/27 00:00:46 joerg Exp $"); | |
66 | 66 | |||
67 | #include "opt_ptrace.h" | 67 | #include "opt_ptrace.h" | |
68 | #include "opt_ktrace.h" | 68 | #include "opt_ktrace.h" | |
69 | #include "opt_sa.h" | 69 | #include "opt_sa.h" | |
70 | 70 | |||
71 | #include <sys/param.h> | 71 | #include <sys/param.h> | |
72 | #include <sys/kernel.h> | 72 | #include <sys/kernel.h> | |
73 | #include <sys/proc.h> | 73 | #include <sys/proc.h> | |
74 | #include <sys/fstypes.h> | 74 | #include <sys/fstypes.h> | |
75 | #include <sys/signalvar.h> | 75 | #include <sys/signalvar.h> | |
76 | #include <sys/syscall.h> | 76 | #include <sys/syscall.h> | |
77 | #include <sys/ktrace.h> | 77 | #include <sys/ktrace.h> | |
78 | #include <sys/intr.h> | 78 | #include <sys/intr.h> | |
@@ -97,29 +97,27 @@ __weak_alias(sys_ptrace,sys_nosys); | @@ -97,29 +97,27 @@ __weak_alias(sys_ptrace,sys_nosys); | |||
97 | #ifndef KTRACE | 97 | #ifndef KTRACE | |
98 | __weak_alias(ktr_csw,nullop); /* Probes */ | 98 | __weak_alias(ktr_csw,nullop); /* Probes */ | |
99 | __weak_alias(ktr_emul,nullop); | 99 | __weak_alias(ktr_emul,nullop); | |
100 | __weak_alias(ktr_geniov,nullop); | 100 | __weak_alias(ktr_geniov,nullop); | |
101 | __weak_alias(ktr_genio,nullop); | 101 | __weak_alias(ktr_genio,nullop); | |
102 | __weak_alias(ktr_mibio,nullop); | 102 | __weak_alias(ktr_mibio,nullop); | |
103 | __weak_alias(ktr_namei,nullop); | 103 | __weak_alias(ktr_namei,nullop); | |
104 | __weak_alias(ktr_namei2,nullop); | 104 | __weak_alias(ktr_namei2,nullop); | |
105 | __weak_alias(ktr_psig,nullop); | 105 | __weak_alias(ktr_psig,nullop); | |
106 | __weak_alias(ktr_saupcall,nullop); | 106 | __weak_alias(ktr_saupcall,nullop); | |
107 | __weak_alias(ktr_syscall,nullop); | 107 | __weak_alias(ktr_syscall,nullop); | |
108 | __weak_alias(ktr_sysret,nullop); | 108 | __weak_alias(ktr_sysret,nullop); | |
109 | __weak_alias(ktr_kuser,nullop); | 109 | __weak_alias(ktr_kuser,nullop); | |
110 | __weak_alias(ktr_mmsg,nullop); | |||
111 | __weak_alias(ktr_mib,nullop); | 110 | __weak_alias(ktr_mib,nullop); | |
112 | __weak_alias(ktr_mool,nullop); | |||
113 | __weak_alias(ktr_execarg,nullop); | 111 | __weak_alias(ktr_execarg,nullop); | |
114 | __weak_alias(ktr_execenv,nullop); | 112 | __weak_alias(ktr_execenv,nullop); | |
115 | 113 | |||
116 | __weak_alias(sys_fktrace,sys_nosys); /* Syscalls */ | 114 | __weak_alias(sys_fktrace,sys_nosys); /* Syscalls */ | |
117 | __weak_alias(sys_ktrace,sys_nosys); | 115 | __weak_alias(sys_ktrace,sys_nosys); | |
118 | __weak_alias(sys_utrace,sys_nosys); | 116 | __weak_alias(sys_utrace,sys_nosys); | |
119 | 117 | |||
120 | int ktrace_on; /* Misc */ | 118 | int ktrace_on; /* Misc */ | |
121 | __weak_alias(ktruser,enosys); | 119 | __weak_alias(ktruser,enosys); | |
122 | __weak_alias(ktr_point,nullop); | 120 | __weak_alias(ktr_point,nullop); | |
123 | #endif /* KTRACE */ | 121 | #endif /* KTRACE */ | |
124 | 122 | |||
125 | __weak_alias(device_register, voidop); | 123 | __weak_alias(device_register, voidop); |
--- src/sys/sys/ktrace.h 2009/01/11 02:45:55 1.56
+++ src/sys/sys/ktrace.h 2011/04/27 00:00:46 1.57
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ktrace.h,v 1.56 2009/01/11 02:45:55 christos Exp $ */ | 1 | /* $NetBSD: ktrace.h,v 1.57 2011/04/27 00:00:46 joerg Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1993 | 4 | * Copyright (c) 1988, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -180,62 +180,33 @@ struct ktr_csw { | @@ -180,62 +180,33 @@ struct ktr_csw { | |||
180 | * KTR_USER - user record | 180 | * KTR_USER - user record | |
181 | */ | 181 | */ | |
182 | #define KTR_USER 8 | 182 | #define KTR_USER 8 | |
183 | #define KTR_USER_MAXIDLEN 20 | 183 | #define KTR_USER_MAXIDLEN 20 | |
184 | #define KTR_USER_MAXLEN 2048 /* maximum length of passed data */ | 184 | #define KTR_USER_MAXLEN 2048 /* maximum length of passed data */ | |
185 | struct ktr_user { | 185 | struct ktr_user { | |
186 | char ktr_id[KTR_USER_MAXIDLEN]; /* string id of caller */ | 186 | char ktr_id[KTR_USER_MAXIDLEN]; /* string id of caller */ | |
187 | /* | 187 | /* | |
188 | * Followed by ktr_len - sizeof(struct ktr_user) of user data. | 188 | * Followed by ktr_len - sizeof(struct ktr_user) of user data. | |
189 | */ | 189 | */ | |
190 | }; | 190 | }; | |
191 | 191 | |||
192 | /* | 192 | /* | |
193 | * KTR_MMSG - Mach message | |||
194 | */ | |||
195 | #define KTR_MMSG 9 | |||
196 | struct ktr_mmsg { | |||
197 | /* | |||
198 | * This is a Mach message header | |||
199 | */ | |||
200 | int ktr_bits; | |||
201 | int ktr_size; | |||
202 | int ktr_remote_port; | |||
203 | int ktr_local_port; | |||
204 | int ktr_reserved; | |||
205 | int ktr_id; | |||
206 | /* | |||
207 | * Followed by ktr_size - sizeof(mach_msg_header_t) of message payload | |||
208 | */ | |||
209 | }; | |||
210 | ||||
211 | /* | |||
212 | * KTR_EXEC_ARG, KTR_EXEC_ENV - Arguments and environment from exec | 193 | * KTR_EXEC_ARG, KTR_EXEC_ENV - Arguments and environment from exec | |
213 | */ | 194 | */ | |
214 | #define KTR_EXEC_ARG 10 | 195 | #define KTR_EXEC_ARG 10 | |
215 | #define KTR_EXEC_ENV 11 | 196 | #define KTR_EXEC_ENV 11 | |
216 | /* record contains arg/env string */ | 197 | /* record contains arg/env string */ | |
217 | 198 | |||
218 | /* | 199 | /* | |
219 | * KTR_MOOL - Mach Out Of Line data | |||
220 | */ | |||
221 | #define KTR_MOOL 12 | |||
222 | struct ktr_mool { | |||
223 | const void *uaddr; /* User address */ | |||
224 | size_t size; /* Data len */ | |||
225 | /* Followed by size bytes of data */ | |||
226 | }; | |||
227 | ||||
228 | /* | |||
229 | * KTR_SAUPCALL - scheduler activated upcall. | 200 | * KTR_SAUPCALL - scheduler activated upcall. | |
230 | */ | 201 | */ | |
231 | #define KTR_SAUPCALL 13 | 202 | #define KTR_SAUPCALL 13 | |
232 | struct ktr_saupcall { | 203 | struct ktr_saupcall { | |
233 | int ktr_type; | 204 | int ktr_type; | |
234 | int ktr_nevent; | 205 | int ktr_nevent; | |
235 | int ktr_nint; | 206 | int ktr_nint; | |
236 | void *ktr_sas; | 207 | void *ktr_sas; | |
237 | void *ktr_ap; | 208 | void *ktr_ap; | |
238 | /* | 209 | /* | |
239 | * followed by nevent sa_t's from sas[] | 210 | * followed by nevent sa_t's from sas[] | |
240 | */ | 211 | */ | |
241 | }; | 212 | }; | |
@@ -249,30 +220,28 @@ struct ktr_saupcall { | @@ -249,30 +220,28 @@ struct ktr_saupcall { | |||
249 | 220 | |||
250 | /* | 221 | /* | |
251 | * kernel trace points (in p_traceflag) | 222 | * kernel trace points (in p_traceflag) | |
252 | */ | 223 | */ | |
253 | #define KTRFAC_MASK 0x00ffffff | 224 | #define KTRFAC_MASK 0x00ffffff | |
254 | #define KTRFAC_SYSCALL (1<<KTR_SYSCALL) | 225 | #define KTRFAC_SYSCALL (1<<KTR_SYSCALL) | |
255 | #define KTRFAC_SYSRET (1<<KTR_SYSRET) | 226 | #define KTRFAC_SYSRET (1<<KTR_SYSRET) | |
256 | #define KTRFAC_NAMEI (1<<KTR_NAMEI) | 227 | #define KTRFAC_NAMEI (1<<KTR_NAMEI) | |
257 | #define KTRFAC_GENIO (1<<KTR_GENIO) | 228 | #define KTRFAC_GENIO (1<<KTR_GENIO) | |
258 | #define KTRFAC_PSIG (1<<KTR_PSIG) | 229 | #define KTRFAC_PSIG (1<<KTR_PSIG) | |
259 | #define KTRFAC_CSW (1<<KTR_CSW) | 230 | #define KTRFAC_CSW (1<<KTR_CSW) | |
260 | #define KTRFAC_EMUL (1<<KTR_EMUL) | 231 | #define KTRFAC_EMUL (1<<KTR_EMUL) | |
261 | #define KTRFAC_USER (1<<KTR_USER) | 232 | #define KTRFAC_USER (1<<KTR_USER) | |
262 | #define KTRFAC_MMSG (1<<KTR_MMSG) | |||
263 | #define KTRFAC_EXEC_ARG (1<<KTR_EXEC_ARG) | 233 | #define KTRFAC_EXEC_ARG (1<<KTR_EXEC_ARG) | |
264 | #define KTRFAC_EXEC_ENV (1<<KTR_EXEC_ENV) | 234 | #define KTRFAC_EXEC_ENV (1<<KTR_EXEC_ENV) | |
265 | #define KTRFAC_MOOL (1<<KTR_MOOL) | |||
266 | #define KTRFAC_SAUPCALL (1<<KTR_SAUPCALL) | 235 | #define KTRFAC_SAUPCALL (1<<KTR_SAUPCALL) | |
267 | #define KTRFAC_MIB (1<<KTR_MIB) | 236 | #define KTRFAC_MIB (1<<KTR_MIB) | |
268 | /* | 237 | /* | |
269 | * trace flags (also in p_traceflags) | 238 | * trace flags (also in p_traceflags) | |
270 | */ | 239 | */ | |
271 | #define KTRFAC_PERSISTENT 0x80000000 /* persistent trace across sugid | 240 | #define KTRFAC_PERSISTENT 0x80000000 /* persistent trace across sugid | |
272 | exec (exclusive) */ | 241 | exec (exclusive) */ | |
273 | #define KTRFAC_INHERIT 0x40000000 /* pass trace flags to children */ | 242 | #define KTRFAC_INHERIT 0x40000000 /* pass trace flags to children */ | |
274 | #define KTRFAC_TRC_EMUL 0x10000000 /* ktrace KTR_EMUL before next trace */ | 243 | #define KTRFAC_TRC_EMUL 0x10000000 /* ktrace KTR_EMUL before next trace */ | |
275 | #define KTRFAC_VER_MASK 0x0f000000 /* record version mask */ | 244 | #define KTRFAC_VER_MASK 0x0f000000 /* record version mask */ | |
276 | #define KTRFAC_VER_SHIFT 24 /* record version shift */ | 245 | #define KTRFAC_VER_SHIFT 24 /* record version shift */ | |
277 | 246 | |||
278 | #define KTRFAC_VERSION(tf) (((tf) & KTRFAC_VER_MASK) >> KTRFAC_VER_SHIFT) | 247 | #define KTRFAC_VERSION(tf) (((tf) & KTRFAC_VER_MASK) >> KTRFAC_VER_SHIFT) | |
@@ -304,29 +273,27 @@ int ktruser(const char *, void *, size_t | @@ -304,29 +273,27 @@ int ktruser(const char *, void *, size_t | |||
304 | bool ktr_point(int); | 273 | bool ktr_point(int); | |
305 | 274 | |||
306 | void ktr_csw(int, int); | 275 | void ktr_csw(int, int); | |
307 | void ktr_emul(void); | 276 | void ktr_emul(void); | |
308 | void ktr_geniov(int, enum uio_rw, struct iovec *, size_t, int); | 277 | void ktr_geniov(int, enum uio_rw, struct iovec *, size_t, int); | |
309 | void ktr_genio(int, enum uio_rw, const void *, size_t, int); | 278 | void ktr_genio(int, enum uio_rw, const void *, size_t, int); | |
310 | void ktr_mibio(int, enum uio_rw, const void *, size_t, int); | 279 | void ktr_mibio(int, enum uio_rw, const void *, size_t, int); | |
311 | void ktr_namei(const char *, size_t); | 280 | void ktr_namei(const char *, size_t); | |
312 | void ktr_namei2(const char *, size_t, const char *, size_t); | 281 | void ktr_namei2(const char *, size_t, const char *, size_t); | |
313 | void ktr_psig(int, sig_t, const sigset_t *, const ksiginfo_t *); | 282 | void ktr_psig(int, sig_t, const sigset_t *, const ksiginfo_t *); | |
314 | void ktr_syscall(register_t, const register_t [], int); | 283 | void ktr_syscall(register_t, const register_t [], int); | |
315 | void ktr_sysret(register_t, int, register_t *); | 284 | void ktr_sysret(register_t, int, register_t *); | |
316 | void ktr_kuser(const char *, void *, size_t); | 285 | void ktr_kuser(const char *, void *, size_t); | |
317 | void ktr_mmsg(const void *, size_t); | |||
318 | void ktr_mib(const int *a , u_int b); | 286 | void ktr_mib(const int *a , u_int b); | |
319 | void ktr_mool(const void *, size_t, const void *); | |||
320 | void ktr_execarg(const void *, size_t); | 287 | void ktr_execarg(const void *, size_t); | |
321 | void ktr_execenv(const void *, size_t); | 288 | void ktr_execenv(const void *, size_t); | |
322 | void ktr_saupcall(struct lwp *, int, int, int, void *, void *, void *); | 289 | void ktr_saupcall(struct lwp *, int, int, int, void *, void *, void *); | |
323 | 290 | |||
324 | static inline bool | 291 | static inline bool | |
325 | ktrpoint(int fac) | 292 | ktrpoint(int fac) | |
326 | { | 293 | { | |
327 | return __predict_false(ktrace_on) && __predict_false(ktr_point(1 << fac)); | 294 | return __predict_false(ktrace_on) && __predict_false(ktr_point(1 << fac)); | |
328 | } | 295 | } | |
329 | 296 | |||
330 | static inline void | 297 | static inline void | |
331 | ktrcsw(int a, int b) | 298 | ktrcsw(int a, int b) | |
332 | { | 299 | { | |
@@ -395,47 +362,33 @@ ktrsysret(register_t a, int b, register_ | @@ -395,47 +362,33 @@ ktrsysret(register_t a, int b, register_ | |||
395 | { | 362 | { | |
396 | if (__predict_false(ktrace_on)) | 363 | if (__predict_false(ktrace_on)) | |
397 | ktr_sysret(a, b, c); | 364 | ktr_sysret(a, b, c); | |
398 | } | 365 | } | |
399 | 366 | |||
400 | static inline void | 367 | static inline void | |
401 | ktrkuser(const char *a, void *b, size_t c) | 368 | ktrkuser(const char *a, void *b, size_t c) | |
402 | { | 369 | { | |
403 | if (__predict_false(ktrace_on)) | 370 | if (__predict_false(ktrace_on)) | |
404 | ktr_kuser(a, b, c); | 371 | ktr_kuser(a, b, c); | |
405 | } | 372 | } | |
406 | 373 | |||
407 | static inline void | 374 | static inline void | |
408 | ktrmmsg(const void *a, size_t b) | |||
409 | { | |||
410 | if (__predict_false(ktrace_on)) | |||
411 | ktr_mmsg(a, b); | |||
412 | } | |||
413 | ||||
414 | static inline void | |||
415 | ktrmib(const int *a , u_int b) | 375 | ktrmib(const int *a , u_int b) | |
416 | { | 376 | { | |
417 | if (__predict_false(ktrace_on)) | 377 | if (__predict_false(ktrace_on)) | |
418 | ktr_mib(a, b); | 378 | ktr_mib(a, b); | |
419 | } | 379 | } | |
420 | 380 | |||
421 | static inline void | 381 | static inline void | |
422 | ktrmool(const void *a, size_t b, const void *c) | |||
423 | { | |||
424 | if (__predict_false(ktrace_on)) | |||
425 | ktr_mool(a, b, c); | |||
426 | } | |||
427 | ||||
428 | static inline void | |||
429 | ktrexecarg(const void *a, size_t b) | 382 | ktrexecarg(const void *a, size_t b) | |
430 | { | 383 | { | |
431 | if (__predict_false(ktrace_on)) | 384 | if (__predict_false(ktrace_on)) | |
432 | ktr_execarg(a, b); | 385 | ktr_execarg(a, b); | |
433 | } | 386 | } | |
434 | 387 | |||
435 | static inline void | 388 | static inline void | |
436 | ktrexecenv(const void *a, size_t b) | 389 | ktrexecenv(const void *a, size_t b) | |
437 | { | 390 | { | |
438 | if (__predict_false(ktrace_on)) | 391 | if (__predict_false(ktrace_on)) | |
439 | ktr_execenv(a, b); | 392 | ktr_execenv(a, b); | |
440 | } | 393 | } | |
441 | 394 |
--- src/usr.bin/kdump/kdump.c 2011/04/26 15:51:32 1.110
+++ src/usr.bin/kdump/kdump.c 2011/04/27 00:00:47 1.111
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kdump.c,v 1.110 2011/04/26 15:51:32 joerg Exp $ */ | 1 | /* $NetBSD: kdump.c,v 1.111 2011/04/27 00:00:47 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1988, 1993 | 4 | * Copyright (c) 1988, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -29,27 +29,27 @@ | @@ -29,27 +29,27 @@ | |||
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | __COPYRIGHT("@(#) Copyright (c) 1988, 1993\ | 34 | __COPYRIGHT("@(#) Copyright (c) 1988, 1993\ | |
35 | The Regents of the University of California. All rights reserved."); | 35 | The Regents of the University of California. All rights reserved."); | |
36 | #endif /* not lint */ | 36 | #endif /* not lint */ | |
37 | 37 | |||
38 | #ifndef lint | 38 | #ifndef lint | |
39 | #if 0 | 39 | #if 0 | |
40 | static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; | 40 | static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; | |
41 | #else | 41 | #else | |
42 | __RCSID("$NetBSD: kdump.c,v 1.110 2011/04/26 15:51:32 joerg Exp $"); | 42 | __RCSID("$NetBSD: kdump.c,v 1.111 2011/04/27 00:00:47 joerg Exp $"); | |
43 | #endif | 43 | #endif | |
44 | #endif /* not lint */ | 44 | #endif /* not lint */ | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #define _KERNEL | 47 | #define _KERNEL | |
48 | #include <sys/errno.h> | 48 | #include <sys/errno.h> | |
49 | #undef _KERNEL | 49 | #undef _KERNEL | |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> | |
51 | #include <sys/uio.h> | 51 | #include <sys/uio.h> | |
52 | #include <sys/ktrace.h> | 52 | #include <sys/ktrace.h> | |
53 | #include <sys/ioctl.h> | 53 | #include <sys/ioctl.h> | |
54 | #include <sys/ptrace.h> | 54 | #include <sys/ptrace.h> | |
55 | 55 | |||
@@ -104,28 +104,26 @@ static const char * const linux_ptrace_o | @@ -104,28 +104,26 @@ static const char * const linux_ptrace_o | |||
104 | int main(int, char **); | 104 | int main(int, char **); | |
105 | static int fread_tail(void *, size_t, size_t); | 105 | static int fread_tail(void *, size_t, size_t); | |
106 | static int dumpheader(struct ktr_header *); | 106 | static int dumpheader(struct ktr_header *); | |
107 | static void output_long(u_long, int); | 107 | static void output_long(u_long, int); | |
108 | static void ioctldecode(u_long); | 108 | static void ioctldecode(u_long); | |
109 | static void ktrsyscall(struct ktr_syscall *); | 109 | static void ktrsyscall(struct ktr_syscall *); | |
110 | static void ktrsysret(struct ktr_sysret *, int); | 110 | static void ktrsysret(struct ktr_sysret *, int); | |
111 | static void ktrnamei(char *, int); | 111 | static void ktrnamei(char *, int); | |
112 | static void ktremul(char *, int, int); | 112 | static void ktremul(char *, int, int); | |
113 | static void ktrgenio(struct ktr_genio *, int); | 113 | static void ktrgenio(struct ktr_genio *, int); | |
114 | static void ktrpsig(void *, int); | 114 | static void ktrpsig(void *, int); | |
115 | static void ktrcsw(struct ktr_csw *); | 115 | static void ktrcsw(struct ktr_csw *); | |
116 | static void ktruser(struct ktr_user *, int); | 116 | static void ktruser(struct ktr_user *, int); | |
117 | static void ktrmmsg(struct ktr_mmsg *, int); | |||
118 | static void ktrmool(struct ktr_mool *, int); | |||
119 | static void ktrmib(int *, int); | 117 | static void ktrmib(int *, int); | |
120 | static void usage(void) __dead; | 118 | static void usage(void) __dead; | |
121 | static void eprint(int); | 119 | static void eprint(int); | |
122 | static void rprint(register_t); | 120 | static void rprint(register_t); | |
123 | static const char *signame(long, int); | 121 | static const char *signame(long, int); | |
124 | static void hexdump_buf(const void *, int, int); | 122 | static void hexdump_buf(const void *, int, int); | |
125 | static void visdump_buf(const void *, int, int); | 123 | static void visdump_buf(const void *, int, int); | |
126 | 124 | |||
127 | int | 125 | int | |
128 | main(int argc, char **argv) | 126 | main(int argc, char **argv) | |
129 | { | 127 | { | |
130 | int ch, ktrlen, size; | 128 | int ch, ktrlen, size; | |
131 | void *m; | 129 | void *m; | |
@@ -282,32 +280,26 @@ main(int argc, char **argv) | @@ -282,32 +280,26 @@ main(int argc, char **argv) | |||
282 | break; | 280 | break; | |
283 | case KTR_PSIG: | 281 | case KTR_PSIG: | |
284 | ktrpsig(m, ktrlen); | 282 | ktrpsig(m, ktrlen); | |
285 | break; | 283 | break; | |
286 | case KTR_CSW: | 284 | case KTR_CSW: | |
287 | ktrcsw(m); | 285 | ktrcsw(m); | |
288 | break; | 286 | break; | |
289 | case KTR_EMUL: | 287 | case KTR_EMUL: | |
290 | ktremul(m, ktrlen, size); | 288 | ktremul(m, ktrlen, size); | |
291 | break; | 289 | break; | |
292 | case KTR_USER: | 290 | case KTR_USER: | |
293 | ktruser(m, ktrlen); | 291 | ktruser(m, ktrlen); | |
294 | break; | 292 | break; | |
295 | case KTR_MMSG: | |||
296 | ktrmmsg(m, ktrlen); | |||
297 | break; | |||
298 | case KTR_MOOL: | |||
299 | ktrmool(m, ktrlen); | |||
300 | break; | |||
301 | case KTR_EXEC_ARG: | 293 | case KTR_EXEC_ARG: | |
302 | case KTR_EXEC_ENV: | 294 | case KTR_EXEC_ENV: | |
303 | visdump_buf(m, ktrlen, col); | 295 | visdump_buf(m, ktrlen, col); | |
304 | break; | 296 | break; | |
305 | case KTR_MIB: | 297 | case KTR_MIB: | |
306 | ktrmib(m, ktrlen); | 298 | ktrmib(m, ktrlen); | |
307 | break; | 299 | break; | |
308 | default: | 300 | default: | |
309 | putchar('\n'); | 301 | putchar('\n'); | |
310 | hexdump_buf(m, ktrlen, word_size ? word_size : 1); | 302 | hexdump_buf(m, ktrlen, word_size ? word_size : 1); | |
311 | } | 303 | } | |
312 | if (tail) | 304 | if (tail) | |
313 | (void)fflush(stdout); | 305 | (void)fflush(stdout); | |
@@ -355,32 +347,26 @@ dumpheader(struct ktr_header *kth) | @@ -355,32 +347,26 @@ dumpheader(struct ktr_header *kth) | |||
355 | break; | 347 | break; | |
356 | case KTR_PSIG: | 348 | case KTR_PSIG: | |
357 | type = "PSIG"; | 349 | type = "PSIG"; | |
358 | break; | 350 | break; | |
359 | case KTR_CSW: | 351 | case KTR_CSW: | |
360 | type = "CSW "; | 352 | type = "CSW "; | |
361 | break; | 353 | break; | |
362 | case KTR_EMUL: | 354 | case KTR_EMUL: | |
363 | type = "EMUL"; | 355 | type = "EMUL"; | |
364 | break; | 356 | break; | |
365 | case KTR_USER: | 357 | case KTR_USER: | |
366 | type = "MISC"; | 358 | type = "MISC"; | |
367 | break; | 359 | break; | |
368 | case KTR_MMSG: | |||
369 | type = "MMSG"; | |||
370 | break; | |||
371 | case KTR_MOOL: | |||
372 | type = "MOOL"; | |||
373 | break; | |||
374 | case KTR_EXEC_ENV: | 360 | case KTR_EXEC_ENV: | |
375 | type = "ENV"; | 361 | type = "ENV"; | |
376 | break; | 362 | break; | |
377 | case KTR_EXEC_ARG: | 363 | case KTR_EXEC_ARG: | |
378 | type = "ARG"; | 364 | type = "ARG"; | |
379 | break; | 365 | break; | |
380 | case KTR_SAUPCALL: | 366 | case KTR_SAUPCALL: | |
381 | type = "SAU"; | 367 | type = "SAU"; | |
382 | break; | 368 | break; | |
383 | case KTR_MIB: | 369 | case KTR_MIB: | |
384 | type = "MIB"; | 370 | type = "MIB"; | |
385 | break; | 371 | break; | |
386 | default: | 372 | default: | |
@@ -1020,56 +1006,26 @@ ktruser(struct ktr_user *usr, int len) | @@ -1020,56 +1006,26 @@ ktruser(struct ktr_user *usr, int len) | |||
1020 | dta = (unsigned char *)(usr + 1); | 1006 | dta = (unsigned char *)(usr + 1); | |
1021 | if (word_size) { | 1007 | if (word_size) { | |
1022 | printf("\n"); | 1008 | printf("\n"); | |
1023 | hexdump_buf(dta, len, word_size); | 1009 | hexdump_buf(dta, len, word_size); | |
1024 | return; | 1010 | return; | |
1025 | } | 1011 | } | |
1026 | printf(" %d, ", len); | 1012 | printf(" %d, ", len); | |
1027 | for (i = 0; i < len; i++) | 1013 | for (i = 0; i < len; i++) | |
1028 | printf("%02x", (unsigned int) dta[i]); | 1014 | printf("%02x", (unsigned int) dta[i]); | |
1029 | printf("\n"); | 1015 | printf("\n"); | |
1030 | } | 1016 | } | |
1031 | 1017 | |||
1032 | static void | 1018 | static void | |
1033 | ktrmmsg(struct ktr_mmsg *mmsg, int len) | |||
1034 | { | |||
1035 | const char *reply; | |||
1036 | int id; | |||
1037 | ||||
1038 | id = mmsg->ktr_id; | |||
1039 | if ((id / 100) % 2) { /* Message reply */ | |||
1040 | reply = " reply"; | |||
1041 | id -= 100; | |||
1042 | } else { | |||
1043 | reply = ""; | |||
1044 | } | |||
1045 | ||||
1046 | printf("unknown service%s [%d]\n", reply, mmsg->ktr_id); | |||
1047 | ||||
1048 | hexdump_buf(mmsg, len, word_size ? word_size : 4); | |||
1049 | } | |||
1050 | ||||
1051 | static void | |||
1052 | ktrmool(struct ktr_mool *mool, int len) | |||
1053 | { | |||
1054 | size_t size = mool->size; | |||
1055 | ||||
1056 | printf("%ld/0x%lx bytes at %p\n", | |||
1057 | (u_long)size, (u_long)size, mool->uaddr); | |||
1058 | mool++; | |||
1059 | hexdump_buf(mool, size, word_size ? word_size : 4); | |||
1060 | } | |||
1061 | ||||
1062 | static void | |||
1063 | ktrmib(int *namep, int len) | 1019 | ktrmib(int *namep, int len) | |
1064 | { | 1020 | { | |
1065 | size_t i; | 1021 | size_t i; | |
1066 | 1022 | |||
1067 | for (i = 0; i < (len / sizeof(*namep)); i++) | 1023 | for (i = 0; i < (len / sizeof(*namep)); i++) | |
1068 | printf("%s%d", (i == 0) ? "" : ".", namep[i]); | 1024 | printf("%s%d", (i == 0) ? "" : ".", namep[i]); | |
1069 | printf("\n"); | 1025 | printf("\n"); | |
1070 | } | 1026 | } | |
1071 | 1027 | |||
1072 | static const char * | 1028 | static const char * | |
1073 | signame(long sig, int xlat) | 1029 | signame(long sig, int xlat) | |
1074 | { | 1030 | { | |
1075 | static char buf[64]; | 1031 | static char buf[64]; |
--- src/usr.bin/ktrace/ktrace.1 2007/08/27 16:35:47 1.39
+++ src/usr.bin/ktrace/ktrace.1 2011/04/27 00:00:47 1.40
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: ktrace.1,v 1.39 2007/08/27 16:35:47 dsl Exp $ | 1 | .\" $NetBSD: ktrace.1,v 1.40 2011/04/27 00:00:47 joerg Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 1990, 1993 | 3 | .\" Copyright (c) 1990, 1993 | |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | 6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | 7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | 8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | 9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | 10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | 12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | 13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" 3. Neither the name of the University nor the names of its contributors | 14 | .\" 3. Neither the name of the University nor the names of its contributors | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
28 | .\" SUCH DAMAGE. | 28 | .\" SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 | 30 | .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 | |
31 | .\" | 31 | .\" | |
32 | .Dd August 27, 2007 | 32 | .Dd April 27, 2011 | |
33 | .Dt KTRACE 1 | 33 | .Dt KTRACE 1 | |
34 | .Os | 34 | .Os | |
35 | .Sh NAME | 35 | .Sh NAME | |
36 | .Nm ktrace , ktruss | 36 | .Nm ktrace , ktruss | |
37 | .Nd enable kernel process tracing | 37 | .Nd enable kernel process tracing | |
38 | .Sh SYNOPSIS | 38 | .Sh SYNOPSIS | |
39 | .Nm | 39 | .Nm | |
40 | .Op Fl aCcdins | 40 | .Op Fl aCcdins | |
41 | .Op Fl f Ar trfile | 41 | .Op Fl f Ar trfile | |
42 | .Op Fl g Ar pgrp | 42 | .Op Fl g Ar pgrp | |
43 | .Op Fl p Ar pid | 43 | .Op Fl p Ar pid | |
44 | .Op Fl t Ar trstr | 44 | .Op Fl t Ar trstr | |
45 | .Nm | 45 | .Nm | |
@@ -174,32 +174,26 @@ The following table equates the letters | @@ -174,32 +174,26 @@ The following table equates the letters | |||
174 | .Pp | 174 | .Pp | |
175 | .Bl -tag -width flag -compact | 175 | .Bl -tag -width flag -compact | |
176 | .It Cm A | 176 | .It Cm A | |
177 | trace all tracepoints | 177 | trace all tracepoints | |
178 | .It Cm a | 178 | .It Cm a | |
179 | trace exec arguments | 179 | trace exec arguments | |
180 | .It Cm c | 180 | .It Cm c | |
181 | trace system calls | 181 | trace system calls | |
182 | .It Cm e | 182 | .It Cm e | |
183 | trace emulation changes | 183 | trace emulation changes | |
184 | .It Cm i | 184 | .It Cm i | |
185 | trace | 185 | trace | |
186 | .Tn I/O | 186 | .Tn I/O | |
187 | .It Cm l | |||
188 | trace Mach out of line data when running Mach binaries with COMPAT_MACH | |||
189 | (currently limited to i386 and powerpc ports). | |||
190 | .It Cm m | |||
191 | trace Mach messages when running Mach binaries with COMPAT_MACH | |||
192 | (currently limited to i386 and powerpc ports). | |||
193 | .It Cm n | 187 | .It Cm n | |
194 | trace namei translations | 188 | trace namei translations | |
195 | .It Cm S | 189 | .It Cm S | |
196 | trace MIB access (sysctl) | 190 | trace MIB access (sysctl) | |
197 | .It Cm s | 191 | .It Cm s | |
198 | trace signal processing | 192 | trace signal processing | |
199 | .\" .It Cm U | 193 | .\" .It Cm U | |
200 | .\" trace scheduler activations upcall data | 194 | .\" trace scheduler activations upcall data | |
201 | .It Cm u | 195 | .It Cm u | |
202 | trace user data | 196 | trace user data | |
203 | .It Cm v | 197 | .It Cm v | |
204 | trace exec environment | 198 | trace exec environment | |
205 | .It Cm w | 199 | .It Cm w |
--- src/usr.bin/ktrace/ktrace.h 2008/02/16 07:19:23 1.19
+++ src/usr.bin/ktrace/ktrace.h 2011/04/27 00:00:47 1.20
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ktrace.h,v 1.19 2008/02/16 07:19:23 matt Exp $ */ | 1 | /* $NetBSD: ktrace.h,v 1.20 2011/04/27 00:00:47 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1988, 1993 | 4 | * Copyright (c) 1988, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -22,26 +22,25 @@ | @@ -22,26 +22,25 @@ | |||
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | * | 30 | * | |
31 | * @(#)ktrace.h 8.1 (Berkeley) 6/6/93 | 31 | * @(#)ktrace.h 8.1 (Berkeley) 6/6/93 | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | #define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \ | 34 | #define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \ | |
35 | KTRFAC_GENIO | KTRFAC_PSIG | KTRFAC_EMUL | KTRFAC_USER | \ | 35 | KTRFAC_GENIO | KTRFAC_PSIG | KTRFAC_EMUL | KTRFAC_USER) | |
36 | KTRFAC_MMSG | KTRFAC_MOOL) | |||
37 | 36 | |||
38 | #define ALL_POINTS KTRFAC_MASK | 37 | #define ALL_POINTS KTRFAC_MASK | |
39 | 38 | |||
40 | #define DEF_TRACEFILE "ktrace.out" | 39 | #define DEF_TRACEFILE "ktrace.out" | |
41 | 40 | |||
42 | #include <sys/cdefs.h> | 41 | #include <sys/cdefs.h> | |
43 | 42 | |||
44 | int getpoints(int, char *); | 43 | int getpoints(int, char *); | |
45 | const char *ioctlname(u_long); | 44 | const char *ioctlname(u_long); | |
46 | const char *siginfocodename(int, int); | 45 | const char *siginfocodename(int, int); | |
47 | void dumpfile(const char *, int, int); | 46 | void dumpfile(const char *, int, int); |
--- src/usr.bin/ktrace/subr.c 2007/02/09 22:08:49 1.16
+++ src/usr.bin/ktrace/subr.c 2011/04/27 00:00:47 1.17
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: subr.c,v 1.16 2007/02/09 22:08:49 ad Exp $ */ | 1 | /* $NetBSD: subr.c,v 1.17 2011/04/27 00:00:47 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1988, 1993 | 4 | * Copyright (c) 1988, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "@(#)subr.c 8.2 (Berkeley) 4/28/95"; | 35 | static char sccsid[] = "@(#)subr.c 8.2 (Berkeley) 4/28/95"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: subr.c,v 1.16 2007/02/09 22:08:49 ad Exp $"); | 37 | __RCSID("$NetBSD: subr.c,v 1.17 2011/04/27 00:00:47 joerg Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/time.h> | 42 | #include <sys/time.h> | |
43 | #include <sys/uio.h> | 43 | #include <sys/uio.h> | |
44 | #include <sys/ktrace.h> | 44 | #include <sys/ktrace.h> | |
45 | 45 | |||
46 | #include <stdio.h> | 46 | #include <stdio.h> | |
47 | 47 | |||
48 | #include "ktrace.h" | 48 | #include "ktrace.h" | |
49 | 49 | |||
50 | int | 50 | int | |
@@ -69,32 +69,26 @@ getpoints(int facs, char *s) | @@ -69,32 +69,26 @@ getpoints(int facs, char *s) | |||
69 | break; | 69 | break; | |
70 | case 'c': | 70 | case 'c': | |
71 | fac = KTRFAC_SYSCALL | KTRFAC_SYSRET; | 71 | fac = KTRFAC_SYSCALL | KTRFAC_SYSRET; | |
72 | break; | 72 | break; | |
73 | case 'e': | 73 | case 'e': | |
74 | fac = KTRFAC_EMUL; | 74 | fac = KTRFAC_EMUL; | |
75 | break; | 75 | break; | |
76 | case 'i': | 76 | case 'i': | |
77 | fac = KTRFAC_GENIO; | 77 | fac = KTRFAC_GENIO; | |
78 | break; | 78 | break; | |
79 | case 'n': | 79 | case 'n': | |
80 | fac = KTRFAC_NAMEI; | 80 | fac = KTRFAC_NAMEI; | |
81 | break; | 81 | break; | |
82 | case 'm': | |||
83 | fac = KTRFAC_MMSG; | |||
84 | break; | |||
85 | case 'l': | |||
86 | fac = KTRFAC_MOOL; | |||
87 | break; | |||
88 | case 's': | 82 | case 's': | |
89 | fac = KTRFAC_PSIG; | 83 | fac = KTRFAC_PSIG; | |
90 | break; | 84 | break; | |
91 | case 'u': | 85 | case 'u': | |
92 | fac = KTRFAC_USER; | 86 | fac = KTRFAC_USER; | |
93 | break; | 87 | break; | |
94 | case 'S': | 88 | case 'S': | |
95 | fac = KTRFAC_MIB; | 89 | fac = KTRFAC_MIB; | |
96 | break; | 90 | break; | |
97 | case 'v': | 91 | case 'v': | |
98 | fac = KTRFAC_EXEC_ENV; | 92 | fac = KTRFAC_EXEC_ENV; | |
99 | break; | 93 | break; | |
100 | case 'w': | 94 | case 'w': |