tools/opensnoop: support mount parent full-path#5324
Closed
Rtoax wants to merge 1 commit intoiovisor:masterfrom
Closed
tools/opensnoop: support mount parent full-path#5324Rtoax wants to merge 1 commit intoiovisor:masterfrom
Rtoax wants to merge 1 commit intoiovisor:masterfrom
Conversation
Like d_path()/prepend_path() [1] did, get mount parent full-path.
For example, /dev/sda mount on /home/sda:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1.8T 0 disk /home/sda
and open file under /home/sda/:
$ cd /home/sda/git-repos/tst-linux
$ touch a.out
Old tracing, only get the mount root:
$ sudo ./opensnoop.py -F
PID COMM FD ERR PATH
114293 touch 3 0 /git-repos/test-linux/a.out
This patch get real full path:
$ sudo ./opensnoop.py -F
PID COMM FD ERR PATH
114110 touch 3 0 /home/sda/git-repos/test-linux/a.out
^^^^^^^^^
Link: https://github.com/torvalds/linux/blob/master/fs/d_path.c [1]
Signed-off-by: Rong Tao <rongtao@cestc.cn>
Contributor
Author
|
Perhaps we need to first address the issue of multiple processing of events caused by the full-path patch, which was introduced in c110a4d. Each loop iteration will send out an event, which is too much and unnecessary. cc @yonghong-song |
Collaborator
|
Sounds good. Let us resolve #5323 first and then deal with this patch. |
Contributor
Author
Close this PR and fix this first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Like d_path()/prepend_path() [1] did, get mount parent full-path.
For example, /dev/sda mount on /home/sda:
and open file under /home/sda/:
Old tracing, only get the mount root:
This patch get real full path:
Link: https://github.com/torvalds/linux/blob/master/fs/d_path.c [1]