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)
Mon, Nov 18, 11:41 AM
Unknown Object (File)
Fri, Nov 8, 7:41 AM
Unknown Object (File)
Wed, Nov 6, 11:21 PM
Unknown Object (File)
Oct 17 2024, 5:05 PM
Unknown Object (File)
Oct 17 2024, 4:52 AM
Unknown Object (File)
Oct 17 2024, 3:41 AM
Unknown Object (File)
Oct 16 2024, 12:44 AM
Unknown Object (File)
Oct 15 2024, 6:11 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46368
Build 43257: arc lint + arc unit

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

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.