bcc/tools: use device number and inode number to identify a file
authorHengqi Chen <chenhengqi@outlook.com>
Wed, 28 Jul 2021 15:49:11 +0000 (23:49 +0800)
committeryonghong-song <ys114321@gmail.com>
Mon, 2 Aug 2021 06:27:54 +0000 (23:27 -0700)
commitd5673474ea57ced824c079f08270f8eb78c986b0
tree46eeeee436e416e9f7add80e267a62b598ddbd39
parentb912d0b05453b153372ea280e012eda8c11bd3a5
bcc/tools: use device number and inode number to identify a file

Currently, the filetop tool use (tid, filename, type) tuple to
key a file, which is not enough to uniquely identify a file.
A thread write to multi files with the same name would add up to
same value in the map which can be repro by the following command:

$ cat somefile | tee /foo/bar/xxx /fuz/baz/xxx

Let us add device number and inode number to uniquely identify
a file.

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
tools/filetop.py