-
Notifications
You must be signed in to change notification settings - Fork 3k
Add support for SO_TIMESTAMPNS and SO_TIMESTAMPING socket options #10509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
CT Test Results 4 files 196 suites 1h 53m 48s ⏱️ For more details on these failures, see this check. Results for commit 14d6eed. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
|
It (git) failed to merge into our test branch because of conflicts with other (unrelated) changes. |
9749a86 to
310dfcc
Compare
|
@bmk the failures in CI, GHA is not giving me really explicit descriptions, do you have any hint about what is it that needs to be fixed or is it a false positive? :) |
|
I have found a couple of issues.
|
|
Goddamit, the tests were not enabled 🤦🏽 Just noticed where, adding them and fixing the tests! Thanks for the feedback! |
I've tried to pretty much replicate existing code as much as possible. This commit adds support for two additional timestamp-related socket options that provide enhanced timestamping capabilities: - SO_TIMESTAMPNS: Similar to SO_TIMESTAMP but provides nanosecond precision timestamps using timespec instead of timeval. This is useful for applications requiring higher precision timing information. Platform compatibility: - Linux: Full support for both options - BSD/macOS: Code compiles but options unavailable (guarded by #ifdef) - Windows: Code compiles but options unavailable These options are particularly useful for network performance monitoring, packet capture tools, and applications requiring precise timing information.
I've tried to pretty much replicate existing code as much as possible. - SO_TIMESTAMPING: An integer bitmask option that allows fine-grained control over which timestamp types are enabled (e.g., software timestamps, hardware timestamps, etc.). This is primarily used for advanced network monitoring and performance analysis. Platform compatibility: - Linux: Full support for both options - BSD/macOS: Code compiles but options unavailable (guarded by #ifdef) - Windows: Code compiles but options unavailable These options are particularly useful for network performance monitoring, packet capture tools, and applications requiring precise timing information.
310dfcc to
c20d68d
Compare
|
@bmk done now, made sure tests pass, tested using it on my machines, turned the flags into a list of atoms, added docs (forgot to do this last time!). Ready for review again :) |
|
Ag, I've tested on Linux 6.12, |
|
Annoyingly these flags are not defines but enum values, making it non-trivial to ifdef for existence. |
|
It now works fine when I test! |
|
Sounds good to me, done 👌🏽 |
|
We have run into problems on a (Linux) cross build to PowerPC (sorry for the horrible format):
On that platform, the data type 'struct scm_timestamping' does not exist. |
|
@bmk I've pushed a changed that "seems correct" to me, but I don't have a PowerPC at hand to verify 😅 Will try to setup a VM or so later, but maybe you'll do it faster than me, if you can confirm this works 🙏🏽 |
|
I was looking for this; AC_CHECK_TYPES, but managed to miss it (I tried to use AC_CHECK_MEMBERS |
|
As it turns out, configure fails with the following: |
e1e266c to
14d6eed
Compare
|
Pushed a change, tested it in a local VM, it took 30min to build, damn QEMU is slow on my M4, but it passed both Edit, it took an hour to run tests 😜 But all green on my VM 👌🏽 |
I've tried to pretty much replicate existing code as much as possible.
This commit adds support for two additional timestamp-related socket options that provide enhanced timestamping capabilities:
SO_TIMESTAMPNS: Similar to SO_TIMESTAMP but provides nanosecond precision timestamps using timespec instead of timeval. This is useful for applications requiring higher precision timing information.
SO_TIMESTAMPING: An integer bitmask option that allows fine-grained control over which timestamp types are enabled (e.g., software timestamps, hardware timestamps, etc.). This is primarily used for advanced network monitoring and performance analysis.
Platform compatibility:
These options are particularly useful for network performance monitoring, packet capture tools, and applications requiring precise timing information.