LLVM 23.0.0git
llvm::vfs::TracingFileSystemImpl< CounterT > Class Template 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::TracingFileSystemImpl< CounterT >:
[legend]

Public Member Functions

 TracingFileSystemImpl (llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS)
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< TracingFileSystemImpl< CounterT >, ProxyFileSystem >
const void * dynamicClassID () const override
bool isA () const
 Check whether this instance is a subclass of QueryT.

Public Attributes

CounterT NumStatusCalls = 0
CounterT NumOpenFileForReadCalls = 0
CounterT NumDirBeginCalls = 0
CounterT NumGetRealPathCalls = 0
CounterT NumExistsCalls = 0
CounterT NumIsLocalCalls = 0

Static Public Attributes

static const char ID = 0

Protected Member Functions

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

Additional Inherited Members

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

Detailed Description

template<typename CounterT>
class llvm::vfs::TracingFileSystemImpl< CounterT >

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.

Templated on the counter type so callers can choose between non-atomic counters (suitable for single-threaded tracing) and atomic counters (suitable for tracing under concurrent access). Use the TracingFileSystem and AtomicTracingFileSystem aliases below.

Definition at line 1166 of file VirtualFileSystem.h.

Constructor & Destructor Documentation

◆ TracingFileSystemImpl()

template<typename CounterT>
llvm::vfs::TracingFileSystemImpl< CounterT >::TracingFileSystemImpl ( llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS)
inline

Definition at line 1179 of file VirtualFileSystem.h.

Member Function Documentation

◆ dir_begin()

template<typename CounterT>
directory_iterator llvm::vfs::TracingFileSystemImpl< CounterT >::dir_begin ( const Twine & Dir,
std::error_code & EC )
inlineoverride

Definition at line 1193 of file VirtualFileSystem.h.

◆ exists()

template<typename CounterT>
bool llvm::vfs::TracingFileSystemImpl< CounterT >::exists ( const Twine & Path)
inlineoverride

Definition at line 1204 of file VirtualFileSystem.h.

◆ getRealPath()

template<typename CounterT>
std::error_code llvm::vfs::TracingFileSystemImpl< CounterT >::getRealPath ( const Twine & Path,
SmallVectorImpl< char > & Output )
inlineoverride

Definition at line 1198 of file VirtualFileSystem.h.

◆ isLocal()

template<typename CounterT>
std::error_code llvm::vfs::TracingFileSystemImpl< CounterT >::isLocal ( const Twine & Path,
bool & Result )
inlineoverride

Definition at line 1209 of file VirtualFileSystem.h.

◆ openFileForRead()

template<typename CounterT>
ErrorOr< std::unique_ptr< File > > llvm::vfs::TracingFileSystemImpl< CounterT >::openFileForRead ( const Twine & Path)
inlineoverride

Definition at line 1188 of file VirtualFileSystem.h.

◆ printImpl()

template<typename CounterT>
void llvm::vfs::TracingFileSystemImpl< CounterT >::printImpl ( raw_ostream & OS,
FileSystem::PrintType Type,
unsigned IndentLevel ) const
inlineoverrideprotected

Definition at line 1215 of file VirtualFileSystem.h.

◆ status()

template<typename CounterT>
ErrorOr< Status > llvm::vfs::TracingFileSystemImpl< CounterT >::status ( const Twine & Path)
inlineoverride

Definition at line 1183 of file VirtualFileSystem.h.

Member Data Documentation

◆ ID

template<typename CounterT>
const char llvm::vfs::TracingFileSystemImpl< CounterT >::ID = 0
inlinestatic

Definition at line 1170 of file VirtualFileSystem.h.

◆ NumDirBeginCalls

template<typename CounterT>
CounterT llvm::vfs::TracingFileSystemImpl< CounterT >::NumDirBeginCalls = 0

Definition at line 1174 of file VirtualFileSystem.h.

◆ NumExistsCalls

template<typename CounterT>
CounterT llvm::vfs::TracingFileSystemImpl< CounterT >::NumExistsCalls = 0

Definition at line 1176 of file VirtualFileSystem.h.

◆ NumGetRealPathCalls

template<typename CounterT>
CounterT llvm::vfs::TracingFileSystemImpl< CounterT >::NumGetRealPathCalls = 0

Definition at line 1175 of file VirtualFileSystem.h.

◆ NumIsLocalCalls

template<typename CounterT>
CounterT llvm::vfs::TracingFileSystemImpl< CounterT >::NumIsLocalCalls = 0

Definition at line 1177 of file VirtualFileSystem.h.

◆ NumOpenFileForReadCalls

template<typename CounterT>
CounterT llvm::vfs::TracingFileSystemImpl< CounterT >::NumOpenFileForReadCalls = 0

Definition at line 1173 of file VirtualFileSystem.h.

◆ NumStatusCalls

template<typename CounterT>
CounterT llvm::vfs::TracingFileSystemImpl< CounterT >::NumStatusCalls = 0

Definition at line 1172 of file VirtualFileSystem.h.


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