Re: Re: Performance problems

New Message Reply Date view Thread view Subject view Author view

F. KUIJPER 446/3H06/2-5 (Kuijper++at++fel.tno.nl)
14 Jun 95 09:58:50 EDT


Hi there,

Thanks (Steve Baker, Javier Castellar Arribas, Sharon Rose Clay) for
your responses to my problems. Here are the results of my further
investigation.

----> Performance

I know see the problem of the graphics hardware context switching. As
I understand it, the best way to handle this is just not to have the
graphics pipe do two things at the same time. I will run my
X-interface on a remote machine (something I do normally anyway,
since I want a full screen visual display).

Javier suggests to synchronise the X interface and the visual
simulation by using 'stopXplease' and 'startXplease'. Is this some
existing function, or do you mean to create a set of
application-specific semaphores?

----> Statistics display

Here is some more information on my statistics display problems.

I use Performer 1.2 (I dont know want the MR stands for, but in the
release notes of our Performer installation the product version code
is said to be SC4-PERF-1.2).

If I understand well, the easiest way to put up a statistics display
is just call pfDrawChanStats(). If I do this, without modifying
statistics class/mode enable settings, or channel statistics draw
modes, the system crashes with a core dump. DBX tells me:

> 0 pfFrameStats::drawChannel(pfChannel*)(0x1864d310, 0x1864cfa0,
0x0, 0x0) ["../../../lib/libpf/pfStats.C":2161, 0x5ffce108]
   1
pfChannel::updateDrawStats(pfChannel*,double,double,double)(0x1864cfa0, 0x18645500, 0x3f800000, 0xa) ["../../../lib/libpf/pfChannel.C":1503, 0x5ff8f86c]
   2 mpDraw(void)(0x2, 0x7bfcb8a0, 0x3f800000, 0xa)
["../../../lib/libpf/pfProcess.C":2244, 0x5ffbf9a0]
   3 pfConfig(0x2, 0x7bfcb8a0, 0x3f800000, 0xa)
["../../../lib/libpf/pfProcess.C":964, 0x5ffbafdc]
   4 InitProcesses()
["/usr/people/esaast/stw/frig5/src/StwOi/StwOiCvi/StwOiCvi_Performer.c":347, 0x4d59fc]
   5 StwOiCvi_PerformerConfig()
["/usr/people/esaast/stw/frig5/src/StwOi/StwOiCvi/StwOiCvi_Performer.c":170, 0x4d54c0]
   6 Initialise()
["/usr/people/esaast/stw/frig5/src/StwOi/StwOiCvi/StwOiCvi_Control.c":225, 0x4c73bc]
   7 StwOiCvi_Control(arg = 0x100c5d10, stack_size = 1000000)
["/usr/people/esaast/stw/frig5/src/StwOi/StwOiCvi/StwOiCvi_Control.c":102, 0x4c706c]
   8 _sprocsp() ["sproc.s":180, 0x754f1c]

I call pfDrawChanStats() in the post-draw part of the DRAW process,
however the crashing occurs in all cases (also in APPCULLDRAW, also
in APPCULL_DRAW with the pfDrawChanStats() called in APP).

I use some code to provide different statistics display modes:

NONE: don't display statistics
RATE: just display framerate
GRAPH: display framerate and APP/CULL/DRAW frame times graph
ALL: show rate, graph, #primitives (not implemented in the code shown
below)

Every time the statistics display mode changes, I call
SetChannelStatsCollection() and SetChannelStatsDrawMode(). See code
below.

The current behaviour of these functions (see source code below) is:

- NONE: works OK
- RATE: works OK (although I don't understand why PFTIMES_HIST is to
be enabled), shows 30.0/30.0
- GRAPH: shows 30.0/30.0, no graph...

I found great difficulty in setting up the stats collection and draw
mode. Many times, the system crased (same core dump as shown above).

Well, I think thats about enough information the world wants to
see...

I hope someone finds a clue for me!

Thanks, greetings.

