filetop.py: map.lookup_or_init() is wrong?
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 3
Description
I use the filetop.py to show reads and writes by file with process. But find something strange hanpens. the result is as follow
```
TID COMM READS WRITES R_Kb W_Kb T FILE
4236 collectd 158 0 623 0 R cmdline
4236 collectd 8 0 31 0 R cmdline
4236 collectd 6 0 24 0 R cmdline
4236 collectd 4 0 16 0 R cmdline
4236 collectd 4 0 15 0 R cmdline
4236 collectd 11 0 11 0 R status
4232 collectd 10 0 10 0 R mounts
4236 collectd 8 0 8 0 R stat
4236 collectd 2 0 8 0 R cmdline
4235 collectd 2 0 8 0 R udev.conf
4236 collectd 2 0 8 0 R cmdline
14469 pmcd_wait 2 0 8 0 R hosts
4236 collectd 2 0 8 0 R cmdline
4236 collectd 2 0 8 0 R cmdline
4236 collectd 2 0 7 0 R cmdline
4236 collectd 2 0 7 0 R cmdline
4236 collectd 2 0 7 0 R cmdline
```
The line from one to five has same process id, comm, and file. why they print on different lines? Is the api ` map.lookup_or_init()` wrong or some reasons?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with filetop.py and inspect the map.lookup_or_init() call mentioned in the report, then reproduce the repeated rows using the sample workload if possible. Compare the aggregation key with the displayed TID, command, and file fields; done means establishing whether these rows are expected or correcting the behavior and documenting the result with a regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- observability, operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100