Bug #622 » ktrace.patch
kern/kern_ktrace.c 4 May 2007 18:28:10 -0000 | ||
---|---|---|
{
|
||
struct ktr_header *kth;
|
||
struct proc *p = curproc; /* XXX */
|
||
struct lwp *lp = curthread->td_lwp;
|
||
MALLOC(kth, struct ktr_header *, sizeof (struct ktr_header),
|
||
M_KTRACE, M_WAITOK);
|
||
kth->ktr_type = type;
|
||
microtime(&kth->ktr_time);
|
||
kth->ktr_pid = p->p_pid;
|
||
kth->ktr_tid = lp->lwp_tid;
|
||
bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN + 1);
|
||
return (kth);
|
||
}
|
sys/ktrace.h 4 May 2007 18:56:49 -0000 | ||
---|---|---|
int ktr_len; /* length of buf */
|
||
short ktr_type; /* trace record type */
|
||
pid_t ktr_pid; /* process id */
|
||
lwpid_t ktr_tid; /* lwp id */
|
||
char ktr_comm[MAXCOMLEN+1]; /* command name */
|
||
struct timeval ktr_time; /* timestamp */
|
||
caddr_t ktr_buf;
|