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)
Fri, Apr 5, 6:56 AM
Unknown Object (File)
Jan 30 2024, 5:53 PM
Unknown Object (File)
Jan 30 2024, 5:53 PM
Unknown Object (File)
Jan 17 2024, 11:12 AM
Unknown Object (File)
Jan 14 2024, 10:17 AM
Unknown Object (File)
Dec 30 2023, 9:02 AM
Unknown Object (File)
Dec 20 2023, 5:57 AM
Unknown Object (File)
Nov 16 2023, 3:23 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 46364
Build 43253: 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.