Public Member Functions

FBProfileTaskCycle Class Reference

Search for all occurrences

Detailed Description

FBProfileTaskCycle.

Real-time profiling information for a specific task. Profiling information can be collected for:

When profiling a scene within a MotionBuilder session you can discover what tasks are being performed when and for how long. You can use this information to troubleshoot lengthy or repetitive actions, and use MotionBuilder more efficiently.

A task is defined as a definite piece of work within MotionBuilder such as the evaluation of a character. If the same task is run numerous times it is called a task cycle. From within a scene, the hierary and dependents of the scene make up the task cycles. A task cycle spends its time computing a specific task within a task parent cycle.

A task parent cycle is a hierarchy of individual task cycles, where the parent and child relationship is known to MotionBuilder and displayed in the profiling center.

For example, these are all task cycles which are all parented to each other; Eval is parent of TransformNode_Active, which is a parent of Constraint, which is a parent of Character, which is in turn a parent of TransformNode_Active.

This is because the evaluation is called for one model which triggers evaluation of the character which then calls the evaluation of the rest of IK/FK models.

When an evaluation starts, it calls the evaluation of the character, the time will be computed for time spent on the sample. Then possibly another character is evaluated, so again the time will be computed for the time spent on this sample. This time will be added to the previous sample since that evaluation has not finished yet. The evaluation here is parented, since they both have started but not finished, all children samples are summed. When the evaluation stops, you change the sample for the children.

Note: The evaluation dependency/order will be different for each scene.

As you can see profiling of task cycles is done by collecting samples. Samples are added to one inside parent sample. The number of samples collected is controlled by the profiler buffer size property.

Here are the steps to add profiling into a constraint, a device, or any other class that uses real-time evaluation: 1) Declare FBProfiler_CreateTaskCycle( MyConstraint, 0.5, 0.5, 0.5 ) in MyConstraint.cxx, before the constructor and AnimationNodeNotify function. 2) Set up FBProfiling_SetupTaskCycle( MyConstraint ) in the constuctor MyConstraint::MyConstraint(). 3) At the beginning of MyConstraint::AnimationNodeNotify create the variable: FBProfilerHelper lProfiling( FBProfiling_TaskCycleIndex( MyConstraint ), pEvaluateInfo ); The sample for task will start at the creation of FBProfilerHelper object and stop at the destruction of this object, when returning from AnimationNodeNotify will be done.

Definition at line 128 of file fbprofiler.h.

#include <fbprofiler.h>

List of all members.

Public Member Functions

int  GetIndex ()
  Get the unique registration index for each cycle.
const char *  GetName ()
  Get the name of task cycle.
const float *  GetColor ()
  Get the color of the task cycle.
void  GetAvgMinMaxUsage (double &pAvg, double &pMin, double &pMax)
  Get the task cycle's average, minimum and maximum usage.
void  Start ()
  Start of task cycle sample.
void  Stop ()
  Stop of task cycle sample.
bool  IsStarted ()
  Test to see if sampling has started.
int  GetChildCount ()
  Get number of child tasks.
HFBProfileTaskCycle  GetChild (int pIndex)
  Get child task based on specific index.

Member Function Documentation

int GetIndex ( )

Get the unique registration index for each cycle.

const char* GetName ( )

Get the name of task cycle.

const float* GetColor ( )

Get the color of the task cycle.

Used in profiling Center for drawing.

void GetAvgMinMaxUsage ( double &  pAvg,
double &  pMin,
double &  pMax 
)

Get the task cycle's average, minimum and maximum usage.

Results will vary on buffer size. When profiling is disabled all values are set to 1.

Return values:
pAvg Average time spend for computation of task (in micro seconds).
pMin Minimum time spend for computation of task (in micro seconds).
pMax Maximum time spend for computation of task (in micro seconds).
void Start ( )

Start of task cycle sample.

In most cases should be controlled by FBProfilerHelper.

void Stop ( )

Stop of task cycle sample.

In most cases should be controlled by FBProfilerHelper.

bool IsStarted ( )

Test to see if sampling has started.

int GetChildCount ( )

Get number of child tasks.

Task cycles are organized in a hierarchy which is dependent on the scene. Samples can be cumulative in the parent task cycle, or independent. For example, all character evaluation samples will be cumulated in one evaluation cycle.

Returns:
Number of child tasks.
HFBProfileTaskCycle GetChild ( int  pIndex )

Get child task based on specific index.

Can return NULL if child index is not used.

Parameters:
pIndex Child index.
Returns:
Child at given index.

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

FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle
FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle FBProfileTaskCycle