Page MenuHomeFreeBSD

libdtrace: decode all tcp header flags
ClosedPublic

Authored by rscheff on Dec 30 2023, 10:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 18, 7:00 AM
Unknown Object (File)
Sun, May 12, 10:52 PM
Unknown Object (File)
Fri, May 10, 3:47 AM
Unknown Object (File)
Fri, May 10, 3:47 AM
Unknown Object (File)
Thu, May 9, 6:18 PM
Unknown Object (File)
Thu, May 9, 2:25 PM
Unknown Object (File)
Thu, May 9, 2:23 PM
Unknown Object (File)
Thu, May 9, 2:22 PM
Subscribers

Details

Summary

add decoding capability of TH_AE to dtrace, including
the example provided with tcpdebug.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 55177
Build 52066: arc lint + arc unit

Event Timeline

cddl/lib/libdtrace/tcp.d
99

I'm pretty sure that 1.6.3 is wrong here, but I don't know what the right number is. I guess markj@ knows...

322

I guess TA_OUTPUT should be TA_DROP?

cddl/lib/libdtrace/tcp.d
99

According to dt_open.c the current version is 1.13. Not sure if we need to bump it, since you change tcpinfo_t later down. I'll let that up to markj@.

324–325

You need to bump the version to 1.13 at least.

cddl/lib/libdtrace/tcp.d
99

I think it's ok to update the type without changing the version. D scripts won't be sensitive to such changes.

269

Where is get_tcp_flags() implemented?

rscheff marked 4 inline comments as done.
  • bump version number of the modified string bindings
cddl/lib/libdtrace/tcp.d
269

tcp.h (in context _BSD_VISIBLE). May be renamed to __tcp_tcp_flags() for userspace though subsequently.

Not very my area, but seems to have sense.

This revision is now accepted and ready to land.Dec 30 2023, 9:05 PM
cddl/lib/libdtrace/tcp.d
269

But how does dtrace know about tcp.h? And how can it compile and run C functions? I do not think this can work. dtrace can parse C to get some types of definitions, but that is fairly limited.

You'll need to implement tcp_get_flags as an inline, I think, similar to how tcp_state_string works.

  • retain inline access to flag fields
This revision now requires review to proceed.Dec 31 2023, 5:09 PM
cddl/lib/libdtrace/tcp.d
269
288
cddl/lib/libdtrace/tcp.d
90
rscheff added inline comments.
cddl/lib/libdtrace/tcp.d
90

oh, unintended edit. thx.

248

Is this " `hz " correct here? A single backtick feels strange in the middle of C-like code...

rscheff marked an inline comment as done.
  • fix typo and bracketing
markj added inline comments.
cddl/lib/libdtrace/tcp.d
248

Yes. It's syntax which allows D scripts to refer to the kernel's global variables.

This revision is now accepted and ready to land.Dec 31 2023, 8:43 PM