Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,17 @@ int run_main_thread(struct options *opts, struct callbacks *cb,
control_plane_destroy(cp);

if (opts->rx_zerocopy) {
uint64_t total_rx_zc_bytes = 0;
uint64_t total_rx_bytes = 0;
uint64_t percent_mmaped;
uint64_t total_zc_bytes = 0;
uint64_t total_bytes = 0;
uint64_t percent_mmaped = 0;

for (int i = 0; i < opts->num_threads; i++) {
total_rx_zc_bytes += ts[i].io_stats.rx_zc_bytes;
total_rx_bytes += ts[i].io_stats.rx_bytes;
total_zc_bytes += ts[i].io_stats.rx_zc_bytes;
total_bytes += ts[i].io_stats.rx_bytes;
}
percent_mmaped = 100 * total_rx_zc_bytes / total_rx_bytes;
PRINT(cb, "bytes_mmaped", "%lu", total_rx_zc_bytes);
if (total_zc_bytes > 0)
percent_mmaped = 100 * total_zc_bytes / total_bytes;
PRINT(cb, "bytes_mmaped", "%lu", total_zc_bytes);
PRINT(cb, "percent_mmaped", "%lu", percent_mmaped);
if (percent_mmaped < 10) {
LOG_WARN(cb, "Little traffic is being handled by "
Expand Down