RE: Q reg using prof/gprof to profile 4GL or ESQL/C programs
Posted in 1997
David Thanks a million. You were right, the shared libraries needed to be = linked in. The library on my system (a HP-UX 10.x) is libdl.sl so the = command to compile a 4GL with gprof would be: c4gl -G myprog.4gl -o myprog.4ge -ldld Following that I was able to run the program through gprof and generate = a usage profile. Thanks again for your help. Sujit Pal ---------- From: David Williams[SMTP:djw@smooth1.demon.co.uk] Sent: Wednesday, December 03, 1997 1:25 PM To: informix-list@rmy.emory.edu Subject: Re: Q reg using prof/gprof to profile 4GL or ESQL/C programs In article <6624me$efp@cssun.mathcs.emory.edu>, Jonathan Leffler <johnl@informix.com> writes >On Mon, 24 Nov 1997, Sujit Pal wrote: > >} Hi all >}=20 >} I have a question regarding use of the Unix utilities prof or gprof = to >} profile 4GL or ESQL/C programs. Adding either -p (for prof) or -G = (for >} gprof, I am on HP-UX 10.01) to c4gl I get unsatisfied symbols from = the >} linker. For example, if I say: >}=20 >} c4gl -G myprog.4gl -o myprog.4ge >}=20 >} I get: >} /usr/ccs/bin/ld: Unsatisfied symbols: >} shl_findsym (code) >} shl_load (code) These are look iike functions for shared library manipulation:- I know that on another platform dl_open opens a shared library dl_sym is used find a function in a librart (pass the name of the function in a string and receive a pointer to the function so you can call it). I would excpect shl_load and shl_findsym to be similar to the above. In which case you have to include the library for handling shared=20 librarries (!) :- c4gl -G myprog.4gl -o myprog.4ge -ldl Try doing a man on shl_load and shl_sym. >}=20 >} Any idea where I can find these functions? Is there a workaround? = Or is >} there no way I can use prof or gprof to profile my 4GL or ESQL/C >} programs? > >Since the I4GL and ESQL/C libraries are not provided in a profiled = format, there >isn't anything you can do with tools such as prof or gprof which = require >special compilations to work. > >If you want to deal with this, you could consider Quantify from = Rational >(http://www.rational.com) which works with object code as is. You = wouldn't >get as accurate diagnostics on the internals of the Informix libraries = as >you would with a debug build, but you would be able to do profiling. > >} BTW I tried to create a .c file using -phase argument of c4gl and = then do >} a cc -G on the .c file, but the result was the same. > >Good; it should be the same. The problem is that the shared library = was >not built for profiling, I'm pretty sure. The shl_xyz names are not = part >of Informix's code... > >Yours, >Jonathan Leffler (johnl@informix.com) #include <witticism.h> > --=20 David Williams