LLVM 22.0.0git
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
llvm::vfs::TracingFileSystem Class Reference

File system that tracks the number of calls to the underlying file system. More...

#include "llvm/Support/VirtualFileSystem.h"

Inheritance diagram for llvm::vfs::TracingFileSystem:
[フレーム]
[legend]

Public Member Functions

ErrorOr< Statusstatus (const Twine &Path) override
ErrorOr< std::unique_ptr< File > >  openFileForRead (const Twine &Path) override
directory_iterator  dir_begin (const Twine &Dir, std::error_code &EC) override
std::error_code  getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) override
bool  exists (const Twine &Path) override
std::error_code  isLocal (const Twine &Path, bool &Result) override
Public Member Functions inherited from llvm::RTTIExtends< TracingFileSystem, ProxyFileSystem >
const void *  dynamicClassID () const override
bool  isA () const
  Check whether this instance is a subclass of QueryT.

Public Attributes

std::size_t  NumStatusCalls = 0
std::size_t  NumOpenFileForReadCalls = 0
std::size_t  NumDirBeginCalls = 0
std::size_t  NumGetRealPathCalls = 0
std::size_t  NumExistsCalls = 0
std::size_t  NumIsLocalCalls = 0

Static Public Attributes

static const char  ID = 0

Protected Member Functions

void  printImpl (raw_ostream &OS, PrintType Type, unsigned IndentLevel) const override

Additional Inherited Members

Static Public Member Functions inherited from llvm::RTTIExtends< TracingFileSystem, ProxyFileSystem >
static const void *  classID ()
static bool  classof (const T *R)

Detailed Description

File system that tracks the number of calls to the underlying file system.

This is particularly useful when wrapped around RealFileSystem to add lightweight tracking of expensive syscalls.

Definition at line 1157 of file VirtualFileSystem.h.

Constructor & Destructor Documentation

◆  TracingFileSystem()

llvm::vfs::TracingFileSystem::TracingFileSystem ( llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS )
inline

Definition at line 1169 of file VirtualFileSystem.h.

References llvm::move().

Member Function Documentation

◆  dir_begin()

directory_iterator llvm::vfs::TracingFileSystem::dir_begin ( const Twine & Dir,
std::error_code & EC )
inlineoverride

Definition at line 1182 of file VirtualFileSystem.h.

References llvm::vfs::ProxyFileSystem::dir_begin(), and NumDirBeginCalls.

◆  exists()

bool llvm::vfs::TracingFileSystem::exists ( const Twine & Path )
inlineoverride

Definition at line 1193 of file VirtualFileSystem.h.

References llvm::vfs::ProxyFileSystem::exists(), and NumExistsCalls.

◆  getRealPath()

std::error_code llvm::vfs::TracingFileSystem::getRealPath ( const Twine & Path,
SmallVectorImpl< char > & Output )
inlineoverride

Definition at line 1187 of file VirtualFileSystem.h.

References llvm::vfs::ProxyFileSystem::getRealPath(), and NumGetRealPathCalls.

◆  isLocal()

std::error_code llvm::vfs::TracingFileSystem::isLocal ( const Twine & Path,
bool & Result )
inlineoverride

Definition at line 1198 of file VirtualFileSystem.h.

References llvm::vfs::ProxyFileSystem::isLocal(), and NumIsLocalCalls.

◆  openFileForRead()

ErrorOr< std::unique_ptr< File > > llvm::vfs::TracingFileSystem::openFileForRead ( const Twine & Path )
inlineoverride

Definition at line 1177 of file VirtualFileSystem.h.

References NumOpenFileForReadCalls, and llvm::vfs::ProxyFileSystem::openFileForRead().

◆  printImpl()

void TracingFileSystem::printImpl ( raw_ostream & OS,
PrintType Type,
unsigned IndentLevel ) const
overrideprotected

Definition at line 2957 of file VirtualFileSystem.cpp.

References NumDirBeginCalls, NumExistsCalls, NumGetRealPathCalls, NumIsLocalCalls, NumOpenFileForReadCalls, NumStatusCalls, and llvm::Type::print().

◆  status()

ErrorOr< Status > llvm::vfs::TracingFileSystem::status ( const Twine & Path )
inlineoverride

Definition at line 1172 of file VirtualFileSystem.h.

References NumStatusCalls, and llvm::vfs::ProxyFileSystem::status().

Member Data Documentation

◆  ID

const char TracingFileSystem::ID = 0
static

Definition at line 1160 of file VirtualFileSystem.h.

◆  NumDirBeginCalls

std::size_t llvm::vfs::TracingFileSystem::NumDirBeginCalls = 0

Definition at line 1164 of file VirtualFileSystem.h.

Referenced by dir_begin(), and printImpl().

◆  NumExistsCalls

std::size_t llvm::vfs::TracingFileSystem::NumExistsCalls = 0

Definition at line 1166 of file VirtualFileSystem.h.

Referenced by exists(), and printImpl().

◆  NumGetRealPathCalls

std::size_t llvm::vfs::TracingFileSystem::NumGetRealPathCalls = 0

Definition at line 1165 of file VirtualFileSystem.h.

Referenced by getRealPath(), and printImpl().

◆  NumIsLocalCalls

std::size_t llvm::vfs::TracingFileSystem::NumIsLocalCalls = 0

Definition at line 1167 of file VirtualFileSystem.h.

Referenced by isLocal(), and printImpl().

◆  NumOpenFileForReadCalls

std::size_t llvm::vfs::TracingFileSystem::NumOpenFileForReadCalls = 0

Definition at line 1163 of file VirtualFileSystem.h.

Referenced by openFileForRead(), and printImpl().

◆  NumStatusCalls

std::size_t llvm::vfs::TracingFileSystem::NumStatusCalls = 0

Definition at line 1162 of file VirtualFileSystem.h.

Referenced by printImpl(), and status().


The documentation for this class was generated from the following files:

Generated on for LLVM by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /