Re: Performer + Purify + DSO problem

New Message Reply Date view Thread view Subject view Author view

Daniel C. Williams X-2453 (dcw++at++sarnoff.com)
Fri, 5 Jul 1996 17:36:47 -0400 (EDT)


According to Todd R Pravata:
>
>> I get around this by creating a module with my own amalloc, acalloc, ... etc
>> functions. In each of these I compare the incoming arena pointer to that
>> returned by pfGetSharedArena(). If they are equal I call the non-shared
>> memory equivalent function, else I call the real function (_amalloc,
>> _acalloc, ...). When I want to use Purify I link with this module and make
>> sure to run in single process mode.
>>
>> Dan
>> --
>> Daniel Williams, Independent Consultant
>> Voice: (215) 885-1573
>> Email: dcw++at++sarnoff.com, dan++at++sass.com
>
>Thanks. Any chance you would like to share your code with me (or the
>rest of the Performer community)?
>
>--
>Todd Pravata
>todd.pravata++at++ti.com 214-575-6126
>Visual Simulation Lab, Texas Instruments
>
I would love to, but it's a work for hire and I don't have the rights
to do that. The last time I tried to get permission to publish a short
code excerpt from a related project, it took a month or two to die on
someone's desk. So I'm afraid that's not a good option. Instead, here's
a little more detail on replicating what I've done so you can rewrite
the module and post it. It should be 50 - 100 lines long.

Performer uses functions from the amalloc(3p) library to place many of its
objects in the shared memory arena that it creates. If all Performer stages
are in one process this is unnecessary; if we could fool Performer into
placing those objects on the heap instead Purify would be able to trace
them.

We fool Performer by writing a module that defines our own versions of
most of the functions from the amalloc(3p) library, but not acreate nor
adelete. All the other functions from the amalloc(3p) library take an
arena pointer as an argument. In each of our functions we compare the
arena pointer argument to the value returned by pfGetSharedArena(). If
they are equal we call the corresponding function from the non-shared
memory library malloc(3c), i.e., for a call to acalloc we instead call
calloc. If the pointers are unequal we forward the call unmolested
to the real implementation, i.e., for a call to acalloc we call
_acalloc.

The resulting object file should be linked just before -lmalloc and -lc.

Remember, this only works if all Performer stages are in one process.

One other thing: "-pointer-offset=16" is a good option to give to Purify
to eliminate spurious PLKs; see /usr/include/Performer/pr/pfMemory.h for
why this is so.

Good luck,
Dan

-- 
Daniel Williams, Independent Consultant
Voice: (215) 885-1573
Email: dcw++at++sarnoff.com, dan++at++sass.com
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/   <--new!
            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 Mon Aug 10 1998 - 17:53:09 PDT

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