Page MenuHomeFreeBSD

minidump: De-duplicate the progress bar

Authored by mhorne on Sep 8 2021, 9:01 PM.



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

rS FreeBSD src repository - subversion
Lint OK
No Unit 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.


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.

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


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.

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.