Page MenuHomeFreeBSD

minidump: De-duplicate the progress bar
ClosedPublic

Authored by mhorne on Sep 8 2021, 9:01 PM.
Tags
None
Referenced Files
F102941937: D31885.diff
Tue, Nov 19, 1:00 AM
Unknown Object (File)
Tue, Oct 29, 7:23 AM
Unknown Object (File)
Oct 13 2024, 2:40 AM
Unknown Object (File)
Oct 13 2024, 2:10 AM
Unknown Object (File)
Oct 13 2024, 2:10 AM
Unknown Object (File)
Oct 13 2024, 2:10 AM
Unknown Object (File)
Oct 4 2024, 4:46 PM
Unknown Object (File)
Oct 4 2024, 4:13 AM

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 41466
Build 38355: 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
160

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
160

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

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

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.