cvs commit: src/sys/sys ktrace.h src/sys/kern kern_ktrace.c

Robert Watson rwatson at FreeBSD.org
Tue Nov 1 08:04:04 PST 2005


On Tue, 1 Nov 2005, John Baldwin wrote:

> On Tuesday 01 November 2005 09:46 am, Robert Watson wrote:
>> rwatson     2005-11-01 14:46:37 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     sys/sys              ktrace.h
>>     sys/kern             kern_ktrace.c
>>   Log:
>>   Reuse ktr_unused field in ktr_header structure as ktr_tid; populate
>>   ktr_tid as part of gathering of ktr header data for new ktrace
>>   records.  The continued use of intptr_t is required for file layout
>>   reasons, and cannot be changed to lwpid_t at this point.
>>
>>   MFC after:      1 month
>>   Reviewed by:    davidxu
>
> CTASSERT that sizeof(lwpid_t) <= sizeof(intptr_t)

Well, we also have to make sure that the structure doesn't shrink, not 
just not grow.  This could be accomplished with a union and CTASSERT. 
However, I think the main thing that matters is that today kdump continue 
to work with ktraces from yesterday on the platforms we care about.  If it 
breaks in four weeks due to lack of a CTASSERT, that is someone else's 
bug.

I do notice, though, that our 64-bit amd64 kernel likely produces ktrace 
results a 32-bit i386 binary can't read, due to inclusion of the 
ktr_buffer field.  Given that it was never needed, it's sort of a shame it 
was ever in the file format.

Robert N M Watson


More information about the cvs-src mailing list