Download IRIS Performer™ Programmer`s Guide

Transcript
Collecting and Accessing Statistics in Your Application
hardware (such as graphics hardware and CPU); be careful to make such
calls only from the relevant process. pfEnableStatsHw() expects
PFSTATSHW_EN* bitmask tokens. Statistics classes which have
corresponding statistics hardware have a PFSTATSHW_ prefix in their token
names.
In a libpf application, IRIS Performer takes care of enabling the correct
hardware modes that correspond to enabled classes of statistics. For more
information about specific statistics classes, see the pfFrameStats(3pf) and
pfStats(3pf) reference pages.
Reducing the Cost of Statistics
Collecting and displaying statistics can have a big impact on performance.
This section describes ways to reduce that impact.
Enabling Only Statistics of Interest
Each channel has its Process Frame Times (PFTIMES) statistics class enabled
by default. This class maintains a short history of process frames times, as
well as averaging frame times over the default update period of two
seconds.
To minimize unnecessary overhead, turn off statistics on channels when
you’re not using them. To turn off all statistics for a channel, call
pfFStatsClass() in the application process with the statistics structure of the
given channel:
pfFStatsClass(pfGetChanFStats(chan), PFSTATS_ALL,
PFSTATS_OFF);
Each statistics class has default mode settings. The short history of process
frame time is used to draw the timing graph. By default, this history consists
of four frames of each IRIS Performer process (app, cull, draw, intersections).
Maintaining this short history of statistics can be disabled by calling
pfStatsClassMode() with the token PFFSTATS_PFTIMES_HIST:
pfStatsClassMode(fstats, PFFSTATS_PFTIMES,
PFFSTATS_PFTIMES_HIST, PFSTATS_OFF);
439