-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#5873] feat(gvfs-fuse): add debug log for FuseApiHandle #5905
base: branch-gvfs-fuse-dev
Are you sure you want to change the base?
[#5873] feat(gvfs-fuse): add debug log for FuseApiHandle #5905
Conversation
9ae9ea0
to
3574bce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, we need to verify the log format to see if it meets expectations. This needs to be validated in the #5886, and you can wait for it to be merged.
inner: FuseApiHandle::new(fs, context), | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions that are not part of the Filesystem trait do not need to add debug logs.
} | ||
|
||
impl<T: RawFileSystem> Filesystem for FuseApiHandleDebug<T> { | ||
async fn init(&self, req: Request) -> fuse3::Result<ReplyInit> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to implement all interfaces of the Filesystem. If they are not implemented yet, an error log should be recorded.
async fn init(&self, req: Request) -> fuse3::Result<ReplyInit> { | ||
debug!("init: req: {:?}", req); | ||
let result = self.inner.init(req).await; | ||
debug!("init result: {:?}", result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an asynchronous multithreaded model. Logs from two print statements within a single function may be interleaved with logs from other interfaces. It is necessary to identify them in the logs.
async fn lookup(&self, req: Request, parent: Inode, name: &OsStr) -> fuse3::Result<ReplyEntry> { | ||
debug!("lookup: req: {:?}, parent: {:?}, name: {:?}", req, parent, name); | ||
let result = self.inner.lookup(req, parent, name).await; | ||
debug!("lookup result: {:?}", result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an error is returned, it should be logged using error!.
atime: Option<Timestamp>, | ||
mtime: Option<Timestamp>, | ||
) -> Result<FileStat, Errno> { | ||
debug!("get_modified_file_stat: file_id: {}, size: {:?}, atime: {:?}, mtime: {:?}", file_id, size, atime, mtime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s best to convert file_id to a file path to improve readability, for example, "/a/b.txt(2342)". Other variables should follow a similar approach.
Please refer to other PRs for the format of PR titles and descriptions. |
d1bfdba
to
425c490
Compare
What changes were proposed in this pull request?
Implement
FuseApiHandleDebug
so we can log all input arguments and return values ofFuseApiHandle
.Fix: #5873
Does this PR introduce any user-facing change?
No.
How was this patch tested?
manually.