Page MenuHomeFreeBSD

libdtrace: decode all tcp header flags
ClosedPublic

Authored by rscheff on Dec 30 2023, 10:06 AM.
Tags
None
Referenced Files
F83238230: D43243.diff
Tue, May 7, 11:38 PM
Unknown Object (File)
Tue, Apr 30, 11:18 PM
Unknown Object (File)
Mon, Apr 29, 3:21 AM
Unknown Object (File)
Sun, Apr 28, 7:37 PM
Unknown Object (File)
Sat, Apr 27, 6:03 AM
Unknown Object (File)
Fri, Apr 19, 1:44 PM
Unknown Object (File)
Fri, Apr 19, 1:44 PM
Unknown Object (File)
Fri, Apr 19, 1:44 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 Not Applicable
Unit
Tests Not Applicable

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