RavEngine
Loading...
Searching...
No Matches
physx::profile::PxProfileZone Class Referenceabstract

The profiling system was setup in the expectation that there would be several systems that each had its own island of profile information. PhysX, client code, and APEX would be the first examples of these. Each one of these islands is represented by a profile zone. More...

#include <PxPvdProfileZone.h>

Inheritance diagram for physx::profile::PxProfileZone:
[legend]
Collaboration diagram for physx::profile::PxProfileZone:
[legend]

Public Member Functions

virtual const char * getName ()=0
 Get profile zone name.
 
virtual void release ()=0
 Release the profile zone.
 
virtual void setProfileZoneManager (PxProfileZoneManager *inMgr)=0
 Set profile zone manager for the zone.
 
virtual PxProfileZoneManager * getProfileZoneManager ()=0
 Get profile zone manager for the zone.
 
virtual uint16_t getEventIdForName (const char *inName)=0
 Get or create a new event id for a given name. If you pass in a previously defined event name (including one returned) from the name provider) you will just get the same event id back.
 
virtual void flushEventIdNameMap ()=0
 Specifies that it is a safe point to flush read-write name map into read-only map. Make sure getEventIdForName is not called from a different thread.
 
virtual uint16_t getEventIdsForNames (const char **inNames, uint32_t inLen)=0
 Reserve a contiguous set of profile event ids for a set of names.
 
- Public Member Functions inherited from physx::profile::PxProfileZoneClientManager
virtual void addClient (PxProfileZoneClient &inClient)=0
 Adds new client.
 
virtual void removeClient (PxProfileZoneClient &inClient)=0
 Removes a client.
 
virtual bool hasClients () const =0
 Check if manager has clients.
 
- Public Member Functions inherited from physx::profile::PxProfileNameProvider
virtual PxProfileNames getProfileNames () const =0
 Returns profile event names.
 
- Public Member Functions inherited from physx::profile::PxProfileEventSender
virtual void startEvent (uint16_t inId, uint64_t contextId)=0
 Send a start profile event, optionally with a context. Events are sorted by thread and context in the client side.
 
virtual void stopEvent (uint16_t inId, uint64_t contextId)=0
 Send a stop profile event, optionally with a context. Events are sorted by thread and context in the client side.
 
virtual void startEvent (uint16_t inId, uint64_t contextId, uint32_t threadId)=0
 Send a start profile event, optionally with a context. Events are sorted by thread and context in the client side.
 
virtual void stopEvent (uint16_t inId, uint64_t contextId, uint32_t threadId)=0
 Send a stop profile event, optionally with a context. Events are sorted by thread and context in the client side.
 
virtual void atEvent (uint16_t inId, uint64_t contextId, uint32_t threadId, uint64_t start, uint64_t stop)=0
 
virtual void eventValue (uint16_t inId, uint64_t contextId, int64_t inValue)=0
 Set an specific events value. This is different than the profiling value for the event; it is a value recorded and kept around without a timestamp associated with it. This value is displayed when the event itself is processed.
 
- Public Member Functions inherited from physx::profile::PxProfileEventFlusher
virtual void flushProfileEvents ()=0
 Flush profile events. Sends the profile event buffer to hooked clients.
 

Static Public Member Functions

static PxProfileZone & createProfileZone (PxAllocatorCallback *inAllocator, const char *inSDKName, PxProfileNames inNames=PxProfileNames(), uint32_t inEventBufferByteSize=0x10000)
 Create a new profile zone.

 

Additional Inherited Members

- Static Public Attributes inherited from physx::profile::PxProfileEventSender
static const uint32_t CrossThreadId = 99999789
 Use this as a thread id for events that start on one thread and end on another.
 
- Protected Member Functions inherited from physx::profile::PxProfileNameProvider
PxProfileNameProvider & operator= (const PxProfileNameProvider &)
 

Detailed Description

