Page MenuHomeFreeBSD

minidump: De-duplicate the progress bar
ClosedPublic

Authored by mhorne on Sep 8 2021, 9:01 PM.
Tags
None
Referenced Files
F82000613: D31885.id94905.diff
Wed, Apr 24, 9:09 AM
Unknown Object (File)
Sat, Apr 20, 4:04 AM
Unknown Object (File)
Thu, Mar 28, 2:04 PM
Unknown Object (File)
Mar 20 2024, 2:15 PM
Unknown Object (File)
Jan 31 2024, 2:22 PM
Unknown Object (File)
Jan 1 2024, 4:22 PM
Unknown Object (File)
Dec 20 2023, 6:11 AM
Unknown Object (File)
Dec 14 2023, 8:37 PM

Details

Summary

The implementation of the progress bar is simple, but duplicated for
most minidump implementations (32-bit ARM being the exception). Extract
the common bits to kern_dump.c. Ensure that the bar is reset with each
subsequent dump; this was only done on some platforms previously.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41437
Build 38326: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Sep 8 2021, 9:01 PM

I wonder if you could go further, by making the MI routines responsible for initializing and managing delta. That is, on every write just pass the number of bytes written and let minidumpsys_pb_progress() decide whether to print something. In other words, I wonder if we can avoid having to maintain both delta and counter in each minidumpsys() implementation. But I'm fine with this as-is.

sys/sys/kerneldump.h
157

Is there any reason these are specific to minidumps? It looks like they should just share the dumpsys_ namespace.

This revision is now accepted and ready to land.Sep 10 2021, 1:34 PM

Rename functions to have a dumpsys_ prefix.

Push the counter logic into the progress bar.

Add missing changes to i386 minidump code.

This revision now requires review to proceed.Sep 10 2021, 8:29 PM
mhorne added inline comments.
sys/sys/kerneldump.h
157

There was not. In fact, I wonder if this progress bar could be used for full dumps as well...

sys/x86/include/dump.h
46 ↗(On Diff #94968)

So I've added this definition to each arch's dump.h, so that the existing behaviour is preserved.

I'll note that for a small VM, this value is a little large for x86:

db> dump
Dumping 98 out of 473 MB:..17%..33%..49%..65%..82%..98%
Dump complete

I think the ideal method might be to scale this parameter based on the total size of memory.

markj added inline comments.
sys/x86/include/dump.h
46 ↗(On Diff #94968)

It would be cool if we could report progress in response to ctrl-T. :)

This revision is now accepted and ready to land.Sep 10 2021, 9:05 PM
This revision was automatically updated to reflect the committed changes.
mhorne marked an inline comment as done.