Page MenuHomeFreeBSD

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

Authored by marcel on Mar 2 2017, 6:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 20 2024, 3:43 PM
Unknown Object (File)
Dec 20 2023, 3:51 AM
Unknown Object (File)
Nov 23 2023, 5:58 PM
Unknown Object (File)
Nov 14 2023, 5:07 PM
Unknown Object (File)
Nov 9 2023, 8:18 PM
Unknown Object (File)
Nov 7 2023, 8:37 PM
Unknown Object (File)
Oct 8 2023, 7:01 PM
Unknown Object (File)
Oct 6 2023, 7:30 PM
Subscribers

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 - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 7845
Build 7988: arc lint + arc unit

Event Timeline

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)

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?

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);}'

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.