WSF
profiling::ProfilingHooks Struct Reference

Set of all function pointers used for profiling. More...

#include <ProfilingHooks.hpp>

Public Attributes

ProfilingInterfaceVersionFunc mInterfaceVersion = nullptr
 Callback for getting the version number of the profiling interface that the library provides.
ProfilingInitializeFunc mInitialize = nullptr
 Callback for initializing the profiling library.
BeginProfilingRegionFunc mBeginRegion = nullptr
 Callback for beginning a profiling region.
EndProfilingRegionFunc mEndRegion = nullptr
 Callback for ending the last profiling region that was begun.
CreateProfilingSectionFunc mCreateSection = nullptr
 Callback for creating a profiling section.
DestroyProfilingSectionFunc mDestroySection = nullptr
 Callback for destroying a profiling section.
BeginProfilingSectionFunc mBeginSection = nullptr
 Callback for beginning a profiling section.
EndProfilingSectionFunc mEndSection = nullptr
 Callback for ending a profiling section.
ProfilingFinalizeFunc mFinalize = nullptr
 Callback for finalizing the profiling library.

Detailed Description

Set of all function pointers used for profiling.

The caller must check that any of these function pointers is not null before invoking the function. If either of mInitialize or mFinalize is null, then none of the function pointers may be called. None of these functions may be called by multiple threads concurrently.

Here are the rules governing which functions may be called when, relative to library initialization and finalization.

  1. It is always legal to call mInterfaceVersion, at any time after loading the library.
  2. No function in this struct other than mInterfaceVersion may be called before the call to mInitialize succeeds.
  3. mInitialize may be called at most once.
  4. If the call to mInitialize fails, then no function may be called, other than mInterfaceVersion.
  5. If mInitialize succeeds, then mFinalize must be called exactly once, at some point after mInitialize returns.
  6. No function other than mInterfaceVersion may be called after mFinalize returns.

Member Data Documentation

◆ mBeginRegion

BeginProfilingRegionFunc profiling::ProfilingHooks::mBeginRegion = nullptr

Callback for beginning a profiling region.

The one argument is the name of the profiling region. Regions must be nested; that is, ending a region always ends the last region that was begun.

Referenced by profiling::ProfilingRegion::ProfilingRegion().

◆ mBeginSection

BeginProfilingSectionFunc profiling::ProfilingHooks::mBeginSection = nullptr

Callback for beginning a profiling section.

The one argument is the key (from creating the section). Every section that has been begun must be ended. After being ended, a section may be begun again.

We permit multiple threads to call this function concurrently with different keys. We do not permit multiple threads to call this function concurrently with the same key.

Referenced by profiling::BeginProfilingSection().

◆ mCreateSection

CreateProfilingSectionFunc profiling::ProfilingHooks::mCreateSection = nullptr

Callback for creating a profiling section.

The one argument is the (string) name of the profiling section. Section labels need not be unique. Calling this function twice with the same label shall result in distinct keys, referring to distinct sections.

Its return value is the section "key." Keys are unique.

Sections differ from regions (see above) in the following ways.

  1. Sections are allowed to overlap partially.
  2. Section creation happens separately from beginning a section.
  3. Section destruction happens separately from ending a section.

Referenced by profiling::CreateProfilingSection().

◆ mDestroySection

DestroyProfilingSectionFunc profiling::ProfilingHooks::mDestroySection = nullptr

Callback for destroying a profiling section.

The one argument is the key for the section to destroy. For each unique key created by mCreateSection, mDestroySection must be called exactly once with that key.

Referenced by profiling::DestroyProfilingSection().

◆ mEndRegion

EndProfilingRegionFunc profiling::ProfilingHooks::mEndRegion = nullptr

Callback for ending the last profiling region that was begun.

Referenced by profiling::ProfilingRegion::~ProfilingRegion().

◆ mEndSection

EndProfilingSectionFunc profiling::ProfilingHooks::mEndSection = nullptr

Callback for ending a profiling section.

The one argument is the key (from creating the section). The key must refer to a section that has been begun. Every section that has been begun must be ended. After being ended, a section may be begun again.

We permit multiple threads to call this function concurrently with different keys. We do not permit multiple threads to call this function concurrently with the same key.

Referenced by profiling::EndProfilingSection().

◆ mFinalize

ProfilingFinalizeFunc profiling::ProfilingHooks::mFinalize = nullptr

Callback for finalizing the profiling library.

Calling any profiling library function (including this one) after this function has been called, other than the interface version function, is undefined behavior.

◆ mInitialize

ProfilingInitializeFunc profiling::ProfilingHooks::mInitialize = nullptr

Callback for initializing the profiling library.

The initialization function takes one argument, a string specifying the output destination. The format is a URI, with supported schemes and final interpretation defined by the profiling library.

Its return value is a POSIX-style signed integer error code (zero means success).

◆ mInterfaceVersion

ProfilingInterfaceVersionFunc profiling::ProfilingHooks::mInterfaceVersion = nullptr

Callback for getting the version number of the profiling interface that the library provides.

The caller (the application) is responsible for checking that this matches (is equal to) the version number of the interface that the caller expects. If the version numbers are not the same, then invoking any symbol in the library other than this one is undefined behavior.


The documentation for this struct was generated from the following file:
Copyrights Multiple, All Rights Reserved