ktrace.patch
| kern/kern_ktrace.c 4 May 2007 18:28:10 -0000 | ||
|---|---|---|
| 66 | 66 |
{
|
| 67 | 67 |
struct ktr_header *kth; |
| 68 | 68 |
struct proc *p = curproc; /* XXX */ |
| 69 |
struct lwp *lp = curthread->td_lwp; |
|
| 69 | 70 | |
| 70 | 71 |
MALLOC(kth, struct ktr_header *, sizeof (struct ktr_header), |
| 71 | 72 |
M_KTRACE, M_WAITOK); |
| 72 | 73 |
kth->ktr_type = type; |
| 73 | 74 |
microtime(&kth->ktr_time); |
| 74 | 75 |
kth->ktr_pid = p->p_pid; |
| 76 |
kth->ktr_tid = lp->lwp_tid; |
|
| 75 | 77 |
bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN + 1); |
| 76 | 78 |
return (kth); |
| 77 | 79 |
} |
| sys/ktrace.h 4 May 2007 18:56:49 -0000 | ||
|---|---|---|
| 80 | 80 |
int ktr_len; /* length of buf */ |
| 81 | 81 |
short ktr_type; /* trace record type */ |
| 82 | 82 |
pid_t ktr_pid; /* process id */ |
| 83 |
lwpid_t ktr_tid; /* lwp id */ |
|
| 83 | 84 |
char ktr_comm[MAXCOMLEN+1]; /* command name */ |
| 84 | 85 |
struct timeval ktr_time; /* timestamp */ |
| 85 | 86 |
caddr_t ktr_buf; |