Page MenuHomeFreeBSD

kdump: Advance kdump timestamp resolution.
ClosedPublic

Authored by dchagin on Jul 11 2022, 3:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2022, 7:07 AM
Unknown Object (File)
Dec 15 2022, 7:35 AM
Unknown Object (File)
Dec 14 2022, 11:31 PM
Unknown Object (File)
Dec 1 2022, 8:25 PM

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rpokala added inline comments.
sys/sys/ktrace.h
254

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

usr.bin/kdump/kdump.c
447

Wouldn't this be better as version = KTR_VERSION0?

indeed, fixed, thanks, Ravi

pauamma requested changes to this revision.Jul 11 2022, 6:11 PM
pauamma added a subscriber: pauamma.

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

usr.bin/kdump/kdump.1
57

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.
sys/sys/ktrace.h
259

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.