The profiling system was setup in the expectation that there would be several systems that each had its own island of profile information. PhysX, client code, and APEX would be the first examples of these. Each one of these islands is represented by a profile zone.

A profile zone combines a name, a place where all the events coming from its interface can flushed, and a mapping from event number to full event name.

It also provides a top level filtering service where profile events can be filtered by event id.

The profile zone implements a system where if there is no one listening to events it doesn't provide a mechanism to send them. In this way the event system is short circuited when there aren't any clients.

All functions on this interface should be considered threadsafe.

See also
PxProfileZoneClientManager, PxProfileNameProvider, PxProfileEventSender, PxProfileEventFlusher

Member Function Documentation

◆ createProfileZone()

PxProfileZone & physx::profile::PxProfileZone::createProfileZone ( PxAllocatorCallback *  inAllocator,
const char *  inSDKName,
PxProfileNames  inNames = PxProfileNames(),
uint32_t  inEventBufferByteSize = 0x10000 
)
static

Create a new profile zone.

Parameters
inAllocatormemory allocation is controlled through the foundation if one is passed in.
inSDKNameName of the profile zone; useful for clients to understand where events came from.
inNamesMapping from event id -> event name.
inEventBufferByteSizeSize of the canonical event buffer. This does not need to be a large number as profile events are fairly small individually.
Returns
a profile zone implementation.

◆ flushEventIdNameMap()

virtual void physx::profile::PxProfileZone::flushEventIdNameMap ( )
pure virtual

Specifies that it is a safe point to flush read-write name map into read-only map. Make sure getEventIdForName is not called from a different thread.

Implemented in physx::profile::ZoneImpl< TNameProvider >.

◆ getEventIdForName()

virtual uint16_t physx::profile::PxProfileZone::getEventIdForName ( const char *  inName)
pure virtual

Get or create a new event id for a given name. If you pass in a previously defined event name (including one returned) from the name provider) you will just get the same event id back.

Parameters
inNameProfile event name.

Implemented in physx::profile::ZoneImpl< TNameProvider >.

◆ getEventIdsForNames()

virtual uint16_t physx::profile::PxProfileZone::getEventIdsForNames ( const char **  inNames,
uint32_t  inLen 
)
pure virtual

Reserve a contiguous set of profile event ids for a set of names.

This function does not do any meaningful error checking other than to ensure that if it does generate new ids they are contiguous. If the first name is already registered, that is the ID that will be returned regardless of what other names are registered. Thus either use this function alone (without the above function) or don't use it.
If you register "one","two","three" and the function returns an id of 4, then "one" is mapped to 4, "two" is mapped to 5, and "three" is mapped to 6.

Parameters
inNamesset of names to register.
inLenLength of the name list.
Returns
The first id associated with the first name. The rest of the names will be associated with monotonically incrementing uint16_t values from the first id.

Implemented in physx::profile::ZoneImpl< TNameProvider >.

◆ getName()

virtual const char * physx::profile::PxProfileZone::getName ( )
pure virtual

Get profile zone name.

Returns
Zone name.

Implemented in physx::profile::ZoneImpl< TNameProvider >.

◆ getProfileZoneManager()

virtual PxProfileZoneManager * physx::profile::PxProfileZone::getProfileZoneManager ( )
pure virtual

Get profile zone manager for the zone.

Returns
Profile zone manager.

Implemented in physx::profile::ZoneImpl< TNameProvider >.

◆ release()

virtual void physx::profile::PxProfileZone::release ( )
pure virtual

Release the profile zone.

Implemented in physx::profile::ZoneImpl< TNameProvider >.

◆ setProfileZoneManager()

virtual void physx::profile::PxProfileZone::setProfileZoneManager ( PxProfileZoneManager *  inMgr)
pure virtual

Set profile zone manager for the zone.

Parameters
inMgrProfile zone manager.

Implemented in physx::profile::ZoneImpl< TNameProvider >.


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