Subject: Re: lwp id in ktrace
To: Emmanuel Dreyfus <>
From: Christos Zoulas <>
List: tech-kern
Date: 12/01/2003 14:09:47
On Dec 1,  6:52pm, (Emmanuel Dreyfus) wrote:
-- Subject: Re: lwp id in ktrace

| Christos Zoulas <> wrote:
| > That is a cute idea. Do we really need the backwards compatibility though,
| > at the expense of making the file a lot larger? 
| The xheader could look like this: 
| struct ktr_xheader {
|         char    xh_version;             /* Extended header version */
|         char    xh_comm[MAXCOMLEN+1];   /* command name */
|         lwpid_t xh_lwpid;               /* lwpid */     
| };
| A lot of ktr_header can share the same ktr_xheader: while you trace the
| same lwp, you point to the same ktr_xheader. That way it won't be that
| big. Except of course if you have hundreds lwps, but if you do that I
| assume you prepared a rather big machine :o)

So when is the ktr_xheader get emitted?

| The xheader causes annoyance for older programs (the displayed name will
| loose 4 chars, 8 chars on 64 bit machines), but don't you think
| limitting lwpid to 64k could cause annoyance to future programs?

Well, there is the 3 bytes after the command name that are padded, which can
be used too... I don't know about 64K lwps; sounds high to me, but so seemed
640K to Bill Gates.