Page MenuHomeFreeBSD

Add a very limited DDB dumpon(8)-alike to MI dumper code
ClosedPublic

Authored by cem on Aug 28 2019, 3:08 AM.

Details

Summary

This allows ddb(4) commands to construct a static dumperinfo during
panic/debug and invoke doadump(false) using the provided dumper
configuration (always inserted first in the list).

The intended usecase is a ddb(4)-time netdump(4) command.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cem created this revision.Aug 28 2019, 3:08 AM
markj added a comment.Aug 28 2019, 4:52 PM

Looks like some code is missing?

cem added a comment.Aug 28 2019, 5:23 PM

Looks like some code is missing?

Like a consumer? :-)

Work is in progress; I intend to post that as a separate revision.

markj accepted this revision.Aug 28 2019, 5:27 PM
In D21448#466970, @cem wrote:

Looks like some code is missing?

Like a consumer? :-)
Work is in progress; I intend to post that as a separate revision.

Ah, ok.

Looks fine to me, but KPIs for use by DDB are typically named *_ddb (witness_ddb_*, stack_*_ddb, linker_ddb_*, etc.), so I'd suggest naming it dumper_ddb_{insert,remove}() instead. db_* is for interfaces implemented by DDB itself.

This revision is now accepted and ready to land.Aug 28 2019, 5:27 PM
markj added a comment.Aug 28 2019, 5:32 PM

In the absence of consumers it's hard to see whether dumper_remove() might ever try to free one of the static dumperinfos. Depending on how it pans out, it might make sense to give static dumperinfos a special flag to help catch that.

cem added a comment.Aug 28 2019, 7:49 PM

Thanks — I'll plan to make the name change. Re: the flag, the idea is that this type of dumper is only added to the list during db/panic time, when no external event would cause a dumper_remove (unless I'm forgetting something). And then removed before normal context resumes (if !panic). So maybe the flag is redundant? It wouldn't hurt to add in any case.

cem updated this revision to Diff 61434.Aug 28 2019, 10:04 PM

Rename the routines.

This revision now requires review to proceed.Aug 28 2019, 10:04 PM
markj accepted this revision.Aug 29 2019, 7:33 PM

I'm not sure the "_static" suffix really adds anything, FWIW.

This revision is now accepted and ready to land.Aug 29 2019, 7:33 PM
cem added a comment.Sep 2 2019, 5:44 PM

I'm not sure the "_static" suffix really adds anything, FWIW.

I've removed it/them in my git stack.

This revision was automatically updated to reflect the committed changes.