bagchi@eecs.umich.edu (Ranjan Bagchi) (04/14/91)
As should be apparent to those interested, running programs like
prof or gprof on an X application just doesn't work, or at least if
its done as outlined in the man pages.
Has anyone succeeded in profiling their X code?
-rj
--
--------------------------------------------------------------------------------
Ranjan Bagchi - asleep...... | v,i,j,k,l,s,a[99];
bagchi@eecs.umich.edu | main() {
------------------------------- for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i<s,j+=(v=j<s&&(!k&&!!printf(2+"\n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++l||a[i]<s&&v&&v-i+j&&v+i-j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&++a[--i]) ;
} /* Osovlanski and Nissenbaum */
--------------------------------------------------------------------------------
erc@pai.UUCP (Eric F. Johnson) (04/16/91)
In <BAGCHI.91Apr13182441@snarf.eecs.umich.edu>, Ranjan Bagchi writes: >As should be apparent to those interested, running programs like >prof or gprof on an X application just doesn't work, or at least if >its done as outlined in the man pages. >Has anyone succeeded in profiling their X code? >Ranjan Bagchi >bagchi@eecs.umich.edu I'm not sure what is meant by profiling an application "as outlined in the man pages," but I feel that I have successfully run prof on profile data from an X application on various flavors of UNIX on various architectures. 1) I compile with -a for tcov-based profiling or -p for prof-based profiling. 2) I did not compile the X libraries for profiling, which is fine since our product must run on vendor-supported "standard" X platforms, whatever that means. (We're not optimizing the X libraries.) 3) After running our program, I run prof or tcov. Here's the beginning of the last prof report I ran (in this case on an HP 825 running HP-UX 7.0): %Time Seconds Cumsecs #Calls msec/call Name 96.033663.9133663.91 $$mulI 0.9 302.2433966.15 _mcount 0.6 194.0734160.2241402178 0.00 memcpy 0.1 43.2334389.89 1817682 0.02 BPLResolveToValue 0.1 38.0034427.89 227434 0.17 BPLExecutionSetup 0.1 37.8534465.74 4164918 0.01 dbInCheck_ 0.1 29.0634524.66 7043351 0.00 RSTKType ...(zillions of lines deleted)... The routines probably won't mean much to you (they had better not :-). I guess I don't understand what the problem is. I'm no prof guru, but I have used the data provided by prof to write more efficient programs and that's what counts to me. I suspect that if you were more specific about your problems and the system you are using, then you might get more help. Have fun, -Eric -- Eric F. Johnson phone: +1 612 894 0313 BTI: Industrial Boulware Technologies, Inc. fax: +1 612 894 0316 automation systems 415 W. Travelers Trail email: erc@pai.mn.org and services Burnsville, MN 55337 USA