iovisor / iovisor/bcc

Incorrect calculation of recv throughput in tcptop.py

Open
#5,352 11 comments 6 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

tcp_cleanup_rbuf is called several times in a loop inside tcp_recvmsg. At the same time, it is passed the accumulated parameter "copied". Thus, the same data is taken into account several times.

```c
int tcp_recvmsg(...) {
...
int copied = 0;
...
do {
...
tcp_cleanup_rbuf(sk, copied);
...
copied += used;
...
} while (len > 0);

tcp_cleanup_rbuf(sk, copied);
return copied;
...
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.