Page MenuHomeFreeBSD

minidump: De-duplicate the progress bar
AcceptedPublic

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

Details

Reviewers
markj
manu
Group Reviewers
ARM
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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 41466
Build 38355: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Wed, Sep 8, 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
159

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.Fri, Sep 10, 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.Fri, Sep 10, 8:29 PM
mhorne added inline comments.
sys/sys/kerneldump.h
159

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.Fri, Sep 10, 9:05 PM