Page MenuHomeFreeBSD

kdump: Advance kdump timestamp resolution.

Authored by dchagin on Jul 11 2022, 3:35 PM.
Referenced Files
Unknown Object (File)
Sat, Jun 15, 11:03 PM
Unknown Object (File)
Sat, Jun 15, 5:35 PM
Unknown Object (File)
Thu, May 30, 5:33 PM
Unknown Object (File)
Thu, May 30, 5:33 PM
Unknown Object (File)
May 23 2024, 12:43 AM
Unknown Object (File)
May 11 2024, 4:49 AM
Unknown Object (File)
May 8 2024, 8:39 AM
Unknown Object (File)
May 8 2024, 8:13 AM



It's time to advance the resolution of the kdump timestamp, as even
when tracing, some system calls are executed faster than 1 µs.
To be able to read of old ktrace.out files, versioning was added
to struct ktr_header.
While here ability to print CPU number of earch entry added.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

rpokala added inline comments.

KTR_NEW is rather vague, and needs to be commented like KTR_DROP is.


Wouldn't this be better as version = KTR_VERSION0?

indeed, fixed, thanks, Ravi

Also: in last sentence of summary, "earch" should be "each".


If I read the code correctly (not sure I do).

This revision now requires changes to proceed.Jul 11 2022, 6:11 PM

Perhaps adjust the log message a bit to something like:

ktrace: Increase precision of timestamps.

Replace struct timeval in header with struct timespec.  To differentiate
header formats, add a new KTRNEW flag set in the header type field
similar to the existing KTRDROP flag.

To make it easier to extend ktrace headers in the future, extend the
existing header with a version field (version 0 is reserved for older
records without KTRNEW) as well as new fields holding the thread ID
and CPU ID.

Since all new versions will have different headers, wouldn't this flag be better called KTR_VERSIONED or KTR_HAS_VERSION or something?

In D35774#812599, @jhb wrote:

Perhaps adjust the log message a bit to something like:

Ditto; this message is much clearer than the original.

This revision is now accepted and ready to land.Jul 13 2022, 8:10 PM
This revision was automatically updated to reflect the committed changes.