Skip to content

tcppktlat: Add histogram mode with per-PID grouping#5430

Open
ethercflow wants to merge 2 commits intoiovisor:masterfrom
ethercflow:improve
Open

tcppktlat: Add histogram mode with per-PID grouping#5430
ethercflow wants to merge 2 commits intoiovisor:masterfrom
ethercflow:improve

Conversation

@ethercflow
Copy link
Copy Markdown
Contributor

Add -H option to display latency as histograms grouped by PID. Supports periodic printing with interval argument and works with existing filters like -p, -t, -l, -r.

Add -H option to display latency as histograms grouped by PID.
Supports periodic printing with interval argument and works with
existing filters like -p, -t, -l, -r.

Signed-off-by: Wenbo Zhang <wenbo.zhang@iomesh.com>
@ethercflow
Copy link
Copy Markdown
Contributor Author

@ekyooo addressed, thx!

@ethercflow ethercflow force-pushed the improve branch 2 times, most recently from 33e5b5c to 6af8242 Compare December 19, 2025 04:04
Signed-off-by: Wenbo Zhang <wenbo.zhang@iomesh.com>
@ethercflow
Copy link
Copy Markdown
Contributor Author

@ekyooo Thank you so much for your suggestions —— they're all very constructive! The issues have been fixed; please kindly review again.

@ethercflow
Copy link
Copy Markdown
Contributor Author

Hi @ekyooo , PTAL thanks!

if (start_time == 0) {
start_time = now;
}
str_timestamp("%Y-%m-%d %H:%M:%S", ts, sizeof(ts));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When using -T with -H and an interval, timestamps are duplicated. Please check the interaction between -T and -H options.

 $ sudo ./tcppktlat -H -T 3
 
[2025-12-23 16:35:41] (elapsed: 24 seconds)
16:35:41
pid = 117845 firefox
     usecs               : count    distribution
         0 -> 1          : 0        |                

start_time = now;
}
str_timestamp("%Y-%m-%d %H:%M:%S", ts, sizeof(ts));
printf("[%s] (elapsed: %ld seconds)\n", ts, now - start_time);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

At the first output with sudo ./tcppktlat -H 5 3, why does it show "elapsed: 0 seconds" when the output appears at the 5-second mark?

$ sudo ./tcppktlat -H 5 3
Summarize TCP packet latency as a histogram. Hit Ctrl-C to end.

[2025-12-23 16:37:22] (elapsed: 0 seconds)


The -H option can also take an interval argument to print histograms periodically.

# tcppktlat -H 5
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please ensure _example.txt output is consistent with the actual tool output changes. (ex. timestamp display).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants