Page MenuHomeFreeBSD

kdump: decode pollfd struct arrays coming from poll(2)
ClosedPublic

Authored by kevans on Feb 29 2024, 4:47 PM.
Tags
None
Referenced Files
F101985557: D44160.diff
Wed, Nov 6, 4:53 AM
Unknown Object (File)
Wed, Oct 16, 10:20 AM
Unknown Object (File)
Tue, Oct 15, 5:12 AM
Unknown Object (File)
Mon, Oct 14, 12:30 PM
Unknown Object (File)
Sun, Oct 13, 5:13 AM
Unknown Object (File)
Sun, Oct 13, 5:13 AM
Unknown Object (File)
Sat, Oct 12, 11:47 AM
Unknown Object (File)
Fri, Oct 11, 3:56 AM
Subscribers

Details

Summary

We'll handle these just as we do kevents, one per line with subsequent
lines indented sufficiently to distinguish them from the upcoming
return value.

Sample, with indentation stripped and revents changed to '...' in the
first one to keep the line length down:

CALL poll(0x820610560,0x3,0)
STRU struct pollfd[] = { { fd=0, events=0x1<POLLIN>, revents=0x11<...>
{ fd=1, events=0x4<POLLOUT>, revents=0x4<POLLOUT>}
{ fd=-1, events=0x4<POLLOUT>, revents=0} }
RET poll 2

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56353
Build 53241: arc lint + arc unit

Event Timeline

I love it, thank you!

This revision is now accepted and ready to land.Feb 29 2024, 4:51 PM

Next you might consider adding this to truss as well. :)

In D44160#1008533, @jhb wrote:

Next you might consider adding this to truss as well. :)

I'm actually not sure what this would look like for truss... it does some decoding of events already, just not returned events:

820 100189: poll({ 0/POLLIN 1/POLLOUT -1/POLLOUT 1/POLLHUP },4,0) = 1 (0x1)

It's a little more obvious with kqueue since the results are returned in a separate parameter, so that gives a natural representation... the best I can come up with off the top of my head is maybe something like:

820 100189: poll({ 0/{POLLIN -> 0} 1/{POLLOUT -> POLLOUT} -1/{POLLOUT -> 0} 1/{POLLHUP -> 0} },4,0) = 1 (0x1)

but I'm afraid that might get a little convoluted

Oh, that probably won't work... we probably printed the entire left-hand side before the return, so it'd need to be on a separate line or something