Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/ktrace.h
| Show All 26 Lines | |||||||||
| * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||||||
| * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||||||
| * SUCH DAMAGE. | * SUCH DAMAGE. | ||||||||
| */ | */ | ||||||||
| #ifndef _SYS_KTRACE_H_ | #ifndef _SYS_KTRACE_H_ | ||||||||
| #define _SYS_KTRACE_H_ | #define _SYS_KTRACE_H_ | ||||||||
| #include <sys/param.h> | |||||||||
| #include <sys/caprights.h> | #include <sys/caprights.h> | ||||||||
| #include <sys/signal.h> | #include <sys/signal.h> | ||||||||
| #include <sys/socket.h> | |||||||||
| #include <sys/_uio.h> | #include <sys/_uio.h> | ||||||||
| /* | /* | ||||||||
| * operations to ktrace system call (KTROP(op)) | * operations to ktrace system call (KTROP(op)) | ||||||||
| */ | */ | ||||||||
| #define KTROP_SET 0 /* set trace points */ | #define KTROP_SET 0 /* set trace points */ | ||||||||
| #define KTROP_CLEAR 1 /* clear trace points */ | #define KTROP_CLEAR 1 /* clear trace points */ | ||||||||
| #define KTROP_CLEARFILE 2 /* stop all tracing to file */ | #define KTROP_CLEARFILE 2 /* stop all tracing to file */ | ||||||||
| ▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | |||||||||
| * KTR_PROCDTOR - trace process destruction (multiple ABI support) | * KTR_PROCDTOR - trace process destruction (multiple ABI support) | ||||||||
| */ | */ | ||||||||
| #define KTR_PROCDTOR 11 | #define KTR_PROCDTOR 11 | ||||||||
| /* | /* | ||||||||
| * KTR_CAPFAIL - trace capability check failures | * KTR_CAPFAIL - trace capability check failures | ||||||||
| */ | */ | ||||||||
| #define KTR_CAPFAIL 12 | #define KTR_CAPFAIL 12 | ||||||||
| enum ktr_cap_fail_type { | enum ktr_cap_violation { | ||||||||
| CAPFAIL_NOTCAPABLE, /* insufficient capabilities in cap_check() */ | CAPFAIL_NOTCAPABLE, /* insufficient capabilities in cap_check() */ | ||||||||
| CAPFAIL_INCREASE, /* attempt to increase capabilities */ | CAPFAIL_INCREASE, /* attempt to increase rights on a capability */ | ||||||||
markjUnsubmitted Done Inline Actions
markj: | |||||||||
| CAPFAIL_SYSCALL, /* disallowed system call */ | CAPFAIL_SYSCALL, /* disallowed system call */ | ||||||||
| CAPFAIL_LOOKUP, /* disallowed VFS lookup */ | CAPFAIL_SIGNAL, /* sent signal to process other than self */ | ||||||||
| CAPFAIL_PROTO, /* disallowed protocol */ | |||||||||
| CAPFAIL_SOCKADDR, /* restricted address lookup */ | |||||||||
| CAPFAIL_NAMEI, /* restricted namei lookup */ | |||||||||
Done Inline ActionsIMO, CAPFAIL_NAMEI would be a better name for this. markj: IMO, CAPFAIL_NAMEI would be a better name for this. | |||||||||
| CAPFAIL_CPUSET, /* restricted CPU set modification */ | |||||||||
| }; | }; | ||||||||
Done Inline ActionsMissing newlines between the type definitions. markj: Missing newlines between the type definitions. | |||||||||
| union ktr_cap_data { | |||||||||
| cap_rights_t cap_rights[2]; | |||||||||
| #define cap_needed cap_rights[0] | |||||||||
| #define cap_held cap_rights[1] | |||||||||
| int cap_int; | |||||||||
| struct sockaddr cap_sockaddr; | |||||||||
Done Inline ActionsThis can be PATH_MAX instead, in which case you can pull in syslimits.h instead of the much larger param.h. markj: This can be PATH_MAX instead, in which case you can pull in syslimits.h instead of the much… | |||||||||
Done Inline Actions
Other macros in this file depend on <sys/param>, so if we are trying to make headers independent, then we already have to include it. jfree: > This can be PATH_MAX instead, in which case you can pull in syslimits.h instead of the much… | |||||||||
| char cap_path[MAXPATHLEN]; | |||||||||
| }; | |||||||||
| struct ktr_cap_fail { | struct ktr_cap_fail { | ||||||||
| enum ktr_cap_fail_type cap_type; | enum ktr_cap_violation cap_type; | ||||||||
| cap_rights_t cap_needed; | short cap_code; | ||||||||
| cap_rights_t cap_held; | u_int cap_svflags; | ||||||||
| union ktr_cap_data cap_data; | |||||||||
| }; | }; | ||||||||
| /* | /* | ||||||||
| * KTR_FAULT - page fault record | * KTR_FAULT - page fault record | ||||||||
| */ | */ | ||||||||
| #define KTR_FAULT 13 | #define KTR_FAULT 13 | ||||||||
| struct ktr_fault { | struct ktr_fault { | ||||||||
| vm_offset_t vaddr; | vm_offset_t vaddr; | ||||||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||||||
| void ktrprocctor(struct proc *); | void ktrprocctor(struct proc *); | ||||||||
| struct ktr_io_params *ktrprocexec(struct proc *); | struct ktr_io_params *ktrprocexec(struct proc *); | ||||||||
| void ktrprocexit(struct thread *); | void ktrprocexit(struct thread *); | ||||||||
| void ktrprocfork(struct proc *, struct proc *); | void ktrprocfork(struct proc *, struct proc *); | ||||||||
| void ktruserret(struct thread *); | void ktruserret(struct thread *); | ||||||||
| void ktrstruct(const char *, const void *, size_t); | void ktrstruct(const char *, const void *, size_t); | ||||||||
| void ktrstruct_error(const char *, const void *, size_t, int); | void ktrstruct_error(const char *, const void *, size_t, int); | ||||||||
| void ktrstructarray(const char *, enum uio_seg, const void *, int, size_t); | void ktrstructarray(const char *, enum uio_seg, const void *, int, size_t); | ||||||||
| void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, | void ktrcapfail(enum ktr_cap_violation, const void *); | ||||||||
| const cap_rights_t *); | |||||||||
| #define ktrcaprights(s) \ | #define ktrcaprights(s) \ | ||||||||
| ktrstruct("caprights", (s), sizeof(cap_rights_t)) | ktrstruct("caprights", (s), sizeof(cap_rights_t)) | ||||||||
| #define ktritimerval(s) \ | #define ktritimerval(s) \ | ||||||||
| ktrstruct("itimerval", (s), sizeof(struct itimerval)) | ktrstruct("itimerval", (s), sizeof(struct itimerval)) | ||||||||
| #define ktrsockaddr(s) \ | #define ktrsockaddr(s) \ | ||||||||
| ktrstruct("sockaddr", (s), ((struct sockaddr *)(s))->sa_len) | ktrstruct("sockaddr", (s), ((struct sockaddr *)(s))->sa_len) | ||||||||
| #define ktrstat(s) \ | #define ktrstat(s) \ | ||||||||
| ktrstruct("stat", (s), sizeof(struct stat)) | ktrstruct("stat", (s), sizeof(struct stat)) | ||||||||
| Show All 24 Lines | |||||||||