Statistics collection

New Message Reply Date view Thread view Subject view Author view

Jay Gischer (gischer++at++knex.engr.sgi.com)
Thu, 6 Aug 1998 09:37:34 -0700 (PDT)


Javier Abadia Miranda writes:
> Hello!
>
> I want to collect statistics about my application in various situations.
> The app is developed over perfly.
>
> I would like that the app could write a line to a file
> for each frame with this contents.
>
> frame_number app_time cull_time draw_time dbase_time
>
> I know that there is similar functionality in perfly, but I don't
> understand the statistics API very well.
>
> Can someone tell me an easy way to modify perfly to get this kind of
> output?
>
>
What's below is at the 95% confidence level. If someone out there
sees a mistake or wishes to make a clarification, by all means, jump
in.

First you want to enable collection of the stats. This must be done
before the frame to be measured is processed, possibly before any
frames are rendered. This is accomplished by a call of
pfFrameStats::setClass:

  pfChannel chan; // This is set to the channel you want to measure
  chan->getFStats()->setClass(PFFSTATS_ENPFTIMES, PFSTATS_SET);

...

Then after each frame is processed you will want to get your hands on
the data collected for that frame. This will be accomplished by
sending a query token and a buffer to the pfFrameStats class via the
pfFrameStats::query() routine.

        // This is a buffer
        pfFStatsValPFTimesHistLast valbuf;
        (void)chan->getFStats()->query(PFFSTATSVAL_PFTIMES_HIST_LAST,
                                       (float *)valbuf,
                                       sizeof(valbuf));

        printf("frame number = %d", valbuf.appFrame);
        printf(" app time = %e", valbuf.app.enterSync - valbuf.app.start);
        printf(" cull time = %e", valbuf.cull.end - valbuf.cull.start);
        // and so on. Check the pfFStatsValPFTimeHistLast structure
        // and its substructures in pfFrameStats.h for details
        // of all the different nodes

------------------------------------------------------------------------
Jay L Gischer + "I see great things in baseball. It's our game.
Silicon Graphics + It will repair our losses and be a blessing to us."
(650) 390-4277 + -Walt Whitman
gischer++at++sgi.com +
                     + "A life has no meaning except in the impact it
                     + has on other lives"
                     + -Jackie Robinson

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Aug 11 1998 - 13:42:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.