Skip to content

Commit

Permalink
Don't log getattr calls in libfuse, attr_cache, or file_cache (#193)
Browse files Browse the repository at this point in the history
* Don't log getattr calls in libfuse, attr_cache, or file_cache

* Spelling fix
  • Loading branch information
jfantinhardesty committed Apr 12, 2024
1 parent 895c84a commit d7179da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions component/attr_cache/attr_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,9 @@ func (ac *AttrCache) SyncDir(options internal.SyncDirOptions) error {

// GetAttr : Try to serve the request from the attribute cache, otherwise cache attributes of the path returned by next component
func (ac *AttrCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error) {
log.Trace("AttrCache::GetAttr : %s", options.Name)
// Don't log these by default, as it noticeably affects performance
// log.Trace("AttrCache::GetAttr : %s", options.Name)

ac.cacheLock.RLock()
value, found := ac.cache.get(options.Name)
ac.cacheLock.RUnlock()
Expand All @@ -942,7 +944,6 @@ func (ac *AttrCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr
// options.RetrieveMetadata is set by CopyFromFile and WriteFile which need metadata to ensure it is preserved.
if value.attr.IsMetadataRetrieved() || (ac.noSymlinks && !options.RetrieveMetadata) {
// path exists and we have all the metadata required or we do not care about metadata
log.Debug("AttrCache::GetAttr : %s served from cache", options.Name)
return value.attr, nil
}
}
Expand Down
3 changes: 2 additions & 1 deletion component/file_cache/file_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,8 @@ func (fc *FileCache) FlushFile(options internal.FlushFileOptions) error {

// GetAttr: Consolidate attributes from storage and local cache
func (fc *FileCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error) {
log.Trace("FileCache::GetAttr : %s", options.Name)
// Don't log these by default, as it noticeably affects performance
// log.Trace("FileCache::GetAttr : %s", options.Name)

// For get attr, there are three different path situations we have to potentially handle.
// 1. Path in cloud storage but not in local cache
Expand Down
4 changes: 3 additions & 1 deletion component/libfuse/libfuse2_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ func (cf *CgofuseFS) Getattr(path string, stat *fuse.Stat_t, fh uint64) int {
// TODO: Currently not using filehandle
name := trimFusePath(path)
name = common.NormalizeObjectName(name)
log.Trace("Libfuse::Getattr : %s", name)

// Don't log these by default, as it noticeably affects performance
// log.Trace("Libfuse::Getattr : %s", name)

// Return the default configuration for the root
if name == "" {
Expand Down

0 comments on commit d7179da

Please sign in to comment.