Page MenuHomeFreeBSD

Add support for ISO C11 unnamed structure/union fields to dtrace
AbandonedPublic

Authored by marcel on Mar 2 2017, 6:34 AM.

Details

Reviewers
markj
pfg
gnn
Summary

Recurse the members of the unnamed structure/union fields and
insert them in the outer structure, effectivy flattening the
hierarchy.

Diff Detail

Repository
rS FreeBSD src repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7845
Build 7988: arc lint + arc unit

Event Timeline

marcel updated this revision to Diff 25866.Mar 2 2017, 6:34 AM
marcel retitled this revision from to Add support for ISO C11 unnamed structure/union fields to dtrace.
marcel updated this object.
marcel edited the test plan for this revision. (Show Details)
marcel updated this object.Mar 2 2017, 6:38 AM
marcel added reviewers: pfg, markj, gnn.
markj edited edge metadata.EditedMar 2 2017, 4:53 PM

Hm, this discards information. For instance, when pretty-printing an mbuf with DTrace, the first few fields are shown to be in a union:

7  36863                   ip_input:entry struct mbuf {
    union  {
        struct mbuf *m_next = 0
        struct m_slist = {
            struct mbuf *sle_next = 0
        }
        struct m_stailq = {
            struct mbuf *stqe_next = 0
        }
    }

I attempted to handle anonymous structs/unions to some extent with r305055. Where are you seeing problems?

marcel added a comment.Mar 2 2017, 5:34 PM

I'm seeing this with a slightly older 11-stable. I see that r305055 has been MFC'd as r313129 on 2017-02-02. which means the fix is not present on the system I see it in. Both my up-to-date -current and -stable systems seem to work (see example below). So it looks the problem was already fixed!

example:
sudo dtrace -n fbt:kernel:ip_input:entry'{@len = quantize(args[0]->m_pkthdr.len);}'

marcel abandoned this revision.Mar 2 2017, 6:11 PM

Already fixed.

markj added a comment.Mar 2 2017, 7:24 PM

I'm seeing this with a slightly older 11-stable. I see that r305055 has been MFC'd as r313129 on 2017-02-02. which means the fix is not present on the system I see it in. Both my up-to-date -current and -stable systems seem to work (see example below). So it looks the problem was already fixed!

Sorry for the delayed MFC. Glad to hear that it fixes your problem though.