Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/ktrace.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* flags (ORed in with operation) | * flags (ORed in with operation) | ||||
*/ | */ | ||||
#define KTRFLAG_DESCEND 4 /* perform op on all children too */ | #define KTRFLAG_DESCEND 4 /* perform op on all children too */ | ||||
/* | /* | ||||
* ktrace record header | * ktrace record header | ||||
*/ | */ | ||||
struct ktr_header { | struct ktr_header_v0 { | ||||
int ktr_len; /* length of buf */ | int ktr_len; /* length of buf */ | ||||
short ktr_type; /* trace record type */ | short ktr_type; /* trace record type */ | ||||
pid_t ktr_pid; /* process id */ | pid_t ktr_pid; /* process id */ | ||||
char ktr_comm[MAXCOMLEN + 1];/* command name */ | char ktr_comm[MAXCOMLEN + 1];/* command name */ | ||||
struct timeval ktr_time; /* timestamp */ | struct timeval ktr_time; /* timestamp */ | ||||
intptr_t ktr_tid; /* was ktr_buffer */ | intptr_t ktr_tid; /* was ktr_buffer */ | ||||
}; | }; | ||||
struct ktr_header { | |||||
int ktr_len; /* length of buf */ | |||||
short ktr_type; /* trace record type */ | |||||
short ktr_version; /* ktr_header version */ | |||||
pid_t ktr_pid; /* process id */ | |||||
char ktr_comm[MAXCOMLEN + 1];/* command name */ | |||||
struct timespec ktr_time; /* timestamp */ | |||||
intptr_t ktr_tid; /* thread id */ | |||||
int ktr_cpu; /* cpu id */ | |||||
}; | |||||
#define KTR_VERSION0 0 | |||||
#define KTR_VERSION1 1 | |||||
#define KTR_OFFSET_V0 sizeof(struct ktr_header_v0) - \ | |||||
sizeof(struct ktr_header) | |||||
/* | /* | ||||
* Test for kernel trace point (MP SAFE). | * Test for kernel trace point (MP SAFE). | ||||
* | * | ||||
* KTRCHECK() just checks that the type is enabled and is only for | * KTRCHECK() just checks that the type is enabled and is only for | ||||
* internal use in the ktrace subsystem. KTRPOINT() checks against | * internal use in the ktrace subsystem. KTRPOINT() checks against | ||||
* ktrace recursion as well as checking that the type is enabled and | * ktrace recursion as well as checking that the type is enabled and | ||||
* is the public interface. | * is the public interface. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | struct ktr_struct_array { | ||||
*/ | */ | ||||
}; | }; | ||||
/* | /* | ||||
* KTR_DROP - If this bit is set in ktr_type, then at least one event | * KTR_DROP - If this bit is set in ktr_type, then at least one event | ||||
* between the previous record and this record was dropped. | * between the previous record and this record was dropped. | ||||
*/ | */ | ||||
#define KTR_DROP 0x8000 | #define KTR_DROP 0x8000 | ||||
#define KTR_NEW 0x4000 | |||||
rpokala: `KTR_NEW` is rather vague, and needs to be commented like `KTR_DROP` is. | |||||
#define KTR_TYPE (KTR_DROP | KTR_NEW) | |||||
/* | /* | ||||
* kernel trace points (in p_traceflag) | * kernel trace points (in p_traceflag) | ||||
*/ | */ | ||||
Not Done Inline ActionsSince all new versions will have different headers, wouldn't this flag be better called KTR_VERSIONED or KTR_HAS_VERSION or something? rpokala: Since all new versions will have different headers, wouldn't this flag be better called… | |||||
#define KTRFAC_MASK 0x00ffffff | #define KTRFAC_MASK 0x00ffffff | ||||
#define KTRFAC_SYSCALL (1<<KTR_SYSCALL) | #define KTRFAC_SYSCALL (1<<KTR_SYSCALL) | ||||
#define KTRFAC_SYSRET (1<<KTR_SYSRET) | #define KTRFAC_SYSRET (1<<KTR_SYSRET) | ||||
#define KTRFAC_NAMEI (1<<KTR_NAMEI) | #define KTRFAC_NAMEI (1<<KTR_NAMEI) | ||||
#define KTRFAC_GENIO (1<<KTR_GENIO) | #define KTRFAC_GENIO (1<<KTR_GENIO) | ||||
#define KTRFAC_PSIG (1<<KTR_PSIG) | #define KTRFAC_PSIG (1<<KTR_PSIG) | ||||
#define KTRFAC_CSW (1<<KTR_CSW) | #define KTRFAC_CSW (1<<KTR_CSW) | ||||
#define KTRFAC_USER (1<<KTR_USER) | #define KTRFAC_USER (1<<KTR_USER) | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
KTR_NEW is rather vague, and needs to be commented like KTR_DROP is.