PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
Profiling.h File Reference

Profiling utilities for the Physics-Based Animation Toolkit (PBAT) More...

#include "PhysicsBasedAnimationToolkitExport.h"
#include <map>
#include <string>
#include <string_view>
#include <type_traits>

Go to the source code of this file.

Namespaces

namespace  pbat
 The main namespace of the library.
 

Macros

#define PBAT_PROFILE_SCOPE
 
#define PBAT_PROFILE_NAMED_SCOPE(name)
 
#define PBAT_PROFILE_LOG(txt, size)
 
#define PBAT_PROFILE_SCOPED_LOG(txt, size)
 
#define PBAT_PROFILE_PLOT(name, value)
 

Functions

void pbat::profiling::BeginFrame (std::string_view name)
 Begin a profiling frame with the given name.
 
void pbat::profiling::EndFrame (std::string_view name)
 End the current profiling frame.
 
bool pbat::profiling::IsConnectedToServer ()
 Check if PBAT's Tracy client is connected to the Tracy profiler server.
 
template<class Func, class... Args>
std::invoke_result_t< Func, Args... > pbat::profiling::Profile (std::string const &zoneName, Func &&f, Args &&... args)
 Profile a function as a Tracy named zone.
 

Detailed Description

Profiling utilities for the Physics-Based Animation Toolkit (PBAT)

Author
Quoc-Minh Ton-That (tonth.nosp@m.at.q.nosp@m.uocmi.nosp@m.nh@g.nosp@m.mail..nosp@m.com)
Date
2025-02-10

Function Documentation

◆ BeginFrame()

PBAT_API void pbat::profiling::BeginFrame ( std::string_view name)

Begin a profiling frame with the given name.

Precondition
The frame name's length must not exceed 256 characters
Parameters
nameFrame name

◆ EndFrame()

PBAT_API void pbat::profiling::EndFrame ( std::string_view name)

End the current profiling frame.

Precondition
The frame name's length must not exceed 256 characters
Parameters
nameFrame name

◆ IsConnectedToServer()

PBAT_API bool pbat::profiling::IsConnectedToServer ( )

Check if PBAT's Tracy client is connected to the Tracy profiler server.

Returns
true if connected, false otherwise

◆ Profile()

template<class Func, class... Args>
std::invoke_result_t< Func, Args... > pbat::profiling::Profile ( std::string const & zoneName,
Func && f,
Args &&... args )

Profile a function as a Tracy named zone.

Template Parameters
FuncType of the function to profile
ArgsTypes of the arguments to the function
Parameters
zoneNameName of the zone
fFunction to profile
argsArguments to the function
Returns
Result of the function
Note
This function is only available if the Tracy profiler is enabled