Frido Kuijper
TNO Physics and Electronics Laboratory
The Hague
The Netherlands
phone: +31 70 3264221
fax: +31 70 3280961
email: frig5++at++fel.tno.nl

=================================================
Sourcecode:

/*
-------------------------------------------------------------------------
   FUNCTION : SetChannelStatsCollection
   PARAMETERS : chan = Channel pointer
   READ : StwOiCvi_state
   WRITE : -
   READ/WRITE : -
   RETURN : -
   DESCRIPTION : This function enables/disables the required
statistics
                 collection for the specified channel. The mode
required
                 collection dependents upon the draw.statistics
attribute
                 for the display the channel is part of.
    
------------------------------------------------------------------------- */

static void SetChannelStatsCollection (pfChannel *chan)
{
    StwOiCvi_CHANNEL_T *channel;
    StwOiCvi_DISPLAY_T *display;
    pfFrameStats *stats;

    channel = StwOiCvi_FindChannelState (chan);
    display = channel->display;

    stats = pfGetChanFStats (chan);

    switch (display->draw.statistics)
    {
        case StwOiCvi_STATS_OFF:
            /*
             * turn of all
             */
            pfStatsClass (stats,
                          PFSTATS_ALL,
                          PFSTATS_OFF);
            break;

        case StwOiCvi_STATS_RATE:
            /*
             * want frame rate
             */
            pfStatsClass (stats,
                          PFFSTATS_ENPFTIMES,
                          PFSTATS_SET);

            /*
             * I would expect that setting 'PFTIMES_BASIC' only
             * would be sufficient to get framerate statistics.
             * In this case however, I only get ???/30.0...
             * PFTIMES_HIST must be set also, to get framerate!?
             */
            pfStatsClassMode (stats,
                              PFFSTATS_PFTIMES,
                              PFFSTATS_PFTIMES_BASIC |
                              PFFSTATS_PFTIMES_HIST,
                              PFSTATS_SET);
            break;

        case StwOiCvi_STATS_GRAPH:
            /*
             * want frame rate and process times graph
             */
            pfStatsClass (stats,
                          PFFSTATS_ENPFTIMES,
                          PFSTATS_SET);

            pfStatsClassMode (stats,
                              PFFSTATS_PFTIMES,
                              PFFSTATS_PFTIMES_BASIC |
                              PFFSTATS_PFTIMES_HIST,
                              PFSTATS_SET);
            break;

        case StwOiCvi_STATS_ALL:
            /*
             * to be done: want frame rate, graph, #primitives, etc.
             */
            break;
    }
}

/*
-------------------------------------------------------------------------
   FUNCTION : SetChannelStatsDrawMode
   PARAMETERS : chan = Channel pointer
   READ : StwOiCvi_state
   WRITE : -
   READ/WRITE : -
   RETURN : -
   DESCRIPTION : This functions sets the appropriate statistics draw
mode
                 for the specified channel. The mode dependents upon
                 the draw.statistics attribute for the display the
                 channel is part of.
    
------------------------------------------------------------------------- */

static void SetChannelStatsDrawMode (pfChannel *chan)
{
    StwOiCvi_CHANNEL_T *channel;
    StwOiCvi_DISPLAY_T *display;

    channel = StwOiCvi_FindChannelState (chan);
    display = channel->display;

    switch (display->draw.statistics)
    {
        case StwOiCvi_STATS_OFF:
            pfChanStatsMode (chan,
                             PFCSTATS_DRAW,
                             PFSTATS_OFF);
            break;

        case StwOiCvi_STATS_RATE:
            pfChanStatsMode (chan,
                             PFCSTATS_DRAW,
                             PFFSTATS_PFTIMES_BASIC);
            break;

        case StwOiCvi_STATS_GRAPH:
            pfChanStatsMode (chan,
                             PFCSTATS_DRAW,
                             PFFSTATS_PFTIMES_BASIC |
                             PFFSTATS_PFTIMES_HIST);
            break;

        case StwOiCvi_STATS_ALL:
            /*
             * to be done
             */
            break;
    }
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:35 PDT

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