Skip to content

bugtool: include human-readable ttl for ct entries #39293

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

sypakine
Copy link
Contributor

@sypakine sypakine commented May 2, 2025

the --time-diff option for ct list commands provides improved readability for the conntrack entry lifetime.

Example diff:

# sdiff -w 201 <(cilium bpf ct list global | head -1) <( cilium bpf ct list global --time-diff | head -1)
TCP IN 10.104.4.1:48022 -> 10.104.4.3:19090 expires=16997807 Packets=10 Bytes=954 RxFlagsSeen=0x1   |   TCP IN 10.104.4.1:48022 -> 10.104.4.3:19090 expires=16997807 (remaining: -9699 sec(s)) Packets=10
bugtool: Include human-readable TTL for conntrack entries.

```
# sdiff -w 201 <(cilium bpf ct list global | head -1) <( cilium bpf ct list global --time-diff | head -1)
TCP IN 10.104.4.1:48022 -> 10.104.4.3:19090 expires=16997807 Packets=10 Bytes=954 RxFlagsSeen=0x1   |   TCP IN 10.104.4.1:48022 -> 10.104.4.3:19090 expires=16997807 (remaining: -9699 sec(s)) Packets=10
```

Signed-off-by: Mark St John <markstjohn@google.com>
@sypakine sypakine requested a review from a team as a code owner May 2, 2025 15:16
@sypakine sypakine requested a review from mhofstetter May 2, 2025 15:16
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 2, 2025
@sypakine
Copy link
Contributor Author

sypakine commented May 2, 2025

/test

1 similar comment
@sypakine
Copy link
Contributor Author

sypakine commented May 4, 2025

/test

@mhofstetter mhofstetter added area/bugtool Impacts gathering of data for debugging purposes. release-note/misc This PR makes changes that have no direct user impact. labels May 5, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 5, 2025
@mhofstetter mhofstetter changed the title debug: include human-readable ttl for ct entries bugtool: include human-readable ttl for ct entries May 5, 2025
Copy link
Member

@mhofstetter mhofstetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change!

This looks good to me - even though changing the command also changes the filename in the sysdump (cilium-dbg-bpf-ct-list-global---time-diff.md - including the flag in the file)

Note: I prefixed the PR title & release note with bugtool: .

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 5, 2025
@sypakine
Copy link
Contributor Author

sypakine commented May 5, 2025

Is -D preferable to --time-diff for the file naming?

@joestringer
Copy link
Member

Did you consider also converting the expires= field into an RFC3339-style timestamp? I feel like that'd help quite a bit too.

@sypakine
Copy link
Contributor Author

sypakine commented May 7, 2025

I did not, thanks for the suggestion. I will take a look at that.

@joestringer
Copy link
Member

I wasn't sure if you were going to look into the above in this PR, but the suggested change can be a different submission. I'll trigger the merge for this now.

@joestringer joestringer added this pull request to the merge queue May 19, 2025
Merged via the queue into cilium:main with commit 68b508c May 19, 2025
70 of 72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bugtool Impacts gathering of data for debugging purposes. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants